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 GType rtcom_el_get_type (void) G_GNUC_CONST;
00154
00160 RTComEl * rtcom_el_new (void);
00161
00168 gint rtcom_el_add_event(
00169 RTComEl * el,
00170 RTComElEvent * event,
00171 GError ** error);
00172
00181 gint rtcom_el_add_event_full(
00182 RTComEl * el,
00183 RTComElEvent * ev,
00184 GHashTable *headers,
00185 GList *attachments,
00186 GError ** error);
00187
00195 const gchar * rtcom_el_get_last_group_uid(
00196 RTComEl * el);
00197
00206 gint rtcom_el_add_header(
00207 RTComEl * el,
00208 gint event_id,
00209 const gchar * key,
00210 const gchar * value,
00211 GError ** error);
00212
00221 gint rtcom_el_add_attachment(
00222 RTComEl * el,
00223 gint event_id,
00224 const gchar * path,
00225 const gchar * desc,
00226 GError ** error);
00227
00235 gint rtcom_el_set_read_event(
00236 RTComEl * el,
00237 gint event_id,
00238 gboolean read,
00239 GError ** error);
00240
00248 gint rtcom_el_set_read_events(
00249 RTComEl * el,
00250 gint * event_ids,
00251 gboolean read,
00252 GError ** error);
00253
00263 gint rtcom_el_set_event_flag(
00264 RTComEl * el,
00265 gint event_id,
00266 const gchar * flag,
00267 GError ** error);
00268
00278 gint rtcom_el_unset_event_flag(
00279 RTComEl * el,
00280 gint event_id,
00281 const gchar * flag,
00282 GError ** error);
00283
00293 gboolean rtcom_el_set_end_time(
00294 RTComEl * el,
00295 gint event_id,
00296 time_t end_time,
00297 GError ** error);
00298
00306 RTComElIter * rtcom_el_get_events(
00307 RTComEl * el,
00308 RTComElQuery * query);
00309
00324 RTComElIter * rtcom_el_get_events_atomic(
00325 RTComEl * el,
00326 RTComElQuery * query);
00327
00334 GHashTable * rtcom_el_fetch_event_headers(
00335 RTComEl * el,
00336 gint event_id);
00337
00346 gint * rtcom_el_get_events_by_header(
00347 RTComEl * el,
00348 const gchar * key,
00349 const gchar * val);
00350
00356 gint rtcom_el_get_service_id(
00357 RTComEl * el,
00358 const gchar * service);
00359
00365 gint rtcom_el_get_eventtype_id(
00366 RTComEl * el,
00367 const gchar * eventtype);
00368
00380 gint rtcom_el_get_flag_value(
00381 RTComEl * el,
00382 const gchar * flag);
00383
00390 GList * rtcom_el_get_unique_remote_ebook_uids(
00391 RTComEl * el);
00392
00399 GList * rtcom_el_get_unique_remote_uids(
00400 RTComEl * el);
00401
00408 GList * rtcom_el_get_unique_remote_names(
00409 RTComEl * el);
00410
00419 GList * rtcom_el_get_unique_account_ids(
00420 RTComEl * el);
00421
00433 gboolean rtcom_el_get_group_info(
00434 RTComEl * el,
00435 const gchar * group_uid,
00436 gint * total_events,
00437 gint * unread_events,
00438 gint * group_flags);
00439
00446 gint rtcom_el_get_group_most_recent_event_id(
00447 RTComEl * el,
00448 const gchar * group_uid);
00449
00456 gint rtcom_el_get_contacts_events_n(
00457 RTComEl * el,
00458 const gchar * remote_ebook_uid);
00459
00468 gint rtcom_el_get_local_remote_uid_events_n(
00469 RTComEl * el,
00470 const gchar * local_uid,
00471 const gchar * remote_uid);
00472
00480 gint rtcom_el_delete_event(
00481 RTComEl * el,
00482 gint event_id,
00483 GError ** error);
00484
00493 gboolean rtcom_el_delete_events(
00494 RTComEl * el,
00495 RTComElQuery * query,
00496 GError ** error);
00497
00504 gboolean rtcom_el_delete_by_service(
00505 RTComEl * el,
00506 const gchar * service);
00507
00514 gboolean rtcom_el_delete_by_group_uids(
00515 RTComEl * el,
00516 const gchar ** group_uids);
00517
00523 gboolean rtcom_el_delete_all(
00524 RTComEl * el);
00525
00534 gint rtcom_el_count_by_service(
00535 RTComEl * el,
00536 const gchar * service);
00537
00544 gint rtcom_el_get_flag_id(
00545 RTComEl * el,
00546 const gchar * flag);
00547
00548
00559 gboolean rtcom_el_update_remote_contact(RTComEl *el,
00560 const gchar *local_uid, const gchar *remote_uid,
00561 const gchar *new_abook_uid, const gchar *new_remote_name,
00562 GError **error);
00563
00564
00565 #define rtcom_eventlogger_update_remote_contact(a,b,c,d,e,f) \
00566 rtcom_el_update_remote_contact(a,b,c,d,e,f)
00567
00575 gboolean rtcom_el_remove_abook_uid (RTComEl *el,
00576 const gchar *abook_uid, GError **error);
00577
00583 gint rtcom_el_fire_event_updated(
00584 RTComEl * el,
00585 gint event_id);
00586
00587 G_END_DECLS
00588
00589 #endif
00590
00591
00592