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 gboolean fld_outgoing;
00068 };
00069
00070 enum
00071 {
00072 _is_set_id = 1 << 0,
00073 _is_set_service_id = 1 << 1,
00074 _is_set_event_type_id = 1 << 2,
00075 _is_set_storage_time = 1 << 3,
00076 _is_set_start_time = 1 << 4,
00077 _is_set_end_time = 1 << 5,
00078 _is_set_is_read = 1 << 6,
00079 _is_set_flags = 1 << 7,
00080 _is_set_bytes_sent = 1 << 8,
00081 _is_set_bytes_received = 1 << 9,
00082 _is_set_remote_ebook_uid = 1 << 10,
00083 _is_set_local_uid = 1 << 11,
00084 _is_set_local_name = 1 << 12,
00085 _is_set_remote_uid = 1 << 13,
00086 _is_set_remote_name = 1 << 14,
00087 _is_set_channel = 1 << 15,
00088 _is_set_free_text = 1 << 16,
00089 _is_set_group_uid = 1 << 17,
00090
00091 _is_set_service = 1 << 18,
00092 _is_set_event_type = 1 << 19,
00093 _is_set_additional_text = 1 << 20,
00094 _is_set_icon_name = 1 << 21,
00095 _is_set_pango_markup = 1 << 22,
00096 _is_set_outgoing = 1 << 23
00097 };
00098
00099 #define RTCOM_EL_EVENT_INIT(ev) ((ev)->_mask = 0)
00100 #define RTCOM_EL_EVENT_IS_SET(ev, FIELD) ((ev)->_mask & _is_set_ ## FIELD)
00101 #define RTCOM_EL_EVENT_GET_FIELD(ev, FIELD) ((ev)->fld_ ## FIELD)
00102 #define RTCOM_EL_EVENT_SET_FIELD(ev, FIELD, value) \
00103 do {\
00104 (ev)->_mask |= _is_set_ ## FIELD; \
00105 (ev)->fld_ ## FIELD = value;\
00106 } while(0)
00107 #define RTCOM_EL_EVENT_UNSET_FIELD(ev, FIELD) (ev)->_mask &= ~ _is_set_ ## FIELD;
00108
00118 RTComElEvent * rtcom_el_event_new(void);
00119
00126 gboolean rtcom_el_event_equals(
00127 RTComElEvent * first,
00128 RTComElEvent * second);
00129
00134 void rtcom_el_event_free(
00135 RTComElEvent * ev);
00136
00142 void rtcom_el_event_free_contents(
00143 RTComElEvent *ev);
00144
00145 G_END_DECLS
00146
00147 #endif
00148
00149
00150