roomlist.h

Go to the documentation of this file.
00001 
00006 /* purple
00007  *
00008  * Purple is the legal property of its developers, whose names are too numerous
00009  * to list here.  Please refer to the COPYRIGHT file distributed with this
00010  * source distribution.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00025  */
00026 
00027 #ifndef _PURPLE_ROOMLIST_H_
00028 #define _PURPLE_ROOMLIST_H_
00029 
00030 typedef struct _PurpleRoomlist PurpleRoomlist;
00031 typedef struct _PurpleRoomlistRoom PurpleRoomlistRoom;
00032 typedef struct _PurpleRoomlistField PurpleRoomlistField;
00033 typedef struct _PurpleRoomlistUiOps PurpleRoomlistUiOps;
00034 
00040 typedef enum
00041 {
00042     PURPLE_ROOMLIST_ROOMTYPE_CATEGORY = 0x01, 
00043     PURPLE_ROOMLIST_ROOMTYPE_ROOM = 0x02      
00045 } PurpleRoomlistRoomType;
00046 
00050 typedef enum
00051 {
00052     PURPLE_ROOMLIST_FIELD_BOOL,
00053     PURPLE_ROOMLIST_FIELD_INT,
00054     PURPLE_ROOMLIST_FIELD_STRING 
00056 } PurpleRoomlistFieldType;
00057 
00058 #include "account.h"
00059 #include "glib.h"
00060 
00061 /**************************************************************************/
00063 /**************************************************************************/
00064 
00068 struct _PurpleRoomlist {
00069     PurpleAccount *account; 
00070     GList *fields; 
00071     GList *rooms; 
00072     gboolean in_progress; 
00073     gpointer ui_data; 
00074     gpointer proto_data; 
00075     guint ref; 
00076 };
00077 
00081 struct _PurpleRoomlistRoom {
00082     PurpleRoomlistRoomType type; 
00083     gchar *name; 
00084     GList *fields; 
00085     PurpleRoomlistRoom *parent; 
00086     gboolean expanded_once; 
00087 };
00088 
00092 struct _PurpleRoomlistField {
00093     PurpleRoomlistFieldType type; 
00094     gchar *label; 
00095     gchar *name; 
00096     gboolean hidden; 
00097 };
00098 
00102 struct _PurpleRoomlistUiOps {
00103     void (*show_with_account)(PurpleAccount *account); 
00104     void (*create)(PurpleRoomlist *list); 
00105     void (*set_fields)(PurpleRoomlist *list, GList *fields); 
00106     void (*add_room)(PurpleRoomlist *list, PurpleRoomlistRoom *room); 
00107     void (*in_progress)(PurpleRoomlist *list, gboolean flag); 
00108     void (*destroy)(PurpleRoomlist *list); 
00110     void (*_purple_reserved1)(void);
00111     void (*_purple_reserved2)(void);
00112     void (*_purple_reserved3)(void);
00113     void (*_purple_reserved4)(void);
00114 };
00115 
00116 
00117 #ifdef __cplusplus
00118 extern "C" {
00119 #endif
00120 
00121 /**************************************************************************/
00123 /**************************************************************************/
00135 void purple_roomlist_show_with_account(PurpleAccount *account);
00136 
00145 PurpleRoomlist *purple_roomlist_new(PurpleAccount *account);
00146 
00152 void purple_roomlist_ref(PurpleRoomlist *list);
00153 
00162 void purple_roomlist_unref(PurpleRoomlist *list);
00163 
00173 void purple_roomlist_set_fields(PurpleRoomlist *list, GList *fields);
00174 
00184 void purple_roomlist_set_in_progress(PurpleRoomlist *list, gboolean in_progress);
00185 
00195 gboolean purple_roomlist_get_in_progress(PurpleRoomlist *list);
00196 
00204 void purple_roomlist_room_add(PurpleRoomlist *list, PurpleRoomlistRoom *room);
00205 
00215 PurpleRoomlist *purple_roomlist_get_list(PurpleConnection *gc);
00216 
00225 void purple_roomlist_cancel_get_list(PurpleRoomlist *list);
00226 
00238 void purple_roomlist_expand_category(PurpleRoomlist *list, PurpleRoomlistRoom *category);
00239 
00242 /**************************************************************************/
00244 /**************************************************************************/
00256 PurpleRoomlistRoom *purple_roomlist_room_new(PurpleRoomlistRoomType type, const gchar *name,
00257                                          PurpleRoomlistRoom *parent);
00258 
00266 void purple_roomlist_room_add_field(PurpleRoomlist *list, PurpleRoomlistRoom *room, gconstpointer field);
00267 
00274 void purple_roomlist_room_join(PurpleRoomlist *list, PurpleRoomlistRoom *room);
00275 
00278 /**************************************************************************/
00280 /**************************************************************************/
00294 PurpleRoomlistField *purple_roomlist_field_new(PurpleRoomlistFieldType type,
00295                                            const gchar *label, const gchar *name,
00296                                            gboolean hidden);
00299 /**************************************************************************/
00301 /**************************************************************************/
00309 void purple_roomlist_set_ui_ops(PurpleRoomlistUiOps *ops);
00310 
00317 PurpleRoomlistUiOps *purple_roomlist_get_ui_ops(void);
00318 
00321 #ifdef __cplusplus
00322 }
00323 #endif
00324 
00325 #endif /* _PURPLE_ROOMLIST_H_ */