Description
The CalClient object provides a nice GTK+ wrapper for the CORBA
interfaces that are used to communicate between calendar clients
and the personal calendar server in the user's Wombat daemon. The
CORBA interfaces transfer calendar components in RFC 2445 text
format; the CalClient object automatically converts these into
CalComponent structures that are easier to handle.
After a CalClient object is created with cal_client_new(), it
should be asked to send a request to the personal calendar server
to load or create a calendar based on its URI. The server will
asynchronously notify the client about completion of the request,
and will return an appropriate result code; this should be noted
by the client with the cal_loaded signal.
When a client asks the server to update or delete a calendar
component from the storage, the server will do so and then notify
all the clients about the update or removal. This is the core of
the model/view split between calendar clients and the storage in
the personal calendar server. Clients should watch the obj_updated and obj_removed signals on the
CalClient objects they create so that they can be notified about
changes in the storage.
Details
CAL_CLIENT()
#define CAL_CLIENT(obj) (GTK_CHECK_CAST ((obj), CAL_CLIENT_TYPE, CalClient)) |
Casts a GtkObject to a CalClient.
enum CalClientOpenStatus
typedef enum {
CAL_CLIENT_OPEN_SUCCESS,
CAL_CLIENT_OPEN_ERROR,
CAL_CLIENT_OPEN_NOT_FOUND,
CAL_CLIENT_OPEN_METHOD_NOT_SUPPORTED
} CalClientOpenStatus; |
enum CalClientGetStatus
typedef enum {
CAL_CLIENT_GET_SUCCESS,
CAL_CLIENT_GET_NOT_FOUND,
CAL_CLIENT_GET_SYNTAX_ERROR
} CalClientGetStatus; |
These values describe the result of the cal_client_get_object()
function.
enum CalClientLoadState
typedef enum {
CAL_CLIENT_LOAD_NOT_LOADED,
CAL_CLIENT_LOAD_LOADING,
CAL_CLIENT_LOAD_LOADED
} CalClientLoadState; |
enum CalClientChangeType
typedef enum {
CAL_CLIENT_CHANGE_ADDED = 1 << 0,
CAL_CLIENT_CHANGE_MODIFIED = 1 << 1,
CAL_CLIENT_CHANGE_DELETED = 1 << 2
} CalClientChangeType; |
cal_client_open_calendar ()
gboolean cal_client_open_calendar (CalClient *client,
const char *str_uri,
gboolean only_if_exists); |
Makes a calendar client initiate a request to open a calendar. The calendar
client will emit the "cal_opened" signal when the response from the server is
received.
cal_client_get_load_state ()
Queries the state of loading of a calendar client.
cal_client_get_uri ()
const char* cal_client_get_uri (CalClient *client); |
Queries the URI that is open in a calendar client.
cal_client_get_n_objects ()
Counts the number of calendar components of the specified type. This can be
used to count how many events, to-dos, or journals there are, for example.
cal_client_get_uids ()
Queries a calendar for a list of unique identifiers corresponding to calendar
objects whose type matches one of the types specified in the type flags.
cal_client_get_object ()
Queries a calendar for a calendar component object based on its unique
identifier.
cal_client_get_changes ()
cal_client_change_list_free ()
void cal_client_change_list_free (GList *list); |
Frees a list of CalClientChange structures.
cal_client_get_objects_in_range ()
GList* cal_client_get_objects_in_range (CalClient *client,
CalObjType type,
time_t start,
time_t end); |
Queries a calendar for the objects that occur or recur in the specified range
of time.
cal_client_get_alarms_in_range ()
GSList* cal_client_get_alarms_in_range (CalClient *client,
time_t start,
time_t end); |
Queries a calendar for the alarms that trigger in the specified range of
time.
cal_client_get_alarms_for_object ()
Queries a calendar for the alarms of a particular object that trigger in the
specified range of time.
cal_client_update_object ()
Asks a calendar to update a component. Any existing component with the
specified component's UID will be replaced. The client program should not
assume that the object is actually in the server's storage until it has
received the "obj_updated" notification signal.
cal_client_remove_object ()
gboolean cal_client_remove_object (CalClient *client,
const char *uid); |
Asks a calendar to remove a component. If the server is able to remove the
component, all clients will be notified and they will emit the "obj_removed"
signal.
cal_client_get_query ()
CalQuery* cal_client_get_query (CalClient *client,
const char *sexp); |
Creates a live query object from a loaded calendar.
Signals
The "cal-opened" signal
void user_function (CalClient *calclient,
gint arg1,
gpointer user_data); |
The "cal-set-mode" signal
void user_function (CalClient *calclient,
gint arg1,
gint arg2,
gpointer user_data); |
The "obj-updated" signal
void user_function (CalClient *calclient,
gchar *arg1,
gpointer user_data); |
This signal is emitted when the calendar clients receives
notification of a calendar component's data being changed in the
personal calendar server. Graphical clients may want to get the
new version of the object and update their display, for example.
The "obj-removed" signal
void user_function (CalClient *calclient,
gchar *arg1,
gpointer user_data); |
This signal is emitted when the calendar client receives
notification for a calendar component being removed from the
storage in the personal calendar server. Graphical clients may
want to delete the corresponding object from their display, for
example.
The "categories-changed" signal
void user_function (CalClient *calclient,
gpointer arg1,
gpointer user_data); |
The "forget-password" signal
void user_function (CalClient *calclient,
gchar *arg1,
gpointer user_data); |