Mercurial > pidgin
comparison libpurple/disco.h @ 26604:ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Walking the entire tree automatically = bad.
This doesn't really work yet. The UI needs to be updated to support the little
expandy things like on the buddy list. It doesn't crash, though, and retrieves
the first level.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Tue, 14 Apr 2009 06:54:44 +0000 |
parents | 1de01f9594c8 |
children |
comparison
equal
deleted
inserted
replaced
26603:6b3a23ecbb42 | 26604:ff33b65b2448 |
---|---|
50 * destroyed imminently). | 50 * destroyed imminently). |
51 * | 51 * |
52 * @param list The disco list. | 52 * @param list The disco list. |
53 */ | 53 */ |
54 typedef void (*PurpleDiscoCloseFunc)(PurpleDiscoList *list); | 54 typedef void (*PurpleDiscoCloseFunc)(PurpleDiscoList *list); |
55 typedef void (*PurpleDiscoServiceCloseFunc)(PurpleDiscoService *service); | |
56 | |
57 typedef void (*PurpleDiscoServiceExpandFunc)(PurpleDiscoList *list, | |
58 PurpleDiscoService *service); | |
55 | 59 |
56 /** | 60 /** |
57 * A prpl callback called to initiate registration with the specificed | 61 * A prpl callback called to initiate registration with the specificed |
58 * service. | 62 * service. |
59 * | 63 * |
170 * Create new service object | 174 * Create new service object |
171 */ | 175 */ |
172 PurpleDiscoService * | 176 PurpleDiscoService * |
173 purple_disco_list_service_new(PurpleDiscoServiceType type, const gchar *name, | 177 purple_disco_list_service_new(PurpleDiscoServiceType type, const gchar *name, |
174 const gchar *description, | 178 const gchar *description, |
175 PurpleDiscoServiceFlags flags); | 179 PurpleDiscoServiceFlags flags, |
180 gpointer proto_data); | |
176 | 181 |
177 /** | 182 /** |
178 * Add service to list | 183 * Add service to list |
179 */ | 184 */ |
180 void purple_disco_list_service_add(PurpleDiscoList *list, PurpleDiscoService *service, PurpleDiscoService *parent); | 185 void purple_disco_list_service_add(PurpleDiscoList *list, PurpleDiscoService *service, PurpleDiscoService *parent); |
186 | |
187 /** | |
188 * Expand a (browsable) service. The UI should call this in order to | |
189 * iteratively browse the children of this service. The service must | |
190 * have the PURPLE_DISCO_BROWSE flag set. | |
191 * | |
192 * You probably don't want to call this if the service already has children. | |
193 * | |
194 * @param service The browsable disco service. | |
195 * | |
196 * @since TODO | |
197 */ | |
198 void purple_disco_service_expand(PurpleDiscoService *service); | |
181 | 199 |
182 /** | 200 /** |
183 * Register service | 201 * Register service |
184 * @param service The service that will be registered | 202 * @param service The service that will be registered |
185 */ | 203 */ |
202 * @return The description. | 220 * @return The description. |
203 * | 221 * |
204 * @since TODO | 222 * @since TODO |
205 */ | 223 */ |
206 const gchar* purple_disco_service_get_description(PurpleDiscoService *service); | 224 const gchar* purple_disco_service_get_description(PurpleDiscoService *service); |
225 | |
226 /** | |
227 * Returns the service's protocol-specific data. | |
228 * | |
229 * This should only be called from the associated prpl. | |
230 * | |
231 * @param service The disco service. | |
232 * @return The protocol data. | |
233 * | |
234 * @since TODO | |
235 */ | |
236 gpointer purple_disco_service_get_protocol_data(PurpleDiscoService *service); | |
207 | 237 |
208 /** | 238 /** |
209 * Return a service's type. | 239 * Return a service's type. |
210 * | 240 * |
211 * @param service The service. | 241 * @param service The service. |
348 * @see purple_disco_list_set_protocol_data() | 378 * @see purple_disco_list_set_protocol_data() |
349 * @since TODO | 379 * @since TODO |
350 */ | 380 */ |
351 gpointer purple_disco_list_get_protocol_data(PurpleDiscoList *list); | 381 gpointer purple_disco_list_get_protocol_data(PurpleDiscoList *list); |
352 | 382 |
353 void purple_disco_list_set_cancel_func(PurpleDiscoList *list, PurpleDiscoCancelFunc cb); | 383 void purple_disco_list_set_service_close_func(PurpleDiscoList *list, |
354 void purple_disco_list_set_register_func(PurpleDiscoList *list, PurpleDiscoRegisterFunc cb); | 384 PurpleDiscoServiceCloseFunc cb); |
385 void purple_disco_list_set_cancel_func(PurpleDiscoList *list, | |
386 PurpleDiscoCancelFunc cb); | |
387 void purple_disco_list_set_expand_func(PurpleDiscoList *list, | |
388 PurpleDiscoServiceExpandFunc cb); | |
389 void purple_disco_list_set_register_func(PurpleDiscoList *list, | |
390 PurpleDiscoRegisterFunc cb); | |
355 | 391 |
356 /** | 392 /** |
357 * Sets the UI operations structure to be used in all purple service discovery. | 393 * Sets the UI operations structure to be used in all purple service discovery. |
358 * | 394 * |
359 * @param ops The UI operations structure. | 395 * @param ops The UI operations structure. |