telepathygabble/inc/gabble-search-channel.h
changeset 10 59927b2d3b75
parent 0 d0f3a028347a
equal deleted inserted replaced
0:d0f3a028347a 10:59927b2d3b75
     1 /*
       
     2  * gabble-im-channel.h - Header for GabbleSearchChannel
       
     3  * Copyright (C) 2005 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_CHANNEL_H__
       
    22 #define __GABBLE_SEARCH_CHANNEL_H__
       
    23 
       
    24 #include <glib-object.h>
       
    25 #include <time.h>
       
    26 
       
    27 #include "loudmouth/loudmouth.h"
       
    28 
       
    29 
       
    30 #include "handles.h"
       
    31 #include "telepathy-constants.h"
       
    32 #include "search-mixin.h"
       
    33 
       
    34 G_BEGIN_DECLS
       
    35 
       
    36 
       
    37                                              	                   	  			                        	  		   
       
    38 extern LmHandlerResult
       
    39 search_channel_iq_cb (LmMessageHandler *handler,
       
    40 					  LmConnection *lmconn,
       
    41 					  LmMessage *message,
       
    42 					  gpointer user_data);
       
    43 
       
    44 typedef struct _GabbleSearchChannel GabbleSearchChannel;
       
    45 typedef struct _GabbleSearchChannelClass GabbleSearchChannelClass;
       
    46 
       
    47 struct _GabbleSearchChannelClass {
       
    48     GObjectClass parent_class;
       
    49 
       
    50     GabbleSearchMixinClass mixin_class;
       
    51 };
       
    52 
       
    53 struct _GabbleSearchChannel {
       
    54     GObject parent;
       
    55 	LmMessageHandler *iq_cb;
       
    56     GabbleSearchMixin search_mixin;
       
    57 	//todo: channel_index used for closing/removing the channel..
       
    58 	//can this be done without index?
       
    59 	guint channel_index;
       
    60     gpointer priv;
       
    61 };
       
    62 
       
    63 IMPORT_C GType gabble_search_channel_get_type(void);
       
    64 
       
    65 /* TYPE MACROS */
       
    66 #define GABBLE_TYPE_SEARCH_CHANNEL \
       
    67   (gabble_search_channel_get_type())
       
    68 #define GABBLE_SEARCH_CHANNEL(obj) \
       
    69   (G_TYPE_CHECK_INSTANCE_CAST((obj), GABBLE_TYPE_SEARCH_CHANNEL, GabbleSearchChannel))
       
    70 #define GABBLE_SEARCH_CHANNEL_CLASS(klass) \
       
    71   (G_TYPE_CHECK_CLASS_CAST((klass), GABBLE_TYPE_SEARCH_CHANNEL, GabbleSearchChannelClass))
       
    72 #define GABBLE_IS_SEARCH_CHANNEL(obj) \
       
    73   (G_TYPE_CHECK_INSTANCE_TYPE((obj), GABBLE_TYPE_SEARCH_CHANNEL))
       
    74 #define GABBLE_IS_SEARCH_CHANNEL_CLASS(klass) \
       
    75   (G_TYPE_CHECK_CLASS_TYPE((klass), GABBLE_TYPE_SEARCH_CHANNEL))
       
    76 #define GABBLE_SEARCH_CHANNEL_GET_CLASS(obj) \
       
    77   (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_SEARCH_CHANNEL, GabbleSearchChannelClass))
       
    78 
       
    79 
       
    80 
       
    81 gboolean
       
    82 gabble_search_channel_close (GabbleSearchChannel *self,
       
    83                          		GError **error);
       
    84 
       
    85 gboolean
       
    86 gabble_search_channel_get_channel_type (GabbleSearchChannel *self,
       
    87 	                                    gchar **ret,
       
    88 	                                    GError **error);
       
    89 
       
    90 
       
    91 gboolean
       
    92 gabble_search_channel_get_interfaces (GabbleSearchChannel *self,
       
    93                                   		gchar ***ret,
       
    94                                   		GError **error);
       
    95 
       
    96 
       
    97 gboolean
       
    98 gabble_search_channel_get_search_keys (	GabbleSearchChannel *self,
       
    99 										gchar **instruction, 
       
   100 										gchar ***key_names,
       
   101 		                        		GError **error
       
   102                         	  		   );
       
   103 
       
   104 gboolean
       
   105 gabble_search_channel_get_search_state (	GabbleSearchChannel *self,
       
   106                                   			guint *ret,
       
   107                         					GError **error
       
   108                         	  			);
       
   109 
       
   110 gboolean
       
   111 gabble_search_channel_search (	GabbleSearchChannel *self,
       
   112                                   GHashTable *params,
       
   113                         			GError **error
       
   114                         	  );       
       
   115                         	  
       
   116 
       
   117 gboolean
       
   118 gabble_search_channel_get_handle (GabbleSearchChannel *self,
       
   119                               guint *ret,
       
   120                               guint *ret1,
       
   121                               GError **error);       
       
   122                               
       
   123                               
       
   124   
       
   125 G_END_DECLS
       
   126 
       
   127 #endif /* #ifndef __GABBLE_SEARCH_CHANNEL_H__*/