Fri, 18 Jan 2013 03:51:05 -0500
Move blist loading into purple_core_init.
The comments say we want to move this into purple_blist_init, but that
seems like it would be problematic. We need the UI ops to be set, which
moves blist init after UI init. But stuff needs blist signals to be
registered before UI init, etc., etc. It seemed like a pain to work that
all out. I made purple_blist_boot for purple_core_init to call after the
UI init happened. It could have been called _load, but I didn't want
people to accidentally continue calling it.
| 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" |
|
30374
e9df8757ff89
roomlist: "glib.h" -> <glib.h>; seems correct-er to me
Paul Aurich <darkrain42@pidgin.im>
parents:
23514
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 | * The room list ops to be filled out by the UI. | |
| 68 | */ | |
| 15884 | 69 | struct _PurpleRoomlistUiOps { |
| 70 | void (*show_with_account)(PurpleAccount *account); /**< Force the ui to pop up a dialog and get the list */ | |
| 71 | void (*create)(PurpleRoomlist *list); /**< A new list was created. */ | |
| 72 | void (*set_fields)(PurpleRoomlist *list, GList *fields); /**< Sets the columns. */ | |
| 73 | void (*add_room)(PurpleRoomlist *list, PurpleRoomlistRoom *room); /**< Add a room to the list. */ | |
| 74 | void (*in_progress)(PurpleRoomlist *list, gboolean flag); /**< Are we fetching stuff still? */ | |
| 75 | 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
|
76 | |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
77 | 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
|
78 | 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
|
79 | 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
|
80 | void (*_purple_reserved4)(void); |
| 8113 | 81 | }; |
| 82 | ||
| 83 | ||
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32604
diff
changeset
|
84 | G_BEGIN_DECLS |
| 8113 | 85 | |
| 86 | /**************************************************************************/ | |
| 87 | /** @name Room List API */ | |
| 88 | /**************************************************************************/ | |
| 89 | /*@{*/ | |
| 90 | ||
| 91 | /** | |
| 8352 | 92 | * This is used to get the room list on an account, asking the UI |
| 93 | * to pop up a dialog with the specified account already selected, | |
| 94 | * and pretend the user clicked the get list button. | |
| 95 | * While we're pretending, predend I didn't say anything about dialogs | |
| 96 | * or buttons, since this is the core. | |
| 97 | * | |
| 98 | * @param account The account to get the list on. | |
| 99 | */ | |
| 15884 | 100 | void purple_roomlist_show_with_account(PurpleAccount *account); |
| 8352 | 101 | |
| 102 | /** | |
| 8113 | 103 | * Returns a newly created room list object. |
| 104 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8584
diff
changeset
|
105 | * It has an initial reference count of 1. |
| 8113 | 106 | * |
| 107 | * @param account The account that's listing rooms. | |
| 108 | * @return The new room list handle. | |
| 109 | */ | |
| 15884 | 110 | PurpleRoomlist *purple_roomlist_new(PurpleAccount *account); |
| 8113 | 111 | |
| 112 | /** | |
| 113 | * Increases the reference count on the room list. | |
| 114 | * | |
| 115 | * @param list The object to ref. | |
| 116 | */ | |
| 15884 | 117 | void purple_roomlist_ref(PurpleRoomlist *list); |
| 8113 | 118 | |
| 119 | /** | |
| 120 | * Decreases the reference count on the room list. | |
| 121 | * | |
| 122 | * The room list will be destroyed when this reaches 0. | |
| 123 | * | |
| 124 | * @param list The room list object to unref and possibly | |
| 125 | * destroy. | |
| 126 | */ | |
| 15884 | 127 | void purple_roomlist_unref(PurpleRoomlist *list); |
| 8113 | 128 | |
| 129 | /** | |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
130 | * Retrieve the PurpleAccount that was given when the room list was |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
131 | * created. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
132 | * |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
133 | * @return The PurpleAccount tied to this room list. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
134 | */ |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
135 | PurpleAccount *purple_roomlist_get_account(PurpleRoomlist *list); |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
136 | |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
137 | /** |
| 8113 | 138 | * Set the different field types and their names for this protocol. |
| 139 | * | |
| 15884 | 140 | * This must be called before purple_roomlist_room_add(). |
| 8113 | 141 | * |
| 142 | * @param list The room list. | |
| 15884 | 143 | * @param fields A GList of PurpleRoomlistField's. UI's are encouraged |
| 8113 | 144 | * to default to displaying them in the order given. |
| 145 | */ | |
| 15884 | 146 | void purple_roomlist_set_fields(PurpleRoomlist *list, GList *fields); |
| 8113 | 147 | |
| 148 | /** | |
| 149 | * Set the "in progress" state of the room list. | |
| 150 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8584
diff
changeset
|
151 | * The UI is encouraged to somehow hint to the user |
| 8113 | 152 | * whether or not we're busy downloading a room list or not. |
| 153 | * | |
| 154 | * @param list The room list. | |
| 155 | * @param in_progress We're downloading it, or we're not. | |
| 156 | */ | |
| 15884 | 157 | void purple_roomlist_set_in_progress(PurpleRoomlist *list, gboolean in_progress); |
| 8113 | 158 | |
| 159 | /** | |
| 8199 | 160 | * Gets the "in progress" state of the room list. |
| 161 | * | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8584
diff
changeset
|
162 | * The UI is encouraged to somehow hint to the user |
| 8199 | 163 | * whether or not we're busy downloading a room list or not. |
| 164 | * | |
| 165 | * @param list The room list. | |
| 8866 | 166 | * @return True if we're downloading it, or false if we're not. |
| 8199 | 167 | */ |
| 15884 | 168 | gboolean purple_roomlist_get_in_progress(PurpleRoomlist *list); |
| 8199 | 169 | |
| 170 | /** | |
| 8113 | 171 | * Adds a room to the list of them. |
| 172 | * | |
| 173 | * @param list The room list. | |
| 174 | * @param room The room to add to the list. The GList of fields must be in the same | |
| 15884 | 175 | order as was given in purple_roomlist_set_fields(). |
| 8113 | 176 | */ |
| 15884 | 177 | void purple_roomlist_room_add(PurpleRoomlist *list, PurpleRoomlistRoom *room); |
| 8113 | 178 | |
| 179 | /** | |
| 15884 | 180 | * Returns a PurpleRoomlist structure from the prpl, and |
| 8113 | 181 | * instructs the prpl to start fetching the list. |
| 182 | * | |
| 15884 | 183 | * @param gc The PurpleConnection to have get a list. |
| 8113 | 184 | * |
| 15884 | 185 | * @return A PurpleRoomlist* or @c NULL if the protocol |
| 8113 | 186 | * doesn't support that. |
| 187 | */ | |
| 15884 | 188 | PurpleRoomlist *purple_roomlist_get_list(PurpleConnection *gc); |
| 8113 | 189 | |
| 190 | /** | |
| 191 | * Tells the prpl to stop fetching the list. | |
| 192 | * If this is possible and done, the prpl will | |
| 193 | * call set_in_progress with @c FALSE and possibly | |
| 194 | * unref the list if it took a reference. | |
| 195 | * | |
| 196 | * @param list The room list to cancel a get_list on. | |
| 197 | */ | |
| 15884 | 198 | void purple_roomlist_cancel_get_list(PurpleRoomlist *list); |
| 8113 | 199 | |
| 200 | /** | |
| 8584 | 201 | * Tells the prpl that a category was expanded. |
| 8113 | 202 | * |
| 8584 | 203 | * On some protocols, the rooms in the category |
| 8113 | 204 | * won't be fetched until this is called. |
| 205 | * | |
| 9000 | 206 | * @param list The room list. |
| 207 | * @param category The category that was expanded. The expression | |
| 15884 | 208 | * (category->type & PURPLE_ROOMLIST_ROOMTYPE_CATEGORY) |
| 9000 | 209 | * must be true. |
| 8113 | 210 | */ |
| 15884 | 211 | void purple_roomlist_expand_category(PurpleRoomlist *list, PurpleRoomlistRoom *category); |
| 8113 | 212 | |
|
22134
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
213 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
214 | * 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
|
215 | * |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
216 | * @param roomlist The roomlist, which must not be @c NULL. |
|
22134
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
217 | * @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
|
218 | */ |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
219 | GList *purple_roomlist_get_fields(PurpleRoomlist *roomlist); |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
220 | |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
221 | /** |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
222 | * Get the protocol data associated with this room list. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
223 | * |
|
32554
0d844fac6679
Fix a bunch of tiny problems generating our doxygen documentation
Mark Doliner <markdoliner@pidgin.im>
parents:
32249
diff
changeset
|
224 | * @param list The roomlist, which must not be @c NULL. |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
225 | * |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
226 | * @return The protocol data associated with this room list. This is a |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
227 | * convenience field provided to the protocol plugin--it is not |
|
32249
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32218
diff
changeset
|
228 | * used the libpurple core. |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
229 | */ |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
230 | gpointer purple_roomlist_get_proto_data(PurpleRoomlist *list); |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
231 | |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
232 | /** |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
233 | * Set the protocol data associated with this room list. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
234 | * |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
235 | * @param list The roomlist, which must not be @c NULL. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
236 | * @param proto_data A pointer to associate with this room list. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
237 | */ |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
238 | void purple_roomlist_set_proto_data(PurpleRoomlist *list, gpointer proto_data); |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
239 | |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
240 | /** |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
241 | * Get the UI data associated with this room list. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
242 | * |
|
32554
0d844fac6679
Fix a bunch of tiny problems generating our doxygen documentation
Mark Doliner <markdoliner@pidgin.im>
parents:
32249
diff
changeset
|
243 | * @param list The roomlist, which must not be @c NULL. |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
244 | * |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
245 | * @return The UI data associated with this room list. This is a |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
246 | * convenience field provided to the UIs--it is not |
|
32249
b636d2273c64
Added accessor functions purple_xfer_get_ui_data() and purple_xfer_set_ui_data().
Andrew Victor <andrew.victor@mxit.com>
parents:
32218
diff
changeset
|
247 | * used by the libpurple core. |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
248 | */ |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
249 | gpointer purple_roomlist_get_ui_data(PurpleRoomlist *list); |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
250 | |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
251 | /** |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
252 | * Set the UI data associated with this room list. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
253 | * |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
254 | * @param list The roomlist, which must not be @c NULL. |
|
32554
0d844fac6679
Fix a bunch of tiny problems generating our doxygen documentation
Mark Doliner <markdoliner@pidgin.im>
parents:
32249
diff
changeset
|
255 | * @param ui_data A pointer to associate with this room list. |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
256 | */ |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
257 | void purple_roomlist_set_ui_data(PurpleRoomlist *list, gpointer ui_data); |
|
22134
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
258 | |
| 8113 | 259 | /*@}*/ |
| 260 | ||
| 261 | /**************************************************************************/ | |
| 262 | /** @name Room API */ | |
| 263 | /**************************************************************************/ | |
| 264 | /*@{*/ | |
| 265 | ||
| 266 | /** | |
| 267 | * Creates a new room, to be added to the list. | |
| 268 | * | |
| 269 | * @param type The type of room. | |
| 270 | * @param name The name of the room. | |
| 271 | * @param parent The room's parent, if any. | |
| 272 | * | |
| 273 | * @return A new room. | |
| 274 | */ | |
| 15884 | 275 | PurpleRoomlistRoom *purple_roomlist_room_new(PurpleRoomlistRoomType type, const gchar *name, |
| 276 | PurpleRoomlistRoom *parent); | |
| 8113 | 277 | |
| 278 | /** | |
| 279 | * Adds a field to a room. | |
| 280 | * | |
| 281 | * @param list The room list the room belongs to. | |
| 282 | * @param room The room. | |
| 283 | * @param field The field to append. Strings get g_strdup'd internally. | |
| 284 | */ | |
| 15884 | 285 | void purple_roomlist_room_add_field(PurpleRoomlist *list, PurpleRoomlistRoom *room, gconstpointer field); |
| 8113 | 286 | |
| 8199 | 287 | /** |
| 15884 | 288 | * Join a room, given a PurpleRoomlistRoom and it's associated PurpleRoomlist. |
| 8199 | 289 | * |
| 290 | * @param list The room list the room belongs to. | |
| 291 | * @param room The room to join. | |
| 292 | */ | |
| 15884 | 293 | void purple_roomlist_room_join(PurpleRoomlist *list, PurpleRoomlistRoom *room); |
| 8199 | 294 | |
|
22134
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
295 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
296 | * 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
|
297 | * @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
|
298 | * @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
|
299 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
300 | 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
|
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 name 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 name of the room. |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
306 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
307 | 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
|
308 | |
|
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 | * 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
|
311 | * @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
|
312 | * @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
|
313 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
314 | 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
|
315 | |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
316 | /** |
|
32218
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
317 | * Get the value of the expanded_once flag. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
318 | * |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
319 | * @param room The room, which must not be @c NULL. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
320 | * |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
321 | * @return The value of the expanded_once flag. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
322 | */ |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
323 | gboolean purple_roomlist_room_get_expanded_once(PurpleRoomlistRoom *room); |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
324 | |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
325 | /** |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
326 | * Set the expanded_once flag. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
327 | * |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
328 | * @param room The room, which must not be @c NULL. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
329 | * @param expanded_once The new value of the expanded_once flag. |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
330 | */ |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
331 | void purple_roomlist_room_set_expanded_once(PurpleRoomlistRoom *room, gboolean expanded_once); |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
332 | |
|
f27b05250351
Some struct hiding. What a pain.
Mark Doliner <markdoliner@pidgin.im>
parents:
30374
diff
changeset
|
333 | /** |
|
22134
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
334 | * 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
|
335 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
336 | * @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
|
337 | * @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
|
338 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
339 | 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
|
340 | |
| 8113 | 341 | /*@}*/ |
| 342 | ||
| 343 | /**************************************************************************/ | |
| 344 | /** @name Room Field API */ | |
| 345 | /**************************************************************************/ | |
| 346 | /*@{*/ | |
| 347 | ||
| 348 | /** | |
| 349 | * Creates a new field. | |
| 350 | * | |
| 9000 | 351 | * @param type The type of the field. |
| 352 | * @param label The i18n'ed, user displayable name. | |
| 353 | * @param name The internal name of the field. | |
| 354 | * @param hidden Hide the field. | |
| 8113 | 355 | * |
| 15884 | 356 | * @return A new PurpleRoomlistField, ready to be added to a GList and passed to |
| 357 | * purple_roomlist_set_fields(). | |
| 8113 | 358 | */ |
| 15884 | 359 | PurpleRoomlistField *purple_roomlist_field_new(PurpleRoomlistFieldType type, |
| 8113 | 360 | const gchar *label, const gchar *name, |
| 361 | gboolean hidden); | |
|
22134
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
362 | |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
363 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
364 | * 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
|
365 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
366 | * @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
|
367 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
368 | * @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
|
369 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
370 | 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
|
371 | |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
372 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
373 | * 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
|
374 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
375 | * @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
|
376 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
377 | * @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
|
378 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
379 | 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
|
380 | |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
381 | /** |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
382 | * 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
|
383 | * @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
|
384 | * |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
385 | * @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
|
386 | */ |
|
692ceed9d307
A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
387 | 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
|
388 | |
| 8113 | 389 | /*@}*/ |
| 390 | ||
| 391 | /**************************************************************************/ | |
| 392 | /** @name UI Registration Functions */ | |
| 393 | /**************************************************************************/ | |
| 394 | /*@{*/ | |
| 395 | ||
| 396 | /** | |
| 15884 | 397 | * Sets the UI operations structure to be used in all purple room lists. |
| 8113 | 398 | * |
| 399 | * @param ops The UI operations structure. | |
| 400 | */ | |
| 15884 | 401 | void purple_roomlist_set_ui_ops(PurpleRoomlistUiOps *ops); |
| 8113 | 402 | |
| 403 | /** | |
| 15884 | 404 | * Returns the purple window UI operations structure to be used in |
| 8113 | 405 | * new windows. |
| 406 | * | |
| 15884 | 407 | * @return A filled-out PurpleRoomlistUiOps structure. |
| 8113 | 408 | */ |
| 15884 | 409 | PurpleRoomlistUiOps *purple_roomlist_get_ui_ops(void); |
| 8113 | 410 | |
| 411 | /*@}*/ | |
| 412 | ||
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32604
diff
changeset
|
413 | G_END_DECLS |
| 8113 | 414 | |
| 15884 | 415 | #endif /* _PURPLE_ROOMLIST_H_ */ |