pidgin  2.14.10
roomlist.h
Go to the documentation of this file.
1 
6 /* purple
7  *
8  * Purple is the legal property of its developers, whose names are too numerous
9  * to list here. Please refer to the COPYRIGHT file distributed with this
10  * source distribution.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25  */
26 
27 #ifndef _PURPLE_ROOMLIST_H_
28 #define _PURPLE_ROOMLIST_H_
29 
30 typedef struct _PurpleRoomlist PurpleRoomlist;
35 
41 typedef enum
42 {
47 
51 typedef enum
52 {
53  PURPLE_ROOMLIST_FIELD_BOOL,
54  PURPLE_ROOMLIST_FIELD_INT,
58 
59 #include "account.h"
60 #include <glib.h>
61 
62 /**************************************************************************/
64 /**************************************************************************/
65 
71  GList *fields;
72  GList *rooms;
73  gboolean in_progress;
74  gpointer ui_data;
75  gpointer proto_data;
76  guint ref;
77 };
78 
84  gchar *name;
85  GList *fields;
87  gboolean expanded_once;
88 };
89 
95  gchar *label;
96  gchar *name;
97  gboolean hidden;
98 };
99 
104  void (*show_with_account)(PurpleAccount *account);
105  void (*create)(PurpleRoomlist *list);
106  void (*set_fields)(PurpleRoomlist *list, GList *fields);
108  void (*in_progress)(PurpleRoomlist *list, gboolean flag);
109  void (*destroy)(PurpleRoomlist *list);
111  void (*_purple_reserved1)(void);
112  void (*_purple_reserved2)(void);
113  void (*_purple_reserved3)(void);
114  void (*_purple_reserved4)(void);
115 };
116 
117 
118 #ifdef __cplusplus
119 extern "C" {
120 #endif
121 
122 /**************************************************************************/
124 /**************************************************************************/
137 
147 
154 
164 
174 void purple_roomlist_set_fields(PurpleRoomlist *list, GList *fields);
175 
185 void purple_roomlist_set_in_progress(PurpleRoomlist *list, gboolean in_progress);
186 
197 
206 
217 
227 
240 
249 
252 /**************************************************************************/
254 /**************************************************************************/
267  PurpleRoomlistRoom *parent);
268 
276 void purple_roomlist_room_add_field(PurpleRoomlist *list, PurpleRoomlistRoom *room, gconstpointer field);
277 
285 
293 
301 
309 
318 
321 /**************************************************************************/
323 /**************************************************************************/
338  const gchar *label, const gchar *name,
339  gboolean hidden);
340 
350 
360 
369 
372 /**************************************************************************/
374 /**************************************************************************/
383 
391 
394 #ifdef __cplusplus
395 }
396 #endif
397 
398 #endif /* _PURPLE_ROOMLIST_H_ */
Account API.
void purple_roomlist_room_add_field(PurpleRoomlist *list, PurpleRoomlistRoom *room, gconstpointer field)
Adds a field to a room.
void purple_roomlist_set_in_progress(PurpleRoomlist *list, gboolean in_progress)
Set the "in progress" state of the room list.
void purple_roomlist_cancel_get_list(PurpleRoomlist *list)
Tells the prpl to stop fetching the list.
PurpleRoomlistRoom * purple_roomlist_room_new(PurpleRoomlistRoomType type, const gchar *name, PurpleRoomlistRoom *parent)
Creates a new room, to be added to the list.
gboolean purple_roomlist_get_in_progress(PurpleRoomlist *list)
Gets the "in progress" state of the room list.
PurpleRoomlist * purple_roomlist_new(PurpleAccount *account)
Returns a newly created room list object.
PurpleRoomlistRoomType
The types of rooms.
Definition: roomlist.h:42
@ PURPLE_ROOMLIST_ROOMTYPE_CATEGORY
It's a category, but not a room you can join.
Definition: roomlist.h:43
@ PURPLE_ROOMLIST_ROOMTYPE_ROOM
It's a room, like the kind you can join.
Definition: roomlist.h:44
void purple_roomlist_set_fields(PurpleRoomlist *list, GList *fields)
Set the different field types and their names for this protocol.
GList * purple_roomlist_get_fields(PurpleRoomlist *roomlist)
Get the list of fields for a roomlist.
void purple_roomlist_room_join(PurpleRoomlist *list, PurpleRoomlistRoom *room)
Join a room, given a PurpleRoomlistRoom and it's associated PurpleRoomlist.
PurpleRoomlist * purple_roomlist_get_list(PurpleConnection *gc)
Returns a PurpleRoomlist structure from the prpl, and instructs the prpl to start fetching the list.
PurpleRoomlistField * purple_roomlist_field_new(PurpleRoomlistFieldType type, const gchar *label, const gchar *name, gboolean hidden)
Creates a new field.
const char * purple_roomlist_field_get_label(PurpleRoomlistField *field)
Get the label of a field.
PurpleRoomlistUiOps * purple_roomlist_get_ui_ops(void)
Returns the purple window UI operations structure to be used in new windows.
gboolean purple_roomlist_field_get_hidden(PurpleRoomlistField *field)
Check whether a roomlist-field is hidden.
PurpleRoomlistFieldType purple_roomlist_field_get_type(PurpleRoomlistField *field)
Get the type of a field.
PurpleRoomlistRoom * purple_roomlist_room_get_parent(PurpleRoomlistRoom *room)
Get the parent of a room.
void purple_roomlist_room_add(PurpleRoomlist *list, PurpleRoomlistRoom *room)
Adds a room to the list of them.
PurpleRoomlistFieldType
The types of fields.
Definition: roomlist.h:52
@ PURPLE_ROOMLIST_FIELD_STRING
We do a g_strdup on the passed value if it's this type.
Definition: roomlist.h:55
void purple_roomlist_expand_category(PurpleRoomlist *list, PurpleRoomlistRoom *category)
Tells the prpl that a category was expanded.
const char * purple_roomlist_room_get_name(PurpleRoomlistRoom *room)
Get the name of a room.
GList * purple_roomlist_room_get_fields(PurpleRoomlistRoom *room)
Get the list of fields for a room.
void purple_roomlist_unref(PurpleRoomlist *list)
Decreases the reference count on the room list.
void purple_roomlist_ref(PurpleRoomlist *list)
Increases the reference count on the room list.
void purple_roomlist_set_ui_ops(PurpleRoomlistUiOps *ops)
Sets the UI operations structure to be used in all purple room lists.
PurpleRoomlistRoomType purple_roomlist_room_get_type(PurpleRoomlistRoom *room)
Get the type of a room.
void purple_roomlist_show_with_account(PurpleAccount *account)
This is used to get the room list on an account, asking the UI to pop up a dialog with the specified ...
Structure representing an account.
Definition: account.h:170
A field a room might have.
Definition: roomlist.h:93
gchar * label
The i18n user displayed name of the field.
Definition: roomlist.h:95
PurpleRoomlistFieldType type
The type of field.
Definition: roomlist.h:94
gboolean hidden
Hidden?
Definition: roomlist.h:97
gchar * name
The internal name of the field.
Definition: roomlist.h:96
Represents a room.
Definition: roomlist.h:82
PurpleRoomlistRoomType type
The type of room.
Definition: roomlist.h:83
gchar * name
The name of the room.
Definition: roomlist.h:84
PurpleRoomlistRoom * parent
The parent room, or NULL.
Definition: roomlist.h:86
gboolean expanded_once
A flag the UI uses to avoid multiple expand prpl cbs.
Definition: roomlist.h:87
GList * fields
Other fields.
Definition: roomlist.h:85
The room list ops to be filled out by the UI.
Definition: roomlist.h:103
void(* create)(PurpleRoomlist *list)
A new list was created.
Definition: roomlist.h:105
void(* show_with_account)(PurpleAccount *account)
Force the ui to pop up a dialog and get the list.
Definition: roomlist.h:104
void(* destroy)(PurpleRoomlist *list)
We're destroying list.
Definition: roomlist.h:109
void(* add_room)(PurpleRoomlist *list, PurpleRoomlistRoom *room)
Add a room to the list.
Definition: roomlist.h:107
void(* set_fields)(PurpleRoomlist *list, GList *fields)
Sets the columns.
Definition: roomlist.h:106
void(* in_progress)(PurpleRoomlist *list, gboolean flag)
Are we fetching stuff still?
Definition: roomlist.h:108
Data Structures
Definition: roomlist.h:69
gboolean in_progress
The listing is in progress.
Definition: roomlist.h:73
gpointer ui_data
UI private data.
Definition: roomlist.h:74
GList * rooms
The list of rooms.
Definition: roomlist.h:72
GList * fields
The fields.
Definition: roomlist.h:71
PurpleAccount * account
The account this list belongs to.
Definition: roomlist.h:70
guint ref
Prpl private data.
Definition: roomlist.h:76