libpurple/buddylist.h

branch
soc.2013.gobjectification.plugins
changeset 37017
8e2b68c79fa1
parent 35024
eb3afb7643ce
child 37021
04c99b24db84
equal deleted inserted replaced
37016:48f85579cc4c 37017:8e2b68c79fa1
104 * 104 *
105 * Implementation of this UI op is OPTIONAL. If not implemented, it will 105 * Implementation of this UI op is OPTIONAL. If not implemented, it will
106 * be set to a fallback function that saves data to blist.xml like in 106 * be set to a fallback function that saves data to blist.xml like in
107 * previous libpurple versions. 107 * previous libpurple versions.
108 * 108 *
109 * @param node The node which has been modified. 109 * @node: The node which has been modified.
110 */ 110 */
111 void (*save_node)(PurpleBlistNode *node); 111 void (*save_node)(PurpleBlistNode *node);
112 112
113 /** 113 /**
114 * Called when a node is about to be removed from the buddy list. 114 * Called when a node is about to be removed from the buddy list.
117 * 117 *
118 * Implementation of this UI op is OPTIONAL. If not implemented, it will 118 * Implementation of this UI op is OPTIONAL. If not implemented, it will
119 * be set to a fallback function that saves data to blist.xml like in 119 * be set to a fallback function that saves data to blist.xml like in
120 * previous libpurple versions. 120 * previous libpurple versions.
121 * 121 *
122 * @param node The node which has been modified. 122 * @node: The node which has been modified.
123 */ 123 */
124 void (*remove_node)(PurpleBlistNode *node); 124 void (*remove_node)(PurpleBlistNode *node);
125 125
126 /** 126 /**
127 * Called to save all the data for an account. If the UI sets this, 127 * Called to save all the data for an account. If the UI sets this,
130 * 130 *
131 * Implementation of this UI op is OPTIONAL. If not implemented, it will 131 * Implementation of this UI op is OPTIONAL. If not implemented, it will
132 * be set to a fallback function that saves data to blist.xml like in 132 * be set to a fallback function that saves data to blist.xml like in
133 * previous libpurple versions. 133 * previous libpurple versions.
134 * 134 *
135 * @param account The account whose data to save. If NULL, save all data 135 * @account: The account whose data to save. If NULL, save all data
136 * for all accounts. 136 * for all accounts.
137 */ 137 */
138 void (*save_account)(PurpleAccount *account); 138 void (*save_account)(PurpleAccount *account);
139 139
140 /*< private >*/ 140 /*< private >*/
157 GType purple_buddy_list_get_type(void); 157 GType purple_buddy_list_get_type(void);
158 158
159 /** 159 /**
160 * Returns the main buddy list. 160 * Returns the main buddy list.
161 * 161 *
162 * @return The main buddy list. 162 * Returns: The main buddy list.
163 */ 163 */
164 PurpleBuddyList *purple_blist_get_buddy_list(void); 164 PurpleBuddyList *purple_blist_get_buddy_list(void);
165 165
166 /** 166 /**
167 * Returns the root node of the main buddy list. 167 * Returns the root node of the main buddy list.
168 * 168 *
169 * @return The root node. 169 * Returns: The root node.
170 */ 170 */
171 PurpleBlistNode *purple_blist_get_root(void); 171 PurpleBlistNode *purple_blist_get_root(void);
172 172
173 /** 173 /**
174 * Returns a list of every buddy in the list. Use of this function is 174 * Returns a list of every buddy in the list. Use of this function is
175 * discouraged if you do not actually need every buddy in the list. Use 175 * discouraged if you do not actually need every buddy in the list. Use
176 * purple_blist_find_buddies instead. 176 * purple_blist_find_buddies instead.
177 * 177 *
178 * @return A list of every buddy in the list. Caller is responsible for 178 * Returns: A list of every buddy in the list. Caller is responsible for
179 * freeing the list. 179 * freeing the list.
180 * 180 *
181 * @see purple_blist_find_buddies 181 * @see purple_blist_find_buddies
182 */ 182 */
183 GSList *purple_blist_get_buddies(void); 183 GSList *purple_blist_get_buddies(void);
184 184
185 /** 185 /**
186 * Returns the UI data for the list. 186 * Returns the UI data for the list.
187 * 187 *
188 * @return The UI data for the list. 188 * Returns: The UI data for the list.
189 */ 189 */
190 gpointer purple_blist_get_ui_data(void); 190 gpointer purple_blist_get_ui_data(void);
191 191
192 /** 192 /**
193 * Sets the UI data for the list. 193 * Sets the UI data for the list.
194 * 194 *
195 * @param ui_data The UI data for the list. 195 * @ui_data: The UI data for the list.
196 */ 196 */
197 void purple_blist_set_ui_data(gpointer ui_data); 197 void purple_blist_set_ui_data(gpointer ui_data);
198 198
199 /** 199 /**
200 * Shows the buddy list, creating a new one if necessary. 200 * Shows the buddy list, creating a new one if necessary.
202 void purple_blist_show(void); 202 void purple_blist_show(void);
203 203
204 /** 204 /**
205 * Hides or unhides the buddy list. 205 * Hides or unhides the buddy list.
206 * 206 *
207 * @param show Whether or not to show the buddy list 207 * @show: Whether or not to show the buddy list
208 */ 208 */
209 void purple_blist_set_visible(gboolean show); 209 void purple_blist_set_visible(gboolean show);
210 210
211 /** 211 /**
212 * Updates the buddies hash table when a buddy has been renamed. This only 212 * Updates the buddies hash table when a buddy has been renamed. This only
213 * updates the cache, the caller is responsible for the actual renaming of 213 * updates the cache, the caller is responsible for the actual renaming of
214 * the buddy after updating the cache. 214 * the buddy after updating the cache.
215 * 215 *
216 * @param buddy The buddy whose name will be changed. 216 * @buddy: The buddy whose name will be changed.
217 * @param name The new name of the buddy. 217 * @name: The new name of the buddy.
218 */ 218 */
219 void purple_blist_update_buddies_cache(PurpleBuddy *buddy, const char *new_name); 219 void purple_blist_update_buddies_cache(PurpleBuddy *buddy, const char *new_name);
220 220
221 /** 221 /**
222 * Updates the groups hash table when a group has been renamed. This only 222 * Updates the groups hash table when a group has been renamed. This only
223 * updates the cache, the caller is responsible for the actual renaming of 223 * updates the cache, the caller is responsible for the actual renaming of
224 * the group after updating the cache. 224 * the group after updating the cache.
225 * 225 *
226 * @param group The group whose name will be changed. 226 * @group: The group whose name will be changed.
227 * @param name The new name of the group. 227 * @name: The new name of the group.
228 */ 228 */
229 void purple_blist_update_groups_cache(PurpleGroup *group, const char *new_name); 229 void purple_blist_update_groups_cache(PurpleGroup *group, const char *new_name);
230 230
231 /** 231 /**
232 * Adds a new chat to the buddy list. 232 * Adds a new chat to the buddy list.
233 * 233 *
234 * The chat will be inserted right after node or appended to the end 234 * The chat will be inserted right after node or appended to the end
235 * of group if node is NULL. If both are NULL, the buddy will be added to 235 * of group if node is NULL. If both are NULL, the buddy will be added to
236 * the "Chats" group. 236 * the "Chats" group.
237 * 237 *
238 * @param chat The new chat who gets added 238 * @chat: The new chat who gets added
239 * @param group The group to add the new chat to. 239 * @group: The group to add the new chat to.
240 * @param node The insertion point 240 * @node: The insertion point
241 */ 241 */
242 void purple_blist_add_chat(PurpleChat *chat, PurpleGroup *group, PurpleBlistNode *node); 242 void purple_blist_add_chat(PurpleChat *chat, PurpleGroup *group, PurpleBlistNode *node);
243 243
244 /** 244 /**
245 * Adds a new buddy to the buddy list. 245 * Adds a new buddy to the buddy list.
246 * 246 *
247 * The buddy will be inserted right after node or prepended to the 247 * The buddy will be inserted right after node or prepended to the
248 * group if node is NULL. If both are NULL, the buddy will be added to 248 * group if node is NULL. If both are NULL, the buddy will be added to
249 * the "Buddies" group. 249 * the "Buddies" group.
250 * 250 *
251 * @param buddy The new buddy who gets added 251 * @buddy: The new buddy who gets added
252 * @param contact The optional contact to place the buddy in. 252 * @contact: The optional contact to place the buddy in.
253 * @param group The group to add the new buddy to. 253 * @group: The group to add the new buddy to.
254 * @param node The insertion point. Pass in NULL to add the node as 254 * @node: The insertion point. Pass in NULL to add the node as
255 * the first child in the given group. 255 * the first child in the given group.
256 */ 256 */
257 void purple_blist_add_buddy(PurpleBuddy *buddy, PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node); 257 void purple_blist_add_buddy(PurpleBuddy *buddy, PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node);
258 258
259 /** 259 /**
260 * Adds a new group to the buddy list. 260 * Adds a new group to the buddy list.
261 * 261 *
262 * The new group will be inserted after insert or prepended to the list if 262 * The new group will be inserted after insert or prepended to the list if
263 * node is NULL. 263 * node is NULL.
264 * 264 *
265 * @param group The group 265 * @group: The group
266 * @param node The insertion point 266 * @node: The insertion point
267 */ 267 */
268 void purple_blist_add_group(PurpleGroup *group, PurpleBlistNode *node); 268 void purple_blist_add_group(PurpleGroup *group, PurpleBlistNode *node);
269 269
270 /** 270 /**
271 * Adds a new contact to the buddy list. 271 * Adds a new contact to the buddy list.
272 * 272 *
273 * The new contact will be inserted after insert or prepended to the list if 273 * The new contact will be inserted after insert or prepended to the list if
274 * node is NULL. 274 * node is NULL.
275 * 275 *
276 * @param contact The contact 276 * @contact: The contact
277 * @param group The group to add the contact to 277 * @group: The group to add the contact to
278 * @param node The insertion point 278 * @node: The insertion point
279 */ 279 */
280 void purple_blist_add_contact(PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node); 280 void purple_blist_add_contact(PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node);
281 281
282 /** 282 /**
283 * Removes a buddy from the buddy list and frees the memory allocated to it. 283 * Removes a buddy from the buddy list and frees the memory allocated to it.
284 * This doesn't actually try to remove the buddy from the server list. 284 * This doesn't actually try to remove the buddy from the server list.
285 * 285 *
286 * @param buddy The buddy to be removed 286 * @buddy: The buddy to be removed
287 * 287 *
288 * @see purple_account_remove_buddy 288 * @see purple_account_remove_buddy
289 */ 289 */
290 void purple_blist_remove_buddy(PurpleBuddy *buddy); 290 void purple_blist_remove_buddy(PurpleBuddy *buddy);
291 291
292 /** 292 /**
293 * Removes a contact, and any buddies it contains, and frees the memory 293 * Removes a contact, and any buddies it contains, and frees the memory
294 * allocated to it. This calls purple_blist_remove_buddy and therefore 294 * allocated to it. This calls purple_blist_remove_buddy and therefore
295 * doesn't remove the buddies from the server list. 295 * doesn't remove the buddies from the server list.
296 * 296 *
297 * @param contact The contact to be removed 297 * @contact: The contact to be removed
298 * 298 *
299 * @see purple_blist_remove_buddy 299 * @see purple_blist_remove_buddy
300 */ 300 */
301 void purple_blist_remove_contact(PurpleContact *contact); 301 void purple_blist_remove_contact(PurpleContact *contact);
302 302
303 /** 303 /**
304 * Removes a chat from the buddy list and frees the memory allocated to it. 304 * Removes a chat from the buddy list and frees the memory allocated to it.
305 * 305 *
306 * @param chat The chat to be removed 306 * @chat: The chat to be removed
307 */ 307 */
308 void purple_blist_remove_chat(PurpleChat *chat); 308 void purple_blist_remove_chat(PurpleChat *chat);
309 309
310 /** 310 /**
311 * Removes a group from the buddy list and frees the memory allocated to it and to 311 * Removes a group from the buddy list and frees the memory allocated to it and to
312 * its children 312 * its children
313 * 313 *
314 * @param group The group to be removed 314 * @group: The group to be removed
315 */ 315 */
316 void purple_blist_remove_group(PurpleGroup *group); 316 void purple_blist_remove_group(PurpleGroup *group);
317 317
318 /** 318 /**
319 * Finds the buddy struct given a name and an account 319 * Finds the buddy struct given a name and an account
320 * 320 *
321 * @param account The account this buddy belongs to 321 * @account: The account this buddy belongs to
322 * @param name The buddy's name 322 * @name: The buddy's name
323 * @return The buddy or NULL if the buddy does not exist 323 * Returns: The buddy or NULL if the buddy does not exist
324 */ 324 */
325 PurpleBuddy *purple_blist_find_buddy(PurpleAccount *account, const char *name); 325 PurpleBuddy *purple_blist_find_buddy(PurpleAccount *account, const char *name);
326 326
327 /** 327 /**
328 * Finds the buddy struct given a name, an account, and a group 328 * Finds the buddy struct given a name, an account, and a group
329 * 329 *
330 * @param account The account this buddy belongs to 330 * @account: The account this buddy belongs to
331 * @param name The buddy's name 331 * @name: The buddy's name
332 * @param group The group to look in 332 * @group: The group to look in
333 * @return The buddy or NULL if the buddy does not exist in the group 333 * Returns: The buddy or NULL if the buddy does not exist in the group
334 */ 334 */
335 PurpleBuddy *purple_blist_find_buddy_in_group(PurpleAccount *account, const char *name, 335 PurpleBuddy *purple_blist_find_buddy_in_group(PurpleAccount *account, const char *name,
336 PurpleGroup *group); 336 PurpleGroup *group);
337 337
338 /** 338 /**
339 * Finds all PurpleBuddy structs given a name and an account 339 * Finds all PurpleBuddy structs given a name and an account
340 * 340 *
341 * @param account The account this buddy belongs to 341 * @account: The account this buddy belongs to
342 * @param name The buddy's name (or NULL to return all buddies for the account) 342 * @name: The buddy's name (or NULL to return all buddies for the account)
343 * 343 *
344 * @return NULL if the buddy doesn't exist, or a GSList of 344 * Returns: NULL if the buddy doesn't exist, or a GSList of
345 * PurpleBuddy structs. You must free the GSList using 345 * PurpleBuddy structs. You must free the GSList using
346 * g_slist_free. Do not free the PurpleBuddy structs that 346 * g_slist_free. Do not free the PurpleBuddy structs that
347 * the list points to. 347 * the list points to.
348 */ 348 */
349 GSList *purple_blist_find_buddies(PurpleAccount *account, const char *name); 349 GSList *purple_blist_find_buddies(PurpleAccount *account, const char *name);
350 350
351 /** 351 /**
352 * Finds a group by name 352 * Finds a group by name
353 * 353 *
354 * @param name The group's name 354 * @name: The group's name
355 * @return The group or NULL if the group does not exist 355 * Returns: The group or NULL if the group does not exist
356 */ 356 */
357 PurpleGroup *purple_blist_find_group(const char *name); 357 PurpleGroup *purple_blist_find_group(const char *name);
358 358
359 /** 359 /**
360 * Finds a chat by name. 360 * Finds a chat by name.
361 * 361 *
362 * @param account The chat's account. 362 * @account: The chat's account.
363 * @param name The chat's name. 363 * @name: The chat's name.
364 * 364 *
365 * @return The chat, or @c NULL if the chat does not exist. 365 * Returns: The chat, or @c NULL if the chat does not exist.
366 */ 366 */
367 PurpleChat *purple_blist_find_chat(PurpleAccount *account, const char *name); 367 PurpleChat *purple_blist_find_chat(PurpleAccount *account, const char *name);
368 368
369 /** 369 /**
370 * Called when an account connects. Tells the UI to update all the 370 * Called when an account connects. Tells the UI to update all the
371 * buddies. 371 * buddies.
372 * 372 *
373 * @param account The account 373 * @account: The account
374 */ 374 */
375 void purple_blist_add_account(PurpleAccount *account); 375 void purple_blist_add_account(PurpleAccount *account);
376 376
377 /** 377 /**
378 * Called when an account disconnects. Sets the presence of all the buddies to 0 378 * Called when an account disconnects. Sets the presence of all the buddies to 0
379 * and tells the UI to update them. 379 * and tells the UI to update them.
380 * 380 *
381 * @param account The account 381 * @account: The account
382 */ 382 */
383 void purple_blist_remove_account(PurpleAccount *account); 383 void purple_blist_remove_account(PurpleAccount *account);
384 384
385 /*@}*/ 385 /*@}*/
386 386
399 399
400 /** 400 /**
401 * Requests from the user information needed to add a buddy to the 401 * Requests from the user information needed to add a buddy to the
402 * buddy list. 402 * buddy list.
403 * 403 *
404 * @param account The account the buddy is added to. 404 * @account: The account the buddy is added to.
405 * @param username The username of the buddy. 405 * @username: The username of the buddy.
406 * @param group The name of the group to place the buddy in. 406 * @group: The name of the group to place the buddy in.
407 * @param alias The optional alias for the buddy. 407 * @alias: The optional alias for the buddy.
408 */ 408 */
409 void purple_blist_request_add_buddy(PurpleAccount *account, const char *username, 409 void purple_blist_request_add_buddy(PurpleAccount *account, const char *username,
410 const char *group, const char *alias); 410 const char *group, const char *alias);
411 411
412 /** 412 /**
413 * Requests from the user information needed to add a chat to the 413 * Requests from the user information needed to add a chat to the
414 * buddy list. 414 * buddy list.
415 * 415 *
416 * @param account The account the buddy is added to. 416 * @account: The account the buddy is added to.
417 * @param group The optional group to add the chat to. 417 * @group: The optional group to add the chat to.
418 * @param alias The optional alias for the chat. 418 * @alias: The optional alias for the chat.
419 * @param name The required chat name. 419 * @name: The required chat name.
420 */ 420 */
421 void purple_blist_request_add_chat(PurpleAccount *account, PurpleGroup *group, 421 void purple_blist_request_add_chat(PurpleAccount *account, PurpleGroup *group,
422 const char *alias, const char *name); 422 const char *alias, const char *name);
423 423
424 /** 424 /**
433 /*@{*/ 433 /*@{*/
434 434
435 /** 435 /**
436 * Sets the UI operations structure to be used for the buddy list. 436 * Sets the UI operations structure to be used for the buddy list.
437 * 437 *
438 * @param ops The ops struct. 438 * @ops: The ops struct.
439 */ 439 */
440 void purple_blist_set_ui_ops(PurpleBlistUiOps *ops); 440 void purple_blist_set_ui_ops(PurpleBlistUiOps *ops);
441 441
442 /** 442 /**
443 * Returns the UI operations structure to be used for the buddy list. 443 * Returns the UI operations structure to be used for the buddy list.
444 * 444 *
445 * @return The UI operations structure. 445 * Returns: The UI operations structure.
446 */ 446 */
447 PurpleBlistUiOps *purple_blist_get_ui_ops(void); 447 PurpleBlistUiOps *purple_blist_get_ui_ops(void);
448 448
449 /*@}*/ 449 /*@}*/
450 450
454 /*@{*/ 454 /*@{*/
455 455
456 /** 456 /**
457 * Returns the handle for the buddy list subsystem. 457 * Returns the handle for the buddy list subsystem.
458 * 458 *
459 * @return The buddy list subsystem handle. 459 * Returns: The buddy list subsystem handle.
460 */ 460 */
461 void *purple_blist_get_handle(void); 461 void *purple_blist_get_handle(void);
462 462
463 /** 463 /**
464 * Initializes the buddy list subsystem. 464 * Initializes the buddy list subsystem.

mercurial