Fri, 14 Nov 2008 06:45:16 +0000
propagate from branch 'im.pidgin.pidgin' (head cc1cc6c659d3878f285641153244b04df2f15eb7)
to branch 'im.pidgin.pidgin.next.minor' (head c195415b5fdfa94009870ddc8e23cf4a653ae351)
| 8113 | 1 | /** |
| 2 | * @file roomlist.h Room List API | |
| 3 | * @ingroup core | |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* purple |
| 8113 | 7 | * |
| 15884 | 8 | * Purple is the legal property of its developers, whose names are too numerous |
|
8146
4961c9c5fd61
[gaim-migrate @ 8854]
John Silvestri <john.silvestri@gmail.com>
parents:
8113
diff
changeset
|
9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
4961c9c5fd61
[gaim-migrate @ 8854]
John Silvestri <john.silvestri@gmail.com>
parents:
8113
diff
changeset
|
10 | * source distribution. |
| 8113 | 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 | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16743
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 8113 | 25 | */ |
| 26 | ||
| 15884 | 27 | #ifndef _PURPLE_ROOMLIST_H_ |
| 28 | #define _PURPLE_ROOMLIST_H_ | |
| 8113 | 29 | |
| 15884 | 30 | typedef struct _PurpleRoomlist PurpleRoomlist; |
| 31 | typedef struct _PurpleRoomlistRoom PurpleRoomlistRoom; | |
| 32 | typedef struct _PurpleRoomlistField PurpleRoomlistField; | |
|
23514
f5c4c1cb7b6f
Sprinkle @copydoc around to squash "ref could not be resolved" Doxygen warnings,
Will Thompson <resiak@pidgin.im>
parents:
22134
diff
changeset
|
33 | /** @copydoc _PurpleRoomlistUiOps */ |
| 15884 | 34 | typedef struct _PurpleRoomlistUiOps PurpleRoomlistUiOps; |
|
9030
7b574a641391
[gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents:
9000
diff
changeset
|
35 | |
|
9999
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
36 | /** |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
37 | * The types of rooms. |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
38 | * |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
39 | * These are ORable flags. |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
40 | */ |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
41 | typedef enum |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
42 | { |
| 15884 | 43 | PURPLE_ROOMLIST_ROOMTYPE_CATEGORY = 0x01, /**< It's a category, but not a room you can join. */ |
| 44 | PURPLE_ROOMLIST_ROOMTYPE_ROOM = 0x02 /**< It's a room, like the kind you can join. */ | |
|
9999
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
45 | |
| 15884 | 46 | } PurpleRoomlistRoomType; |
|
9999
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
47 | |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
48 | /** |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
49 | * The types of fields. |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
50 | */ |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
51 | typedef enum |
|
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
52 | { |
| 15884 | 53 | PURPLE_ROOMLIST_FIELD_BOOL, |
| 54 | PURPLE_ROOMLIST_FIELD_INT, | |
| 55 | PURPLE_ROOMLIST_FIELD_STRING /**< We do a g_strdup on the passed value if it's this type. */ | |
|
9999
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
56 | |
| 15884 | 57 | } PurpleRoomlistFieldType; |
|
9999
86e89e1dee10
[gaim-migrate @ 10913]
Mark Doliner <markdoliner@pidgin.im>
parents:
9030
diff
changeset
|
58 | |
|
9030
7b574a641391
[gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents:
9000
diff
changeset
|
59 | #include "account.h" |
|
10023
6b0014040323
[gaim-migrate @ 10955]
Mark Doliner <markdoliner@pidgin.im>
parents:
9999
diff
changeset
|
60 | #include "glib.h" |
|
9030
7b574a641391
[gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents:
9000
diff
changeset
|
61 | |
| 8113 | 62 | /**************************************************************************/ |
| 63 | /** Data Structures */ | |
| 64 | /**************************************************************************/ | |
| 65 | ||
| 66 | /** | |
| 67 | * Represents a list of rooms for a given connection on a given protocol. | |
| 68 | */ | |
| 15884 | 69 | struct _PurpleRoomlist { |
| 70 | PurpleAccount *account; /**< The account this list belongs to. */ | |
| 8113 | 71 | GList *fields; /**< The fields. */ |
| 72 | GList *rooms; /**< The list of rooms. */ | |
| 8199 | 73 | gboolean in_progress; /**< The listing is in progress. */ |
| 8113 | 74 | gpointer ui_data; /**< UI private data. */ |
| 75 | gpointer proto_data; /** Prpl private data. */ | |
| 76 | guint ref; /**< The reference count. */ | |
| 77 | }; | |
| 78 | ||
| 79 | /** | |
| 80 | * Represents a room. | |
| 81 | */ | |
| 15884 | 82 | struct _PurpleRoomlistRoom { |
| 83 | PurpleRoomlistRoomType type; /**< The type of room. */ | |
| 8113 | 84 | gchar *name; /**< The name of the room. */ |
| 85 | GList *fields; /**< Other fields. */ | |
| 15884 | 86 | PurpleRoomlistRoom *parent; /**< The parent room, or NULL. */ |
| 8113 | 87 | gboolean expanded_once; /**< A flag the UI uses to avoid multiple expand prpl cbs. */ |
| 88 | }; | |
| 89 | ||
| 90 | /** | |
| 91 | * A field a room might have. | |
| 92 | */ | |
| 15884 | 93 | struct _PurpleRoomlistField { |
| 94 | PurpleRoomlistFieldType type; /**< The type of field. */ | |
| 8113 | 95 | gchar *label; /**< The i18n user displayed name of the field. */ |
| 96 | gchar *name; /**< The internal name of the field. */ | |
| 97 | gboolean hidden; /**< Hidden? */ | |
| 98 | }; | |
| 99 | ||
| 100 | /** | |
| 101 | * The room list ops to be filled out by the UI. | |
| 102 | */ | |
| 15884 | 103 | struct _PurpleRoomlistUiOps { |
| 104 | void (*show_with_account)(PurpleAccount *account); /**< Force the ui to pop up a dialog and get the list */ | |
| 105 | void (*create)(PurpleRoomlist *list); /**< A new list was created. */ | |
| 106 | void (*set_fields)(PurpleRoomlist *list, GList *fields); /**< Sets the columns. */ | |
| 107 | void (*add_room)(PurpleRoomlist *list, PurpleRoomlistRoom *room); /**< Add a room to the list. */ | |
| 108 | void (*in_progress)(PurpleRoomlist *list, gboolean flag); /**< Are we fetching stuff still? */ | |
| 109 | void (*destroy)(PurpleRoomlist *list); /**< We're destroying list. */ | |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
110 | |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
111 | void (*_purple_reserved1)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
112 | void (*_purple_reserved2)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
113 | void (*_purple_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
114 | void (*_purple_reserved4)(void); |
| 8113 | 115 | }; |
| 116 | ||
| 117 | ||
| 118 | #ifdef __cplusplus | |
| 119 | extern "C" { | |
| 120 | #endif | |
| 121 | ||
| 122 | /**************************************************************************/ | |
| 123 | /** @name Room List API */ | |
| 124 | /**************************************************************************/ | |
| 125 | /*@{*/ | |
| 126 | ||
| 127 | /** | |
| 8352 | 128 | * This is used to get the room list on an account, asking the UI |
| 129 | * to pop up a dialog with the specified account already selected, | |
| 130 | * and pretend the user clicked the get list button. | |
| 131 | * While we're pretending, predend I didn't say anything about dialogs | |
| 132 | * or buttons, since this is the core. | |
| 133 | * | |
| 134 | * @param account The account to get the list on. | |
| 135 | */ | |
| 15884 | 136 | void purple_roomlist_show_with_account(PurpleAccount *account); |
| 8352 | 137 | |
| 138 | /** | |
| 8113 | 139 | * Returns a newly created room list object. |
| 140 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8584
diff
changeset
|
141 | * It has an initial reference count of 1. |
| 8113 | 142 | * |
| 143 | * @param account The account that's listing rooms. | |
| 144 | * @return The new room list handle. | |
| 145 | */ | |
| 15884 | 146 | PurpleRoomlist *purple_roomlist_new(PurpleAccount *account); |
| 8113 | 147 | |
| 148 | /** | |
| 149 | * Increases the reference count on the room list. | |
| 150 | * | |
| 151 | * @param list The object to ref. | |
| 152 | */ | |
| 15884 | 153 | void purple_roomlist_ref(PurpleRoomlist *list); |
| 8113 | 154 | |
| 155 | /** | |
| 156 | * Decreases the reference count on the room list. | |
| 157 | * | |
| 158 | * The room list will be destroyed when this reaches 0. | |
| 159 | * | |
| 160 | * @param list The room list object to unref and possibly | |
| 161 | * destroy. | |
| 162 | */ | |
| 15884 | 163 | void purple_roomlist_unref(PurpleRoomlist *list); |
| 8113 | 164 | |
| 165 | /** | |
| 166 | * Set the different field types and their names for this protocol. | |
| 167 | * | |
| 15884 | 168 | * This must be called before purple_roomlist_room_add(). |
| 8113 | 169 | * |
| 170 | * @param list The room list. | |
| 15884 | 171 | * @param fields A GList of PurpleRoomlistField's. UI's are encouraged |
| 8113 | 172 | * to default to displaying them in the order given. |
| 173 | */ | |
| 15884 | 174 | void purple_roomlist_set_fields(PurpleRoomlist *list, GList *fields); |
| 8113 | 175 | |
| 176 | /** | |
| 177 | * Set the "in progress" state of the room list. | |
| 178 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8584
diff
changeset
|
179 | * The UI is encouraged to somehow hint to the user |
| 8113 | 180 | * whether or not we're busy downloading a room list or not. |
| 181 | * | |
| 182 | * @param list The room list. | |
| 183 | * @param in_progress We're downloading it, or we're not. | |
| 184 | */ | |
| 15884 | 185 | void purple_roomlist_set_in_progress(PurpleRoomlist *list, gboolean in_progress); |
| 8113 | 186 | |
| 187 | /** | |
| 8199 | 188 | * Gets the "in progress" state of the room list. |
| 189 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8584
diff
changeset
|
190 | * The UI is encouraged to somehow hint to the user |
| 8199 | 191 | * whether or not we're busy downloading a room list or not. |
| 192 | * | |
| 193 | * @param list The room list. | |
| 8866 | 194 | * @return True if we're downloading it, or false if we're not. |
| 8199 | 195 | */ |
| 15884 | 196 | gboolean purple_roomlist_get_in_progress(PurpleRoomlist *list); |
| 8199 | 197 | |
| 198 | /** | |
| 8113 | 199 | * Adds a room to the list of them. |
| 200 | * | |
| 201 | * @param list The room list. | |
| 202 | * @param room The room to add to the list. The GList of fields must be in the same | |
| 15884 | 203 | order as was given in purple_roomlist_set_fields(). |
| 8113 | 204 | */ |
| 15884 | 205 | void purple_roomlist_room_add(PurpleRoomlist *list, PurpleRoomlistRoom *room); |
| 8113 | 206 | |
| 207 | /** | |
| 15884 | 208 | * Returns a PurpleRoomlist structure from the prpl, and |
| 8113 | 209 | * instructs the prpl to start fetching the list. |
| 210 | * | |
| 15884 | 211 | * @param gc The PurpleConnection to have get a list. |
| 8113 | 212 | * |
| 15884 | 213 | * @return A PurpleRoomlist* or @c NULL if the protocol |
| 8113 | 214 | * doesn't support that. |
| 215 | */ | |
| 15884 | 216 | PurpleRoomlist *purple_roomlist_get_list(PurpleConnection *gc); |
| 8113 | 217 | |
| 218 | /** | |
| 219 | * Tells the prpl to stop fetching the list. | |
| 220 | * If this is possible and done, the prpl will | |
| 221 | * call set_in_progress with @c FALSE and possibly | |
| 222 | * unref the list if it took a reference. | |
| 223 | * | |
| 224 | * @param list The room list to cancel a get_list on. | |
| 225 | */ | |
| 15884 | 226 | void purple_roomlist_cancel_get_list(PurpleRoomlist *list); |
| 8113 | 227 | |
| 228 | /** | |
| 8584 | 229 | * Tells the prpl that a category was expanded. |
| 8113 | 230 | * |
| 8584 | 231 | * On some protocols, the rooms in the category |
| 8113 | 232 | * won't be fetched until this is called. |
| 233 | * | |
| 9000 | 234 | * @param list The room list. |
| 235 | * @param category The category that was expanded. The expression | |
| 15884 | 236 | * (category->type & PURPLE_ROOMLIST_ROOMTYPE_CATEGORY) |
| 9000 | 237 | * must be true. |
| 8113 | 238 | */ |
| 15884 | 239 | void purple_roomlist_expand_category(PurpleRoomlist *list, PurpleRoomlistRoom *category); |
| 8113 | 240 | |
|
22134
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
241 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
242 | * Get the list of fields for a roomlist. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
243 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
244 | * @param roomlist The roomlist, which must not be @c NULL. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
245 | * @constreturn A list of fields |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
246 | * @since 2.4.0 |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
247 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
248 | GList * purple_roomlist_get_fields(PurpleRoomlist *roomlist); |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
249 | |
| 8113 | 250 | /*@}*/ |
| 251 | ||
| 252 | /**************************************************************************/ | |
| 253 | /** @name Room API */ | |
| 254 | /**************************************************************************/ | |
| 255 | /*@{*/ | |
| 256 | ||
| 257 | /** | |
| 258 | * Creates a new room, to be added to the list. | |
| 259 | * | |
| 260 | * @param type The type of room. | |
| 261 | * @param name The name of the room. | |
| 262 | * @param parent The room's parent, if any. | |
| 263 | * | |
| 264 | * @return A new room. | |
| 265 | */ | |
| 15884 | 266 | PurpleRoomlistRoom *purple_roomlist_room_new(PurpleRoomlistRoomType type, const gchar *name, |
| 267 | PurpleRoomlistRoom *parent); | |
| 8113 | 268 | |
| 269 | /** | |
| 270 | * Adds a field to a room. | |
| 271 | * | |
| 272 | * @param list The room list the room belongs to. | |
| 273 | * @param room The room. | |
| 274 | * @param field The field to append. Strings get g_strdup'd internally. | |
| 275 | */ | |
| 15884 | 276 | void purple_roomlist_room_add_field(PurpleRoomlist *list, PurpleRoomlistRoom *room, gconstpointer field); |
| 8113 | 277 | |
| 8199 | 278 | /** |
| 15884 | 279 | * Join a room, given a PurpleRoomlistRoom and it's associated PurpleRoomlist. |
| 8199 | 280 | * |
| 281 | * @param list The room list the room belongs to. | |
| 282 | * @param room The room to join. | |
| 283 | */ | |
| 15884 | 284 | void purple_roomlist_room_join(PurpleRoomlist *list, PurpleRoomlistRoom *room); |
| 8199 | 285 | |
|
22134
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
286 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
287 | * Get the type of a room. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
288 | * @param room The room, which must not be @c NULL. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
289 | * @return The type of the room. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
290 | * @since 2.4.0 |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
291 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
292 | PurpleRoomlistRoomType purple_roomlist_room_get_type(PurpleRoomlistRoom *room); |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
293 | |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
294 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
295 | * Get the name of a room. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
296 | * @param room The room, which must not be @c NULL. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
297 | * @return The name of the room. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
298 | * @since 2.4.0 |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
299 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
300 | const char * purple_roomlist_room_get_name(PurpleRoomlistRoom *room); |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
301 | |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
302 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
303 | * Get the parent of a room. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
304 | * @param room The room, which must not be @c NULL. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
305 | * @return The parent of the room, which can be @c NULL. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
306 | * @since 2.4.0 |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
307 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
308 | PurpleRoomlistRoom * purple_roomlist_room_get_parent(PurpleRoomlistRoom *room); |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
309 | |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
310 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
311 | * Get the list of fields for a room. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
312 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
313 | * @param room The room, which must not be @c NULL. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
314 | * @constreturn A list of fields |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
315 | * @since 2.4.0 |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
316 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
317 | GList * purple_roomlist_room_get_fields(PurpleRoomlistRoom *room); |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
318 | |
| 8113 | 319 | /*@}*/ |
| 320 | ||
| 321 | /**************************************************************************/ | |
| 322 | /** @name Room Field API */ | |
| 323 | /**************************************************************************/ | |
| 324 | /*@{*/ | |
| 325 | ||
| 326 | /** | |
| 327 | * Creates a new field. | |
| 328 | * | |
| 9000 | 329 | * @param type The type of the field. |
| 330 | * @param label The i18n'ed, user displayable name. | |
| 331 | * @param name The internal name of the field. | |
| 332 | * @param hidden Hide the field. | |
| 8113 | 333 | * |
| 15884 | 334 | * @return A new PurpleRoomlistField, ready to be added to a GList and passed to |
| 335 | * purple_roomlist_set_fields(). | |
| 8113 | 336 | */ |
| 15884 | 337 | PurpleRoomlistField *purple_roomlist_field_new(PurpleRoomlistFieldType type, |
| 8113 | 338 | const gchar *label, const gchar *name, |
| 339 | gboolean hidden); | |
|
22134
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
340 | |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
341 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
342 | * Get the type of a field. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
343 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
344 | * @param field A PurpleRoomlistField, which must not be @c NULL. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
345 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
346 | * @return The type of the field. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
347 | * @since 2.4.0 |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
348 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
349 | PurpleRoomlistFieldType purple_roomlist_field_get_type(PurpleRoomlistField *field); |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
350 | |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
351 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
352 | * Get the label of a field. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
353 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
354 | * @param field A PurpleRoomlistField, which must not be @c NULL. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
355 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
356 | * @return The label of the field. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
357 | * @since 2.4.0 |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
358 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
359 | const char * purple_roomlist_field_get_label(PurpleRoomlistField *field); |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
360 | |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
361 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
362 | * Check whether a roomlist-field is hidden. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
363 | * @param field A PurpleRoomlistField, which must not be @c NULL. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
364 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
365 | * @return @c TRUE if the field is hidden, @c FALSE otherwise. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
366 | * @since 2.4.0 |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
367 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
368 | gboolean purple_roomlist_field_get_hidden(PurpleRoomlistField *field); |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
369 | |
| 8113 | 370 | /*@}*/ |
| 371 | ||
| 372 | /**************************************************************************/ | |
| 373 | /** @name UI Registration Functions */ | |
| 374 | /**************************************************************************/ | |
| 375 | /*@{*/ | |
| 376 | ||
| 377 | /** | |
| 15884 | 378 | * Sets the UI operations structure to be used in all purple room lists. |
| 8113 | 379 | * |
| 380 | * @param ops The UI operations structure. | |
| 381 | */ | |
| 15884 | 382 | void purple_roomlist_set_ui_ops(PurpleRoomlistUiOps *ops); |
| 8113 | 383 | |
| 384 | /** | |
| 15884 | 385 | * Returns the purple window UI operations structure to be used in |
| 8113 | 386 | * new windows. |
| 387 | * | |
| 15884 | 388 | * @return A filled-out PurpleRoomlistUiOps structure. |
| 8113 | 389 | */ |
| 15884 | 390 | PurpleRoomlistUiOps *purple_roomlist_get_ui_ops(void); |
| 8113 | 391 | |
| 392 | /*@}*/ | |
| 393 | ||
| 394 | #ifdef __cplusplus | |
| 395 | } | |
| 396 | #endif | |
| 397 | ||
| 15884 | 398 | #endif /* _PURPLE_ROOMLIST_H_ */ |