diff options
Diffstat (limited to 'calendar/cal-client')
-rw-r--r-- | calendar/cal-client/cal-client.c | 25 | ||||
-rw-r--r-- | calendar/cal-client/cal-client.h | 6 | ||||
-rw-r--r-- | calendar/cal-client/cal-listener.c | 4 | ||||
-rw-r--r-- | calendar/cal-client/cal-listener.h | 4 |
4 files changed, 33 insertions, 6 deletions
diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c index b038c26752..d48a11a7f0 100644 --- a/calendar/cal-client/cal-client.c +++ b/calendar/cal-client/cal-client.c @@ -42,7 +42,7 @@ typedef enum { } LoadState; /* Private part of the CalClient structure */ -typedef struct { +struct _CalClientPrivate { /* Load state to avoid multiple loads */ LoadState load_state; @@ -54,7 +54,7 @@ typedef struct { /* The calendar client interface object we are contacting */ Evolution_Calendar_Cal cal; -} CalClientPrivate; +}; @@ -548,6 +548,27 @@ cal_client_create_calendar (CalClient *client, const char *str_uri) return load_or_create (client, str_uri, FALSE); } +/** + * cal_client_is_loaded: + * @client: A calendar client. + * + * Queries whether a calendar client has been loaded successfully. + * + * Return value: TRUE if the client has been loaded, FALSE if it has not or if + * the loading process is not finished yet. + **/ +gboolean +cal_client_is_loaded (CalClient *client) +{ + CalClientPrivate *priv; + + g_return_val_if_fail (client != NULL, FALSE); + g_return_val_if_fail (IS_CAL_CLIENT (client), FALSE); + + priv = client->priv; + return (priv->load_state == LOAD_STATE_LOADED); +} + /* Converts our representation of a calendar component type into its CORBA representation */ static Evolution_Calendar_CalObjType corba_obj_type (CalObjType type) diff --git a/calendar/cal-client/cal-client.h b/calendar/cal-client/cal-client.h index 24cc170350..6747c7488e 100644 --- a/calendar/cal-client/cal-client.h +++ b/calendar/cal-client/cal-client.h @@ -40,6 +40,8 @@ BEGIN_GNOME_DECLS typedef struct _CalClient CalClient; typedef struct _CalClientClass CalClientClass; +typedef struct _CalClientPrivate CalClientPrivate; + /* Load status for the cal_loaded signal */ typedef enum { CAL_CLIENT_LOAD_SUCCESS, @@ -59,7 +61,7 @@ struct _CalClient { GtkObject object; /* Private data */ - gpointer priv; + CalClientPrivate *priv; }; struct _CalClientClass { @@ -82,6 +84,8 @@ CalClient *cal_client_new (void); gboolean cal_client_load_calendar (CalClient *client, const char *str_uri); gboolean cal_client_create_calendar (CalClient *client, const char *str_uri); +gboolean cal_client_is_loaded (CalClient *client); + int cal_client_get_n_objects (CalClient *client, CalObjType type); CalClientGetStatus cal_client_get_object (CalClient *client, diff --git a/calendar/cal-client/cal-listener.c b/calendar/cal-client/cal-listener.c index d9a028b20d..c5626fee9d 100644 --- a/calendar/cal-client/cal-listener.c +++ b/calendar/cal-client/cal-listener.c @@ -26,10 +26,10 @@ /* Private part of the CalListener structure */ -typedef struct { +struct _CalListenerPrivate { /* The calendar this listener refers to */ Evolution_Calendar_Cal cal; -} CalListenerPrivate; +}; diff --git a/calendar/cal-client/cal-listener.h b/calendar/cal-client/cal-listener.h index 171da0d5c3..b4eda6c2d6 100644 --- a/calendar/cal-client/cal-listener.h +++ b/calendar/cal-client/cal-listener.h @@ -40,11 +40,13 @@ BEGIN_GNOME_DECLS typedef struct _CalListener CalListener; typedef struct _CalListenerClass CalListenerClass; +typedef struct _CalListenerPrivate CalListenerPrivate; + struct _CalListener { BonoboObject object; /* Private data */ - gpointer priv; + CalListenerPrivate *priv; }; struct _CalListenerClass { |