telepathygabble/inc/search-mixin.h
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /*
       
     2  * text-mixin.h - Header for GabbleSearchMixin
       
     3  * Copyright (C) 2006 Collabora Ltd.
       
     4  * 
       
     5  *
       
     6  * This library is free software; you can redistribute it and/or
       
     7  * modify it under the terms of the GNU Lesser General Public
       
     8  * License as published by the Free Software Foundation; either
       
     9  * version 2.1 of the License, or (at your option) any later version.
       
    10  *
       
    11  * This library is distributed in the hope that it will be useful,
       
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    14  * Lesser General Public License for more details.
       
    15  *
       
    16  * You should have received a copy of the GNU Lesser General Public
       
    17  * License along with this library; if not, write to the Free Software
       
    18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
       
    19  */
       
    20 
       
    21 #ifndef __GABBLE_SEARCH_MIXIN_H__
       
    22 #define __GABBLE_SEARCH_MIXIN_H__
       
    23 
       
    24 #include "handles.h"
       
    25 #include "handle-set.h"
       
    26 #include "util.h"
       
    27 
       
    28 
       
    29 
       
    30 G_BEGIN_DECLS
       
    31 
       
    32 typedef struct _GabbleSearchMixinClass GabbleSearchMixinClass;
       
    33 typedef struct _GabbleSearchMixin GabbleSearchMixin;
       
    34 
       
    35 struct _GabbleSearchMixinClass {
       
    36   guint search_result_received_signal_id;
       
    37   guint search_state_changed_signal_id;
       
    38 };
       
    39 
       
    40 struct _GabbleSearchMixin {
       
    41   
       
    42   //todo: any data if required 
       
    43   guint search_state;
       
    44   
       
    45 };
       
    46 
       
    47 GType gabble_search_mixin_get_type(void);
       
    48 
       
    49 /* TYPE MACROS */
       
    50 #define GABBLE_SEARCH_MIXIN_CLASS_OFFSET_QUARK (gabble_search_mixin_class_get_offset_quark())
       
    51 #define GABBLE_SEARCH_MIXIN_CLASS_OFFSET(o) (GPOINTER_TO_UINT (g_type_get_qdata (G_OBJECT_CLASS_TYPE (o), GABBLE_SEARCH_MIXIN_CLASS_OFFSET_QUARK)))
       
    52 #define GABBLE_SEARCH_MIXIN_CLASS(o) ((GabbleSearchMixinClass *) gabble_mixin_offset_cast (o, GABBLE_SEARCH_MIXIN_CLASS_OFFSET (o)))
       
    53 
       
    54 #define GABBLE_SEARCH_MIXIN_OFFSET_QUARK (gabble_search_mixin_get_offset_quark())
       
    55 #define GABBLE_SEARCH_MIXIN_OFFSET(o) (GPOINTER_TO_UINT (g_type_get_qdata (G_OBJECT_TYPE (o), GABBLE_SEARCH_MIXIN_OFFSET_QUARK)))
       
    56 #define GABBLE_SEARCH_MIXIN(o) ((GabbleSearchMixin *) gabble_mixin_offset_cast (o, GABBLE_SEARCH_MIXIN_OFFSET (o)))
       
    57 
       
    58 GQuark gabble_search_mixin_class_get_offset_quark (void);
       
    59 GQuark gabble_search_mixin_get_offset_quark (void);
       
    60 
       
    61 void gabble_search_mixin_class_init (GObjectClass *obj_cls, glong offset);
       
    62 void gabble_search_mixin_init (GObject *obj, glong offset );
       
    63 
       
    64 void gabble_search_mixin_finalize (GObject *obj);
       
    65 
       
    66 gboolean gabble_search_mixin_search (GObject *obj,GHashTable *params,
       
    67 									 GabbleConnection *conn,
       
    68 									 GError **error);
       
    69 
       
    70 gboolean gabble_search_mixin_get_search_state (	GObject *obj, guint *ret,
       
    71                         					GError **error );
       
    72                                 	 
       
    73 void
       
    74 _gabble_search_mixin_emit_search_result_received (GObject *obj,
       
    75                                                  guint contact_handle,
       
    76                              				     GHashTable *values );
       
    77 
       
    78 void
       
    79 _gabble_search_mixin_emit_search_state_changed (GObject *obj,
       
    80                                                  guint search_state );
       
    81                                                  
       
    82 
       
    83 void
       
    84 _gabble_search_mixin_set_search_state (GObject *obj, guint state );
       
    85 
       
    86 gboolean
       
    87 gabble_search_mixin_get_search_keys (	GObject *obj,
       
    88 										gchar **ret_instruction, 
       
    89 										gchar ***ret_searchkeys,
       
    90 										GabbleConnection *conn,
       
    91 		                        		GError **error
       
    92                         	  		   );                                                 
       
    93 
       
    94 
       
    95 G_END_DECLS
       
    96 
       
    97 #endif /* #ifndef __GABBLE_SEARCH_MIXIN_H__ */
       
    98