00001
00027 #ifndef __QUERY_H
00028 #define __QUERY_H
00029
00030 #include "rtcom-eventlogger/eventlogger-types.h"
00031
00032 #include <glib-object.h>
00033
00034 G_BEGIN_DECLS
00035
00036 #define RTCOM_TYPE_EL_QUERY (rtcom_el_query_get_type ())
00037 #define RTCOM_EL_QUERY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RTCOM_TYPE_EL_QUERY, RTComElQuery))
00038 #define RTCOM_EL_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RTCOM_TYPE_EL_QUERY, RTComElQueryClass))
00039 #define RTCOM_IS_EL_QUERY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RTCOM_TYPE_EL_QUERY))
00040 #define RTCOM_IS_EL_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RTCOM_TYPE_EL_QUERY))
00041 #define RTCOM_EL_QUERY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RTCOM_TYPE_EL_QUERY, RTComElQueryClass))
00042
00043 typedef struct _RTComElQueryClass RTComElQueryClass;
00044 typedef struct _RTComElQuery RTComElQuery;
00045
00046 #include "rtcom-eventlogger/eventlogger.h"
00047
00048 struct _RTComElQueryClass
00049 {
00050 GObjectClass parent_class;
00051 };
00052
00053 struct _RTComElQuery
00054 {
00055 GObject parent_instance;
00056 };
00057
00058 typedef enum
00059 {
00060 RTCOM_EL_QUERY_GROUP_BY_NONE,
00061 RTCOM_EL_QUERY_GROUP_BY_CONTACT,
00062 RTCOM_EL_QUERY_GROUP_BY_UIDS,
00063 RTCOM_EL_QUERY_GROUP_BY_GROUP
00064 } RTComElQueryGroupBy;
00065
00066 GType rtcom_el_query_get_type(void) G_GNUC_CONST;
00067
00073 RTComElQuery * rtcom_el_query_new(
00074 RTComEl * el);
00075
00081 void rtcom_el_query_set_is_caching(
00082 RTComElQuery * query,
00083 gboolean is_caching);
00084
00090 void rtcom_el_query_set_limit(
00091 RTComElQuery * query,
00092 gint limit);
00093
00099 void rtcom_el_query_set_offset(
00100 RTComElQuery * query,
00101 gint offset);
00102
00109 void rtcom_el_query_set_group_by(
00110 RTComElQuery * query,
00111 RTComElQueryGroupBy group_by);
00112
00121 gboolean rtcom_el_query_refresh(
00122 RTComElQuery * query);
00123
00178 gboolean rtcom_el_query_prepare(
00179 RTComElQuery * query,
00180 ...);
00181
00187 const gchar * rtcom_el_query_get_sql(
00188 RTComElQuery * query);
00189
00196 const gchar * rtcom_el_query_get_where_clause(
00197 RTComElQuery * query);
00198
00199
00200
00201
00202
00203 GHashTable *rtcom_el_query_get_row(gpointer stmt);
00204
00205
00206
00207 void rtcom_el_query_update_row(gpointer stmt, GHashTable *row);
00208
00209 G_END_DECLS
00210
00211 #endif
00212
00213
00214