00001
00116 #ifndef __EL_H
00117 #define __EL_H
00118
00119 #include <glib-object.h>
00120
00121 #include "rtcom-eventlogger/event.h"
00122 #include "rtcom-eventlogger/eventlogger-types.h"
00123 #include "rtcom-eventlogger/eventlogger-iter.h"
00124 #include "rtcom-eventlogger/eventlogger-attach-iter.h"
00125
00126 G_BEGIN_DECLS
00127
00128 #define RTCOM_TYPE_EL (rtcom_el_get_type ())
00129 #define RTCOM_EL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RTCOM_TYPE_EL, RTComEl))
00130 #define RTCOM_EL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RTCOM_TYPE_EL, RTComElClass))
00131 #define RTCOM_IS_EL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RTCOM_TYPE_EL))
00132 #define RTCOM_IS_EL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RTCOM_TYPE_EL))
00133 #define RTCOM_EL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RTCOM_TYPE_EL, RTComElClass))
00134
00135 #define RTCOM_EL_ERROR rtcom_el_error_quark ()
00136 GQuark rtcom_el_error_quark ();
00137
00138 typedef struct _RTComElClass RTComElClass;
00139 typedef struct _RTComEl RTComEl;
00140
00141 #include "rtcom-eventlogger/eventlogger-query.h"
00142
00143 struct _RTComElClass
00144 {
00145 GObjectClass parent_class;
00146 };
00147
00148 struct _RTComEl
00149 {
00150 GObject parent_instance;
00151 };
00152
00153 struct _RTComElRemote {
00154 gchar *local_uid;
00155 gchar *remote_uid;
00156 gchar *abook_uid;
00157 gchar *remote_name;
00158
00159 };
00160 typedef struct _RTComElRemote RTComElRemote;
00161
00162 GType rtcom_el_get_type (void) G_GNUC_CONST;
00163
00169 RTComEl * rtcom_el_new (void);
00170
00177 RTComEl * rtcom_el_get_shared (void);
00178
00185 gint rtcom_el_add_event(
00186 RTComEl * el,
00187 RTComElEvent * event,
00188 GError ** error);
00189
00198 gint rtcom_el_add_event_full(
00199 RTComEl * el,
00200 RTComElEvent * ev,
00201 GHashTable *headers,
00202 GList *attachments,
00203 GError ** error);
00204
00212 const gchar * rtcom_el_get_last_group_uid(
00213 RTComEl * el);
00214
00223 gint rtcom_el_add_header(
00224 RTComEl * el,
00225 gint event_id,
00226 const gchar * key,
00227 const gchar * value,
00228 GError ** error);
00229
00238 gint rtcom_el_add_attachment(
00239 RTComEl * el,
00240 gint event_id,
00241 const gchar * path,
00242 const gchar * desc,
00243 GError ** error);
00244
00252 gint rtcom_el_set_read_event(
00253 RTComEl * el,
00254 gint event_id,
00255 gboolean read,
00256 GError ** error);
00257
00265 gint rtcom_el_set_read_events(
00266 RTComEl * el,
00267 gint * event_ids,
00268 gboolean read,
00269 GError ** error);
00270
00280 gint rtcom_el_set_event_flag(
00281 RTComEl * el,
00282 gint event_id,
00283 const gchar * flag,
00284 GError ** error);
00285
00295 gint rtcom_el_unset_event_flag(
00296 RTComEl * el,
00297 gint event_id,
00298 const gchar * flag,
00299 GError ** error);
00300
00310 gboolean rtcom_el_set_end_time(
00311 RTComEl * el,
00312 gint event_id,
00313 time_t end_time,
00314 GError ** error);
00315
00323 RTComElIter * rtcom_el_get_events(
00324 RTComEl * el,
00325 RTComElQuery * query);
00326
00341 RTComElIter * rtcom_el_get_events_atomic(
00342 RTComEl * el,
00343 RTComElQuery * query);
00344
00351 GHashTable * rtcom_el_fetch_event_headers(
00352 RTComEl * el,
00353 gint event_id);
00354
00363 gint * rtcom_el_get_events_by_header(
00364 RTComEl * el,
00365 const gchar * key,
00366 const gchar * val);
00367
00373 gint rtcom_el_get_service_id(
00374 RTComEl * el,
00375 const gchar * service);
00376
00382 gint rtcom_el_get_eventtype_id(
00383 RTComEl * el,
00384 const gchar * eventtype);
00385
00397 gint rtcom_el_get_flag_value(
00398 RTComEl * el,
00399 const gchar * flag);
00400
00407 GList * rtcom_el_get_unique_remote_ebook_uids(
00408 RTComEl * el);
00409
00416 GList * rtcom_el_get_unique_remote_uids(
00417 RTComEl * el);
00418
00425 GList * rtcom_el_get_unique_remote_names(
00426 RTComEl * el);
00427
00436 GList * rtcom_el_get_unique_account_ids(
00437 RTComEl * el);
00438
00450 gboolean rtcom_el_get_group_info(
00451 RTComEl * el,
00452 const gchar * group_uid,
00453 gint * total_events,
00454 gint * unread_events,
00455 gint * group_flags);
00456
00463 gint rtcom_el_get_group_most_recent_event_id(
00464 RTComEl * el,
00465 const gchar * group_uid);
00466
00473 gint rtcom_el_get_contacts_events_n(
00474 RTComEl * el,
00475 const gchar * remote_ebook_uid);
00476
00485 gint rtcom_el_get_local_remote_uid_events_n(
00486 RTComEl * el,
00487 const gchar * local_uid,
00488 const gchar * remote_uid);
00489
00497 gint rtcom_el_delete_event(
00498 RTComEl * el,
00499 gint event_id,
00500 GError ** error);
00501
00510 gboolean rtcom_el_delete_events(
00511 RTComEl * el,
00512 RTComElQuery * query,
00513 GError ** error);
00514
00521 gboolean rtcom_el_delete_by_service(
00522 RTComEl * el,
00523 const gchar * service);
00524
00531 gboolean rtcom_el_delete_by_group_uids(
00532 RTComEl * el,
00533 const gchar ** group_uids);
00534
00540 gboolean rtcom_el_delete_all(
00541 RTComEl * el);
00542
00551 gint rtcom_el_count_by_service(
00552 RTComEl * el,
00553 const gchar * service);
00554
00561 gint rtcom_el_get_flag_id(
00562 RTComEl * el,
00563 const gchar * flag);
00564
00565
00576 gboolean rtcom_el_update_remote_contact(RTComEl *el,
00577 const gchar *local_uid, const gchar *remote_uid,
00578 const gchar *new_abook_uid, const gchar *new_remote_name,
00579 GError **error);
00580
00581
00582 #define rtcom_eventlogger_update_remote_contact(a,b,c,d,e,f) \
00583 rtcom_el_update_remote_contact(a,b,c,d,e,f)
00584
00592 gboolean rtcom_el_update_remote_contacts(RTComEl *el,
00593 GList *contacts, GError **error);
00594
00602 gboolean rtcom_el_remove_abook_uid (RTComEl *el,
00603 const gchar *abook_uid, GError **error);
00604
00612 gboolean rtcom_el_remove_abook_uids (RTComEl *el, GList *uids, GError **error);
00613
00619 gint rtcom_el_fire_event_updated(
00620 RTComEl * el,
00621 gint event_id);
00622
00623 G_END_DECLS
00624
00625 #endif
00626
00627
00628