00001
00027 #ifndef __EVENT_H
00028 #define __EVENT_H
00029
00030 #include "rtcom-eventlogger/eventlogger-types.h"
00031
00032 G_BEGIN_DECLS
00033
00034 typedef struct _RTComElEvent RTComElEvent;
00035 struct _RTComElEvent
00036 {
00037 guint _mask;
00038
00039
00040 gint fld_id;
00041 gint fld_service_id;
00042 gint fld_event_type_id;
00043 time_t fld_storage_time;
00044 time_t fld_start_time;
00045 time_t fld_end_time;
00046 gboolean fld_is_read;
00047 gint fld_flags;
00048 gint fld_bytes_sent;
00049 gint fld_bytes_received;
00050 gchar * fld_local_uid;
00051 gchar * fld_local_name;
00052 gchar * fld_remote_uid;
00053 gchar * fld_remote_name;
00054 gchar * fld_remote_ebook_uid;
00055 gchar * fld_channel;
00056 gchar * fld_free_text;
00057 gchar * fld_group_uid;
00058
00059
00060 gchar * fld_service;
00061 gchar * fld_event_type;
00062
00063 gchar * fld_additional_text;
00064 gchar * fld_icon_name;
00065 gchar * fld_pango_markup;
00066 };
00067
00068 enum
00069 {
00070 _is_set_id = 1 << 0,
00071 _is_set_service_id = 1 << 1,
00072 _is_set_event_type_id = 1 << 2,
00073 _is_set_storage_time = 1 << 3,
00074 _is_set_start_time = 1 << 4,
00075 _is_set_end_time = 1 << 5,
00076 _is_set_is_read = 1 << 6,
00077 _is_set_flags = 1 << 7,
00078 _is_set_bytes_sent = 1 << 8,
00079 _is_set_bytes_received = 1 << 9,
00080 _is_set_remote_ebook_uid = 1 << 10,
00081 _is_set_local_uid = 1 << 11,
00082 _is_set_local_name = 1 << 12,
00083 _is_set_remote_uid = 1 << 13,
00084 _is_set_remote_name = 1 << 14,
00085 _is_set_channel = 1 << 15,
00086 _is_set_free_text = 1 << 16,
00087 _is_set_group_uid = 1 << 17,
00088
00089 _is_set_service = 1 << 18,
00090 _is_set_event_type = 1 << 19,
00091 _is_set_additional_text = 1 << 20,
00092 _is_set_icon_name = 1 << 21,
00093 _is_set_pango_markup = 1 << 22
00094 };
00095
00096 #define RTCOM_EL_EVENT_INIT(ev) ((ev)->_mask = 0)
00097 #define RTCOM_EL_EVENT_IS_SET(ev, FIELD) ((ev)->_mask & _is_set_ ## FIELD)
00098 #define RTCOM_EL_EVENT_GET_FIELD(ev, FIELD) ((ev)->fld_ ## FIELD)
00099 #define RTCOM_EL_EVENT_SET_FIELD(ev, FIELD, value) \
00100 do {\
00101 (ev)->_mask |= _is_set_ ## FIELD; \
00102 (ev)->fld_ ## FIELD = value;\
00103 } while(0)
00104 #define RTCOM_EL_EVENT_UNSET_FIELD(ev, FIELD) (ev)->_mask &= ~ _is_set_ ## FIELD;
00105
00115 RTComElEvent * rtcom_el_event_new(void);
00116
00123 gboolean rtcom_el_event_equals(
00124 RTComElEvent * first,
00125 RTComElEvent * second);
00126
00131 void rtcom_el_event_free(
00132 RTComElEvent * ev);
00133
00139 void rtcom_el_event_free_contents(
00140 RTComElEvent *ev);
00141
00142 G_END_DECLS
00143
00144 #endif
00145
00146
00147