
#ifndef __XESAM2_H__
#define __XESAM2_H__

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>

G_BEGIN_DECLS


#define TYPE_SEARCHER (searcher_get_type ())
#define SEARCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SEARCHER, Searcher))
#define SEARCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SEARCHER, SearcherClass))
#define IS_SEARCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SEARCHER))
#define IS_SEARCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SEARCHER))
#define SEARCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SEARCHER, SearcherClass))

typedef struct _Searcher Searcher;
typedef struct _SearcherClass SearcherClass;
typedef struct _SearcherPrivate SearcherPrivate;

#define TYPE_SEARCH (search_get_type ())
#define SEARCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SEARCH, Search))
#define SEARCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SEARCH, SearchClass))
#define IS_SEARCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SEARCH))
#define IS_SEARCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SEARCH))
#define SEARCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SEARCH, SearchClass))

typedef struct _Search Search;
typedef struct _SearchClass SearchClass;
typedef struct _SearchPrivate SearchPrivate;

/* 
public struct QueryHint {
string query;
Value value;
}
*/
struct _Searcher {
	GObject parent_instance;
	SearcherPrivate * priv;
};

struct _SearcherClass {
	GObjectClass parent_class;
};

/* QueryHint[] query_hints, */
struct _Search {
	GObject parent_instance;
	SearchPrivate * priv;
};

struct _SearchClass {
	GObjectClass parent_class;
};


void searcher_NewSearch (Searcher* self, const char* search_object_path, const char* query_xml, char** fields_to_monitor, int fields_to_monitor_length1, guint offset, guint count, gboolean is_live, const char* search_to_close, guint* hit_count, char*** field_map, int* field_map_length1, char**** hit_data, int* hit_data_length1);
void searcher_NewSearchBySortKey (Searcher* self, const char* search_object_path, const char* query_xml, char** fields_to_monitor, int fields_to_monitor_length1, const char* start_sortkey, const char* end_sortkey, guint offset, guint count, gboolean is_live, const char* search_to_close, guint* hit_count, char*** field_map, int* field_map_length1, char**** hit_data, int* hit_data_length1);
Searcher* searcher_construct (GType object_type);
Searcher* searcher_new (void);
void searcher_dbus_register_object (DBusConnection* connection, const char* path, void* object);
DBusHandlerResult searcher_dbus_message (DBusConnection* connection, DBusMessage* message, void* object);
GType searcher_get_type (void);
void search_GetHits (Search* self, guint offset, guint count, char**** hits, int* hits_length1);
void search_GetHitsBySortKey (Search* self, const char* start_sortkey, const char* end_sortkey, guint offset, guint count, char**** hits, int* hits_length1);
void search_Close (Search* self);
Search* search_construct (GType object_type);
Search* search_new (void);
void search_dbus_register_object (DBusConnection* connection, const char* path, void* object);
DBusHandlerResult search_dbus_message (DBusConnection* connection, DBusMessage* message, void* object);
GType search_get_type (void);


G_END_DECLS

#endif
