1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/Frameworks/libpurple.framework/Versions/0.6.2/Headers/blist.h Fri Aug 21 13:25:11 2009 -0700
1.3 @@ -0,0 +1,1248 @@
1.4 +/**
1.5 + * @file blist.h Buddy List API
1.6 + * @ingroup core
1.7 + * @see @ref blist-signals
1.8 + */
1.9 +
1.10 +/* purple
1.11 + *
1.12 + * Purple is the legal property of its developers, whose names are too numerous
1.13 + * to list here. Please refer to the COPYRIGHT file distributed with this
1.14 + * source distribution.
1.15 + *
1.16 + * This program is free software; you can redistribute it and/or modify
1.17 + * it under the terms of the GNU General Public License as published by
1.18 + * the Free Software Foundation; either version 2 of the License, or
1.19 + * (at your option) any later version.
1.20 + *
1.21 + * This program is distributed in the hope that it will be useful,
1.22 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.24 + * GNU General Public License for more details.
1.25 + *
1.26 + * You should have received a copy of the GNU General Public License
1.27 + * along with this program; if not, write to the Free Software
1.28 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
1.29 + */
1.30 +#ifndef _PURPLE_BLIST_H_
1.31 +#define _PURPLE_BLIST_H_
1.32 +
1.33 +/* I can't believe I let ChipX86 inspire me to write good code. -Sean */
1.34 +
1.35 +#include <glib.h>
1.36 +
1.37 +/** @copydoc _PurpleBuddyList */
1.38 +typedef struct _PurpleBuddyList PurpleBuddyList;
1.39 +/** @copydoc _PurpleBlistUiOps */
1.40 +typedef struct _PurpleBlistUiOps PurpleBlistUiOps;
1.41 +/** @copydoc _PurpleBlistNode */
1.42 +typedef struct _PurpleBlistNode PurpleBlistNode;
1.43 +
1.44 +/** @copydoc _PurpleChat */
1.45 +typedef struct _PurpleChat PurpleChat;
1.46 +/** @copydoc _PurpleGroup */
1.47 +typedef struct _PurpleGroup PurpleGroup;
1.48 +/** @copydoc _PurpleContact */
1.49 +typedef struct _PurpleContact PurpleContact;
1.50 +/** @copydoc _PurpleBuddy */
1.51 +typedef struct _PurpleBuddy PurpleBuddy;
1.52 +
1.53 +/**************************************************************************/
1.54 +/* Enumerations */
1.55 +/**************************************************************************/
1.56 +typedef enum
1.57 +{
1.58 + PURPLE_BLIST_GROUP_NODE,
1.59 + PURPLE_BLIST_CONTACT_NODE,
1.60 + PURPLE_BLIST_BUDDY_NODE,
1.61 + PURPLE_BLIST_CHAT_NODE,
1.62 + PURPLE_BLIST_OTHER_NODE
1.63 +
1.64 +} PurpleBlistNodeType;
1.65 +
1.66 +#define PURPLE_BLIST_NODE_IS_CHAT(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CHAT_NODE)
1.67 +#define PURPLE_BLIST_NODE_IS_BUDDY(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_BUDDY_NODE)
1.68 +#define PURPLE_BLIST_NODE_IS_CONTACT(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CONTACT_NODE)
1.69 +#define PURPLE_BLIST_NODE_IS_GROUP(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_GROUP_NODE)
1.70 +
1.71 +#define PURPLE_BUDDY_IS_ONLINE(b) \
1.72 + ((b) != NULL && purple_account_is_connected(purple_buddy_get_account(b)) && \
1.73 + purple_presence_is_online(purple_buddy_get_presence(b)))
1.74 +
1.75 +typedef enum
1.76 +{
1.77 + PURPLE_BLIST_NODE_FLAG_NO_SAVE = 1 << 0 /**< node should not be saved with the buddy list */
1.78 +
1.79 +} PurpleBlistNodeFlags;
1.80 +
1.81 +/**
1.82 + * @since 2.6.0
1.83 + */
1.84 +#define PURPLE_BLIST_NODE(obj) ((PurpleBlistNode *)(obj))
1.85 +
1.86 +#define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (purple_blist_node_get_flags((PurpleBlistNode*)(b)) & (f))
1.87 +#define PURPLE_BLIST_NODE_SHOULD_SAVE(b) (! PURPLE_BLIST_NODE_HAS_FLAG(b, PURPLE_BLIST_NODE_FLAG_NO_SAVE))
1.88 +
1.89 +#define PURPLE_BLIST_NODE_NAME(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CHAT_NODE ? purple_chat_get_name((PurpleChat*)n) : \
1.90 + purple_blist_node_get_type(n) == PURPLE_BLIST_BUDDY_NODE ? purple_buddy_get_name((PurpleBuddy*)n) : NULL)
1.91 +
1.92 +/**
1.93 + * @since 2.6.0
1.94 + */
1.95 +#define PURPLE_GROUP(obj) ((PurpleGroup *)(obj))
1.96 +
1.97 +/**
1.98 + * @since 2.6.0
1.99 + */
1.100 +#define PURPLE_CONTACT(obj) ((PurpleContact *)(obj))
1.101 +
1.102 +/**
1.103 + * @since 2.6.0
1.104 + */
1.105 +#define PURPLE_BUDDY(obj) ((PurpleBuddy *)(obj))
1.106 +
1.107 +/**
1.108 + * @since 2.6.0
1.109 + */
1.110 +#define PURPLE_CHAT(obj) ((PurpleChat *)(obj))
1.111 +
1.112 +#include "account.h"
1.113 +#include "buddyicon.h"
1.114 +#include "status.h"
1.115 +
1.116 +/**************************************************************************/
1.117 +/* Data Structures */
1.118 +/**************************************************************************/
1.119 +
1.120 +#if !(defined PURPLE_HIDE_STRUCTS) || (defined _PURPLE_BLIST_C_)
1.121 +
1.122 +/**
1.123 + * A Buddy list node. This can represent a group, a buddy, or anything else.
1.124 + * This is a base class for PurpleBuddy, PurpleContact, PurpleGroup, and for
1.125 + * anything else that wants to put itself in the buddy list. */
1.126 +struct _PurpleBlistNode {
1.127 + PurpleBlistNodeType type; /**< The type of node this is */
1.128 + PurpleBlistNode *prev; /**< The sibling before this buddy. */
1.129 + PurpleBlistNode *next; /**< The sibling after this buddy. */
1.130 + PurpleBlistNode *parent; /**< The parent of this node */
1.131 + PurpleBlistNode *child; /**< The child of this node */
1.132 + GHashTable *settings; /**< per-node settings */
1.133 + void *ui_data; /**< The UI can put data here. */
1.134 + PurpleBlistNodeFlags flags; /**< The buddy flags */
1.135 +};
1.136 +
1.137 +/**
1.138 + * A buddy. This contains everything Purple will ever need to know about someone on the buddy list. Everything.
1.139 + */
1.140 +struct _PurpleBuddy {
1.141 + PurpleBlistNode node; /**< The node that this buddy inherits from */
1.142 + char *name; /**< The name of the buddy. */
1.143 + char *alias; /**< The user-set alias of the buddy */
1.144 + char *server_alias; /**< The server-specified alias of the buddy. (i.e. MSN "Friendly Names") */
1.145 + void *proto_data; /**< This allows the prpl to associate whatever data it wants with a buddy */
1.146 + PurpleBuddyIcon *icon; /**< The buddy icon. */
1.147 + PurpleAccount *account; /**< the account this buddy belongs to */
1.148 + PurplePresence *presence;
1.149 +};
1.150 +
1.151 +/**
1.152 + * A contact. This contains everything Purple will ever need to know about a contact.
1.153 + */
1.154 +struct _PurpleContact {
1.155 + PurpleBlistNode node; /**< The node that this contact inherits from. */
1.156 + char *alias; /**< The user-set alias of the contact */
1.157 + int totalsize; /**< The number of buddies in this contact */
1.158 + int currentsize; /**< The number of buddies in this contact corresponding to online accounts */
1.159 + int online; /**< The number of buddies in this contact who are currently online */
1.160 + PurpleBuddy *priority; /**< The "top" buddy for this contact */
1.161 + gboolean priority_valid; /**< Is priority valid? */
1.162 +};
1.163 +
1.164 +
1.165 +/**
1.166 + * A group. This contains everything Purple will ever need to know about a group.
1.167 + */
1.168 +struct _PurpleGroup {
1.169 + PurpleBlistNode node; /**< The node that this group inherits from */
1.170 + char *name; /**< The name of this group. */
1.171 + int totalsize; /**< The number of chats and contacts in this group */
1.172 + int currentsize; /**< The number of chats and contacts in this group corresponding to online accounts */
1.173 + int online; /**< The number of chats and contacts in this group who are currently online */
1.174 +};
1.175 +
1.176 +/**
1.177 + * A chat. This contains everything Purple needs to put a chat room in the
1.178 + * buddy list.
1.179 + */
1.180 +struct _PurpleChat {
1.181 + PurpleBlistNode node; /**< The node that this chat inherits from */
1.182 + char *alias; /**< The display name of this chat. */
1.183 + GHashTable *components; /**< the stuff the protocol needs to know to join the chat */
1.184 + PurpleAccount *account; /**< The account this chat is attached to */
1.185 +};
1.186 +
1.187 +/**
1.188 + * The Buddy List
1.189 + */
1.190 +struct _PurpleBuddyList {
1.191 + PurpleBlistNode *root; /**< The first node in the buddy list */
1.192 + GHashTable *buddies; /**< Every buddy in this list */
1.193 + void *ui_data; /**< UI-specific data. */
1.194 +};
1.195 +
1.196 +#endif /* PURPLE_HIDE_STRUCTS && PURPLE_BLIST_STRUCTS */
1.197 +
1.198 +/**
1.199 + * Buddy list UI operations.
1.200 + *
1.201 + * Any UI representing a buddy list must assign a filled-out PurpleBlistUiOps
1.202 + * structure to the buddy list core.
1.203 + */
1.204 +struct _PurpleBlistUiOps
1.205 +{
1.206 + void (*new_list)(PurpleBuddyList *list); /**< Sets UI-specific data on a buddy list. */
1.207 + void (*new_node)(PurpleBlistNode *node); /**< Sets UI-specific data on a node. */
1.208 + void (*show)(PurpleBuddyList *list); /**< The core will call this when it's finished doing its core stuff */
1.209 + void (*update)(PurpleBuddyList *list,
1.210 + PurpleBlistNode *node); /**< This will update a node in the buddy list. */
1.211 + void (*remove)(PurpleBuddyList *list,
1.212 + PurpleBlistNode *node); /**< This removes a node from the list */
1.213 + void (*destroy)(PurpleBuddyList *list); /**< When the list is destroyed, this is called to destroy the UI. */
1.214 + void (*set_visible)(PurpleBuddyList *list,
1.215 + gboolean show); /**< Hides or unhides the buddy list */
1.216 + void (*request_add_buddy)(PurpleAccount *account, const char *username,
1.217 + const char *group, const char *alias);
1.218 + void (*request_add_chat)(PurpleAccount *account, PurpleGroup *group,
1.219 + const char *alias, const char *name);
1.220 + void (*request_add_group)(void);
1.221 +
1.222 + /**
1.223 + * This is called when a node has been modified and should be saved.
1.224 + *
1.225 + * Implementation of this UI op is OPTIONAL. If not implemented, it will
1.226 + * be set to a fallback function that saves data to blist.xml like in
1.227 + * previous libpurple versions.
1.228 + *
1.229 + * @attrib node The node which has been modified.
1.230 + *
1.231 + * @since 2.6.0.
1.232 + */
1.233 + void (*save_node)(PurpleBlistNode *node);
1.234 +
1.235 + /**
1.236 + * Called when a node is about to be removed from the buddy list.
1.237 + * The UI op should update the relevant data structures to remove this
1.238 + * node (for example, removing a buddy from the group this node is in).
1.239 + *
1.240 + * Implementation of this UI op is OPTIONAL. If not implemented, it will
1.241 + * be set to a fallback function that saves data to blist.xml like in
1.242 + * previous libpurple versions.
1.243 + *
1.244 + * @attrib node The node which has been modified.
1.245 + * @since 2.6.0.
1.246 + */
1.247 + void (*remove_node)(PurpleBlistNode *node);
1.248 +
1.249 + /**
1.250 + * Called to save all the data for an account. If the UI sets this,
1.251 + * the callback must save the privacy and buddy list data for an account.
1.252 + * If the account is NULL, save the data for all accounts.
1.253 + *
1.254 + * Implementation of this UI op is OPTIONAL. If not implemented, it will
1.255 + * be set to a fallback function that saves data to blist.xml like in
1.256 + * previous libpurple versions.
1.257 + *
1.258 + * @attrib account The account whose data to save. If NULL, save all data
1.259 + * for all accounts.
1.260 + * @since 2.6.0.
1.261 + */
1.262 + void (*save_account)(PurpleAccount *account);
1.263 +
1.264 + void (*_purple_reserved1)(void);
1.265 +};
1.266 +
1.267 +#ifdef __cplusplus
1.268 +extern "C" {
1.269 +#endif
1.270 +
1.271 +/**************************************************************************/
1.272 +/** @name Buddy List API */
1.273 +/**************************************************************************/
1.274 +/*@{*/
1.275 +
1.276 +/**
1.277 + * Creates a new buddy list
1.278 + *
1.279 + * @return The new buddy list.
1.280 + * @deprecated In 3.0.0, this will be handled by purple_blist_init()
1.281 + */
1.282 +PurpleBuddyList *purple_blist_new(void);
1.283 +
1.284 +/**
1.285 + * Sets the main buddy list.
1.286 + *
1.287 + * @param blist The buddy list you want to use.
1.288 + * @deprecated In 3.0.0, this will be handled by purple_blist_init()
1.289 + */
1.290 +void purple_set_blist(PurpleBuddyList *blist);
1.291 +
1.292 +/**
1.293 + * Returns the main buddy list.
1.294 + *
1.295 + * @return The main buddy list.
1.296 + */
1.297 +PurpleBuddyList *purple_get_blist(void);
1.298 +
1.299 +/**
1.300 + * Returns the root node of the main buddy list.
1.301 + *
1.302 + * @return The root node.
1.303 + */
1.304 +PurpleBlistNode *purple_blist_get_root(void);
1.305 +
1.306 +/**
1.307 + * Returns a list of every buddy in the list. Use of this function is
1.308 + * discouraged if you do not actually need every buddy in the list. Use
1.309 + * purple_find_buddies instead.
1.310 + *
1.311 + * @return A list of every buddy in the list. Caller is responsible for
1.312 + * freeing the list.
1.313 + *
1.314 + * @see purple_find_buddies
1.315 + * @since 2.6.0
1.316 + */
1.317 +GSList *purple_blist_get_buddies(void);
1.318 +
1.319 +/**
1.320 + * Returns the UI data for the list.
1.321 + *
1.322 + * @return The UI data for the list.
1.323 + *
1.324 + * @since 2.6.0
1.325 + */
1.326 +gpointer purple_blist_get_ui_data(void);
1.327 +
1.328 +/**
1.329 + * Sets the UI data for the list.
1.330 + *
1.331 + * @param ui_data The UI data for the list.
1.332 + *
1.333 + * @since 2.6.0
1.334 + */
1.335 +void purple_blist_set_ui_data(gpointer ui_data);
1.336 +
1.337 +/**
1.338 + * Returns the next node of a given node. This function is to be used to iterate
1.339 + * over the tree returned by purple_get_blist.
1.340 + *
1.341 + * @param node A node.
1.342 + * @param offline Whether to include nodes for offline accounts
1.343 + * @return The next node
1.344 + * @see purple_blist_node_get_parent
1.345 + * @see purple_blist_node_get_first_child
1.346 + * @see purple_blist_node_get_sibling_next
1.347 + * @see purple_blist_node_get_sibling_prev
1.348 + */
1.349 +PurpleBlistNode *purple_blist_node_next(PurpleBlistNode *node, gboolean offline);
1.350 +
1.351 +/**
1.352 + * Returns the parent node of a given node.
1.353 + *
1.354 + * @param node A node.
1.355 + * @return The parent node.
1.356 + * @since 2.4.0
1.357 + * @see purple_blist_node_get_first_child
1.358 + * @see purple_blist_node_get_sibling_next
1.359 + * @see purple_blist_node_get_sibling_prev
1.360 + * @see purple_blist_node_next
1.361 + */
1.362 +PurpleBlistNode *purple_blist_node_get_parent(PurpleBlistNode *node);
1.363 +
1.364 +/**
1.365 + * Returns the the first child node of a given node.
1.366 + *
1.367 + * @param node A node.
1.368 + * @return The child node.
1.369 + * @since 2.4.0
1.370 + * @see purple_blist_node_get_parent
1.371 + * @see purple_blist_node_get_sibling_next
1.372 + * @see purple_blist_node_get_sibling_prev
1.373 + * @see purple_blist_node_next
1.374 + */
1.375 +PurpleBlistNode *purple_blist_node_get_first_child(PurpleBlistNode *node);
1.376 +
1.377 +/**
1.378 + * Returns the sibling node of a given node.
1.379 + *
1.380 + * @param node A node.
1.381 + * @return The sibling node.
1.382 + * @since 2.4.0
1.383 + * @see purple_blist_node_get_parent
1.384 + * @see purple_blist_node_get_first_child
1.385 + * @see purple_blist_node_get_sibling_prev
1.386 + * @see purple_blist_node_next
1.387 + */
1.388 +PurpleBlistNode *purple_blist_node_get_sibling_next(PurpleBlistNode *node);
1.389 +
1.390 +/**
1.391 + * Returns the previous sibling node of a given node.
1.392 + *
1.393 + * @param node A node.
1.394 + * @return The sibling node.
1.395 + * @since 2.4.0
1.396 + * @see purple_blist_node_get_parent
1.397 + * @see purple_blist_node_get_first_child
1.398 + * @see purple_blist_node_get_sibling_next
1.399 + * @see purple_blist_node_next
1.400 + */
1.401 +PurpleBlistNode *purple_blist_node_get_sibling_prev(PurpleBlistNode *node);
1.402 +
1.403 +/**
1.404 + * Returns the UI data of a given node.
1.405 + *
1.406 + * @param node The node.
1.407 + * @return The UI data.
1.408 + * @since 2.6.0
1.409 + */
1.410 +gpointer purple_blist_node_get_ui_data(const PurpleBlistNode *node);
1.411 +
1.412 +/**
1.413 + * Sets the UI data of a given node.
1.414 + *
1.415 + * @param node The node.
1.416 + * @param ui_data The UI data.
1.417 + *
1.418 + * @since 2.6.0
1.419 + */
1.420 +void purple_blist_node_set_ui_data(PurpleBlistNode *node, gpointer ui_data);
1.421 +
1.422 +/**
1.423 + * Shows the buddy list, creating a new one if necessary.
1.424 + */
1.425 +void purple_blist_show(void);
1.426 +
1.427 +
1.428 +/**
1.429 + * Destroys the buddy list window.
1.430 + *
1.431 + * @deprecated The UI is responsible for cleaning up the
1.432 + * PurpleBuddyList->ui_data. purple_blist_uninit() will free the
1.433 + * PurpleBuddyList* itself.
1.434 + */
1.435 +void purple_blist_destroy(void);
1.436 +
1.437 +/**
1.438 + * Hides or unhides the buddy list.
1.439 + *
1.440 + * @param show Whether or not to show the buddy list
1.441 + */
1.442 +void purple_blist_set_visible(gboolean show);
1.443 +
1.444 +/**
1.445 + * Updates a buddy's status.
1.446 + *
1.447 + * This should only be called from within Purple.
1.448 + *
1.449 + * @param buddy The buddy whose status has changed.
1.450 + * @param old_status The status from which we are changing.
1.451 + */
1.452 +void purple_blist_update_buddy_status(PurpleBuddy *buddy, PurpleStatus *old_status);
1.453 +
1.454 +/**
1.455 + * Updates a node's custom icon.
1.456 + *
1.457 + * @param node The PurpleBlistNode whose custom icon has changed.
1.458 + *
1.459 + * @since 2.5.0
1.460 + */
1.461 +void purple_blist_update_node_icon(PurpleBlistNode *node);
1.462 +
1.463 +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
1.464 +/**
1.465 + * Updates a buddy's icon.
1.466 + *
1.467 + * @param buddy The buddy whose buddy icon has changed
1.468 + * @deprecated Use purple_blist_update_node_icon() instead.
1.469 + */
1.470 +void purple_blist_update_buddy_icon(PurpleBuddy *buddy);
1.471 +#endif
1.472 +
1.473 +/**
1.474 + * Renames a buddy in the buddy list.
1.475 + *
1.476 + * @param buddy The buddy whose name will be changed.
1.477 + * @param name The new name of the buddy.
1.478 + */
1.479 +void purple_blist_rename_buddy(PurpleBuddy *buddy, const char *name);
1.480 +
1.481 +/**
1.482 + * Aliases a contact in the buddy list.
1.483 + *
1.484 + * @param contact The contact whose alias will be changed.
1.485 + * @param alias The contact's alias.
1.486 + */
1.487 +void purple_blist_alias_contact(PurpleContact *contact, const char *alias);
1.488 +
1.489 +/**
1.490 + * Aliases a buddy in the buddy list.
1.491 + *
1.492 + * @param buddy The buddy whose alias will be changed.
1.493 + * @param alias The buddy's alias.
1.494 + */
1.495 +void purple_blist_alias_buddy(PurpleBuddy *buddy, const char *alias);
1.496 +
1.497 +/**
1.498 + * Sets the server-sent alias of a buddy in the buddy list.
1.499 + * PRPLs should call serv_got_alias() instead of this.
1.500 + *
1.501 + * @param buddy The buddy whose alias will be changed.
1.502 + * @param alias The buddy's "official" alias.
1.503 + */
1.504 +void purple_blist_server_alias_buddy(PurpleBuddy *buddy, const char *alias);
1.505 +
1.506 +/**
1.507 + * Aliases a chat in the buddy list.
1.508 + *
1.509 + * @param chat The chat whose alias will be changed.
1.510 + * @param alias The chat's new alias.
1.511 + */
1.512 +void purple_blist_alias_chat(PurpleChat *chat, const char *alias);
1.513 +
1.514 +/**
1.515 + * Renames a group
1.516 + *
1.517 + * @param group The group to rename
1.518 + * @param name The new name
1.519 + */
1.520 +void purple_blist_rename_group(PurpleGroup *group, const char *name);
1.521 +
1.522 +/**
1.523 + * Creates a new chat for the buddy list
1.524 + *
1.525 + * @param account The account this chat will get added to
1.526 + * @param alias The alias of the new chat
1.527 + * @param components The info the prpl needs to join the chat. The
1.528 + * hash function should be g_str_hash() and the
1.529 + * equal function should be g_str_equal().
1.530 + * @return A newly allocated chat
1.531 + */
1.532 +PurpleChat *purple_chat_new(PurpleAccount *account, const char *alias, GHashTable *components);
1.533 +
1.534 +/**
1.535 + * Destroys a chat
1.536 + *
1.537 + * @param chat The chat to destroy
1.538 + */
1.539 +void purple_chat_destroy(PurpleChat *chat);
1.540 +
1.541 +/**
1.542 + * Adds a new chat to the buddy list.
1.543 + *
1.544 + * The chat will be inserted right after node or appended to the end
1.545 + * of group if node is NULL. If both are NULL, the buddy will be added to
1.546 + * the "Chats" group.
1.547 + *
1.548 + * @param chat The new chat who gets added
1.549 + * @param group The group to add the new chat to.
1.550 + * @param node The insertion point
1.551 + */
1.552 +void purple_blist_add_chat(PurpleChat *chat, PurpleGroup *group, PurpleBlistNode *node);
1.553 +
1.554 +/**
1.555 + * Creates a new buddy.
1.556 + *
1.557 + * This function only creates the PurpleBuddy. Use purple_blist_add_buddy
1.558 + * to add the buddy to the list and purple_account_add_buddy to sync up
1.559 + * with the server.
1.560 + *
1.561 + * @param account The account this buddy will get added to
1.562 + * @param name The name of the new buddy
1.563 + * @param alias The alias of the new buddy (or NULL if unaliased)
1.564 + * @return A newly allocated buddy
1.565 + *
1.566 + * @see purple_account_add_buddy
1.567 + * @see purple_blist_add_buddy
1.568 + */
1.569 +PurpleBuddy *purple_buddy_new(PurpleAccount *account, const char *name, const char *alias);
1.570 +
1.571 +/**
1.572 + * Destroys a buddy
1.573 + *
1.574 + * @param buddy The buddy to destroy
1.575 + */
1.576 +void purple_buddy_destroy(PurpleBuddy *buddy);
1.577 +
1.578 +/**
1.579 + * Sets a buddy's icon.
1.580 + *
1.581 + * This should only be called from within Purple. You probably want to
1.582 + * call purple_buddy_icon_set_data().
1.583 + *
1.584 + * @param buddy The buddy.
1.585 + * @param icon The buddy icon.
1.586 + *
1.587 + * @see purple_buddy_icon_set_data()
1.588 + */
1.589 +void purple_buddy_set_icon(PurpleBuddy *buddy, PurpleBuddyIcon *icon);
1.590 +
1.591 +/**
1.592 + * Returns a buddy's account.
1.593 + *
1.594 + * @param buddy The buddy.
1.595 + *
1.596 + * @return The account
1.597 + */
1.598 +PurpleAccount *purple_buddy_get_account(const PurpleBuddy *buddy);
1.599 +
1.600 +/**
1.601 + * Returns a buddy's name
1.602 + *
1.603 + * @param buddy The buddy.
1.604 + *
1.605 + * @return The name.
1.606 + */
1.607 +const char *purple_buddy_get_name(const PurpleBuddy *buddy);
1.608 +
1.609 +/**
1.610 + * Returns a buddy's icon.
1.611 + *
1.612 + * @param buddy The buddy.
1.613 + *
1.614 + * @return The buddy icon.
1.615 + */
1.616 +PurpleBuddyIcon *purple_buddy_get_icon(const PurpleBuddy *buddy);
1.617 +
1.618 +/**
1.619 + * Returns a buddy's protocol-specific data.
1.620 + *
1.621 + * This should only be called from the associated prpl.
1.622 + *
1.623 + * @param buddy The buddy.
1.624 + * @return The protocol data.
1.625 + *
1.626 + * @see purple_buddy_set_protocol_data()
1.627 + * @since 2.6.0
1.628 + */
1.629 +gpointer purple_buddy_get_protocol_data(const PurpleBuddy *buddy);
1.630 +
1.631 +/**
1.632 + * Sets a buddy's protocol-specific data.
1.633 + *
1.634 + * This should only be called from the associated prpl.
1.635 + *
1.636 + * @param buddy The buddy.
1.637 + * @param data The data.
1.638 + *
1.639 + * @see purple_buddy_get_protocol_data()
1.640 + * @since 2.6.0
1.641 + */
1.642 +void purple_buddy_set_protocol_data(PurpleBuddy *buddy, gpointer data);
1.643 +
1.644 +/**
1.645 + * Returns a buddy's contact.
1.646 + *
1.647 + * @param buddy The buddy.
1.648 + *
1.649 + * @return The buddy's contact.
1.650 + */
1.651 +PurpleContact *purple_buddy_get_contact(PurpleBuddy *buddy);
1.652 +
1.653 +/**
1.654 + * Returns a buddy's presence.
1.655 + *
1.656 + * @param buddy The buddy.
1.657 + *
1.658 + * @return The buddy's presence.
1.659 + */
1.660 +PurplePresence *purple_buddy_get_presence(const PurpleBuddy *buddy);
1.661 +
1.662 +/**
1.663 + * Adds a new buddy to the buddy list.
1.664 + *
1.665 + * The buddy will be inserted right after node or prepended to the
1.666 + * group if node is NULL. If both are NULL, the buddy will be added to
1.667 + * the "Buddies" group.
1.668 + *
1.669 + * @param buddy The new buddy who gets added
1.670 + * @param contact The optional contact to place the buddy in.
1.671 + * @param group The group to add the new buddy to.
1.672 + * @param node The insertion point. Pass in NULL to add the node as
1.673 + * the first child in the given group.
1.674 + */
1.675 +void purple_blist_add_buddy(PurpleBuddy *buddy, PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node);
1.676 +
1.677 +/**
1.678 + * Creates a new group
1.679 + *
1.680 + * You can't have more than one group with the same name. Sorry. If you pass
1.681 + * this the name of a group that already exists, it will return that group.
1.682 + *
1.683 + * @param name The name of the new group
1.684 + * @return A new group struct
1.685 +*/
1.686 +PurpleGroup *purple_group_new(const char *name);
1.687 +
1.688 +/**
1.689 + * Destroys a group
1.690 + *
1.691 + * @param group The group to destroy
1.692 +*/
1.693 +void purple_group_destroy(PurpleGroup *group);
1.694 +
1.695 +/**
1.696 + * Adds a new group to the buddy list.
1.697 + *
1.698 + * The new group will be inserted after insert or prepended to the list if
1.699 + * node is NULL.
1.700 + *
1.701 + * @param group The group
1.702 + * @param node The insertion point
1.703 + */
1.704 +void purple_blist_add_group(PurpleGroup *group, PurpleBlistNode *node);
1.705 +
1.706 +/**
1.707 + * Creates a new contact
1.708 + *
1.709 + * @return A new contact struct
1.710 + */
1.711 +PurpleContact *purple_contact_new(void);
1.712 +
1.713 +/**
1.714 + * Destroys a contact
1.715 + *
1.716 + * @param contact The contact to destroy
1.717 + */
1.718 +void purple_contact_destroy(PurpleContact *contact);
1.719 +
1.720 +/**
1.721 + * Adds a new contact to the buddy list.
1.722 + *
1.723 + * The new contact will be inserted after insert or prepended to the list if
1.724 + * node is NULL.
1.725 + *
1.726 + * @param contact The contact
1.727 + * @param group The group to add the contact to
1.728 + * @param node The insertion point
1.729 + */
1.730 +void purple_blist_add_contact(PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node);
1.731 +
1.732 +/**
1.733 + * Merges two contacts
1.734 + *
1.735 + * All of the buddies from source will be moved to target
1.736 + *
1.737 + * @param source The contact to merge
1.738 + * @param node The place to merge to (a buddy or contact)
1.739 + */
1.740 +void purple_blist_merge_contact(PurpleContact *source, PurpleBlistNode *node);
1.741 +
1.742 +/**
1.743 + * Returns the highest priority buddy for a given contact.
1.744 + *
1.745 + * @param contact The contact
1.746 + * @return The highest priority buddy
1.747 + */
1.748 +PurpleBuddy *purple_contact_get_priority_buddy(PurpleContact *contact);
1.749 +
1.750 +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
1.751 +/**
1.752 + * Sets the alias for a contact.
1.753 + *
1.754 + * @param contact The contact
1.755 + * @param alias The alias to set, or NULL to unset
1.756 + *
1.757 + * @deprecated Use purple_blist_alias_contact() instead.
1.758 + */
1.759 +void purple_contact_set_alias(PurpleContact *contact, const char *alias);
1.760 +#endif
1.761 +
1.762 +/**
1.763 + * Gets the alias for a contact.
1.764 + *
1.765 + * @param contact The contact
1.766 + * @return The alias, or NULL if it is not set.
1.767 + */
1.768 +const char *purple_contact_get_alias(PurpleContact *contact);
1.769 +
1.770 +/**
1.771 + * Determines whether an account owns any buddies in a given contact
1.772 + *
1.773 + * @param contact The contact to search through.
1.774 + * @param account The account.
1.775 + *
1.776 + * @return TRUE if there are any buddies from account in the contact, or FALSE otherwise.
1.777 + */
1.778 +gboolean purple_contact_on_account(PurpleContact *contact, PurpleAccount *account);
1.779 +
1.780 +/**
1.781 + * Invalidates the priority buddy so that the next call to
1.782 + * purple_contact_get_priority_buddy recomputes it.
1.783 + *
1.784 + * @param contact The contact
1.785 + */
1.786 +void purple_contact_invalidate_priority_buddy(PurpleContact *contact);
1.787 +
1.788 +/**
1.789 + * Removes a buddy from the buddy list and frees the memory allocated to it.
1.790 + * This doesn't actually try to remove the buddy from the server list.
1.791 + *
1.792 + * @param buddy The buddy to be removed
1.793 + *
1.794 + * @see purple_account_remove_buddy
1.795 + */
1.796 +void purple_blist_remove_buddy(PurpleBuddy *buddy);
1.797 +
1.798 +/**
1.799 + * Removes a contact, and any buddies it contains, and frees the memory
1.800 + * allocated to it. This calls purple_blist_remove_buddy and therefore
1.801 + * doesn't remove the buddies from the server list.
1.802 + *
1.803 + * @param contact The contact to be removed
1.804 + *
1.805 + * @see purple_blist_remove_buddy
1.806 + */
1.807 +void purple_blist_remove_contact(PurpleContact *contact);
1.808 +
1.809 +/**
1.810 + * Removes a chat from the buddy list and frees the memory allocated to it.
1.811 + *
1.812 + * @param chat The chat to be removed
1.813 + */
1.814 +void purple_blist_remove_chat(PurpleChat *chat);
1.815 +
1.816 +/**
1.817 + * Removes a group from the buddy list and frees the memory allocated to it and to
1.818 + * its children
1.819 + *
1.820 + * @param group The group to be removed
1.821 + */
1.822 +void purple_blist_remove_group(PurpleGroup *group);
1.823 +
1.824 +/**
1.825 + * Returns the alias of a buddy.
1.826 + *
1.827 + * @param buddy The buddy whose name will be returned.
1.828 + * @return The alias (if set), server alias (if set),
1.829 + * or NULL.
1.830 + */
1.831 +const char *purple_buddy_get_alias_only(PurpleBuddy *buddy);
1.832 +
1.833 +/**
1.834 + * Gets the server alias for a buddy.
1.835 + *
1.836 + * @param buddy The buddy whose name will be returned
1.837 + * @return The server alias, or NULL if it is not set.
1.838 + */
1.839 +const char *purple_buddy_get_server_alias(PurpleBuddy *buddy);
1.840 +
1.841 +/**
1.842 + * Returns the correct name to display for a buddy, taking the contact alias
1.843 + * into account. In order of precedence: the buddy's alias; the buddy's
1.844 + * contact alias; the buddy's server alias; the buddy's user name.
1.845 + *
1.846 + * @param buddy The buddy whose name will be returned
1.847 + * @return The appropriate name or alias, or NULL.
1.848 + *
1.849 + */
1.850 +const char *purple_buddy_get_contact_alias(PurpleBuddy *buddy);
1.851 +
1.852 +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
1.853 +/**
1.854 + * Returns the correct alias for this user, ignoring server aliases. Used
1.855 + * when a user-recognizable name is required. In order: buddy's alias; buddy's
1.856 + * contact alias; buddy's user name.
1.857 + *
1.858 + * @param buddy The buddy whose alias will be returned.
1.859 + * @return The appropriate name or alias.
1.860 + * @deprecated Try purple_buddy_get_alias(), if server aliases are okay.
1.861 + */
1.862 +const char *purple_buddy_get_local_alias(PurpleBuddy *buddy);
1.863 +#endif
1.864 +
1.865 +/**
1.866 + * Returns the correct name to display for a buddy. In order of precedence:
1.867 + * the buddy's alias; the buddy's server alias; the buddy's contact alias;
1.868 + * the buddy's user name.
1.869 + *
1.870 + * @param buddy The buddy whose name will be returned.
1.871 + * @return The appropriate name or alias, or NULL
1.872 + */
1.873 +const char *purple_buddy_get_alias(PurpleBuddy *buddy);
1.874 +
1.875 +/**
1.876 + * Returns the local alias for the buddy, or @c NULL if none exists.
1.877 + *
1.878 + * @param buddy The buddy
1.879 + * @return The local alias for the buddy
1.880 + *
1.881 + * @since 2.6.0
1.882 + */
1.883 +const char *purple_buddy_get_local_buddy_alias(PurpleBuddy *buddy);
1.884 +
1.885 +/**
1.886 + * Returns the correct name to display for a blist chat.
1.887 + *
1.888 + * @param chat The chat whose name will be returned.
1.889 + * @return The alias (if set), or first component value.
1.890 + */
1.891 +const char *purple_chat_get_name(PurpleChat *chat);
1.892 +
1.893 +/**
1.894 + * Finds the buddy struct given a name and an account
1.895 + *
1.896 + * @param account The account this buddy belongs to
1.897 + * @param name The buddy's name
1.898 + * @return The buddy or NULL if the buddy does not exist
1.899 + */
1.900 +PurpleBuddy *purple_find_buddy(PurpleAccount *account, const char *name);
1.901 +
1.902 +/**
1.903 + * Finds the buddy struct given a name, an account, and a group
1.904 + *
1.905 + * @param account The account this buddy belongs to
1.906 + * @param name The buddy's name
1.907 + * @param group The group to look in
1.908 + * @return The buddy or NULL if the buddy does not exist in the group
1.909 + */
1.910 +PurpleBuddy *purple_find_buddy_in_group(PurpleAccount *account, const char *name,
1.911 + PurpleGroup *group);
1.912 +
1.913 +/**
1.914 + * Finds all PurpleBuddy structs given a name and an account
1.915 + *
1.916 + * @param account The account this buddy belongs to
1.917 + * @param name The buddy's name (or NULL to return all buddies for the account)
1.918 + *
1.919 + * @return A GSList of buddies (which must be freed), or NULL if the buddy doesn't exist
1.920 + */
1.921 +GSList *purple_find_buddies(PurpleAccount *account, const char *name);
1.922 +
1.923 +
1.924 +/**
1.925 + * Finds a group by name
1.926 + *
1.927 + * @param name The group's name
1.928 + * @return The group or NULL if the group does not exist
1.929 + */
1.930 +PurpleGroup *purple_find_group(const char *name);
1.931 +
1.932 +/**
1.933 + * Finds a chat by name.
1.934 + *
1.935 + * @param account The chat's account.
1.936 + * @param name The chat's name.
1.937 + *
1.938 + * @return The chat, or @c NULL if the chat does not exist.
1.939 + */
1.940 +PurpleChat *purple_blist_find_chat(PurpleAccount *account, const char *name);
1.941 +
1.942 +/**
1.943 + * Returns the group of which the chat is a member.
1.944 + *
1.945 + * @param chat The chat.
1.946 + *
1.947 + * @return The parent group, or @c NULL if the chat is not in a group.
1.948 + */
1.949 +PurpleGroup *purple_chat_get_group(PurpleChat *chat);
1.950 +
1.951 +/**
1.952 + * Returns the account the chat belongs to.
1.953 + *
1.954 + * @param chat The chat.
1.955 + *
1.956 + * @return The account the chat belongs to.
1.957 + *
1.958 + * @since 2.4.0
1.959 + */
1.960 +PurpleAccount *purple_chat_get_account(PurpleChat *chat);
1.961 +
1.962 +/**
1.963 + * Get a hashtable containing information about a chat.
1.964 + *
1.965 + * @param chat The chat.
1.966 + *
1.967 + * @constreturn The hashtable.
1.968 + *
1.969 + * @since 2.4.0
1.970 + */
1.971 +GHashTable *purple_chat_get_components(PurpleChat *chat);
1.972 +
1.973 +/**
1.974 + * Returns the group of which the buddy is a member.
1.975 + *
1.976 + * @param buddy The buddy
1.977 + * @return The group or NULL if the buddy is not in a group
1.978 + */
1.979 +PurpleGroup *purple_buddy_get_group(PurpleBuddy *buddy);
1.980 +
1.981 +
1.982 +/**
1.983 + * Returns a list of accounts that have buddies in this group
1.984 + *
1.985 + * @param g The group
1.986 + *
1.987 + * @return A GSList of accounts (which must be freed), or NULL if the group
1.988 + * has no accounts.
1.989 + */
1.990 +GSList *purple_group_get_accounts(PurpleGroup *g);
1.991 +
1.992 +/**
1.993 + * Determines whether an account owns any buddies in a given group
1.994 + *
1.995 + * @param g The group to search through.
1.996 + * @param account The account.
1.997 + *
1.998 + * @return TRUE if there are any buddies in the group, or FALSE otherwise.
1.999 + */
1.1000 +gboolean purple_group_on_account(PurpleGroup *g, PurpleAccount *account);
1.1001 +
1.1002 +/**
1.1003 + * Returns the name of a group.
1.1004 + *
1.1005 + * @param group The group.
1.1006 + *
1.1007 + * @return The name of the group.
1.1008 + */
1.1009 +const char *purple_group_get_name(PurpleGroup *group);
1.1010 +
1.1011 +/**
1.1012 + * Called when an account connects. Tells the UI to update all the
1.1013 + * buddies.
1.1014 + *
1.1015 + * @param account The account
1.1016 + */
1.1017 +void purple_blist_add_account(PurpleAccount *account);
1.1018 +
1.1019 +
1.1020 +/**
1.1021 + * Called when an account disconnects. Sets the presence of all the buddies to 0
1.1022 + * and tells the UI to update them.
1.1023 + *
1.1024 + * @param account The account
1.1025 + */
1.1026 +void purple_blist_remove_account(PurpleAccount *account);
1.1027 +
1.1028 +
1.1029 +/**
1.1030 + * Determines the total size of a group
1.1031 + *
1.1032 + * @param group The group
1.1033 + * @param offline Count buddies in offline accounts
1.1034 + * @return The number of buddies in the group
1.1035 + */
1.1036 +int purple_blist_get_group_size(PurpleGroup *group, gboolean offline);
1.1037 +
1.1038 +/**
1.1039 + * Determines the number of online buddies in a group
1.1040 + *
1.1041 + * @param group The group
1.1042 + * @return The number of online buddies in the group, or 0 if the group is NULL
1.1043 + */
1.1044 +int purple_blist_get_group_online_count(PurpleGroup *group);
1.1045 +
1.1046 +/*@}*/
1.1047 +
1.1048 +/****************************************************************************************/
1.1049 +/** @name Buddy list file management API */
1.1050 +/****************************************************************************************/
1.1051 +
1.1052 +/**
1.1053 + * Loads the buddy list from ~/.purple/blist.xml.
1.1054 + */
1.1055 +void purple_blist_load(void);
1.1056 +
1.1057 +/**
1.1058 + * Schedule a save of the blist.xml file. This is used by the privacy
1.1059 + * API whenever the privacy settings are changed. If you make a change
1.1060 + * to blist.xml using one of the functions in the buddy list API, then
1.1061 + * the buddy list is saved automatically, so you should not need to
1.1062 + * call this.
1.1063 + */
1.1064 +void purple_blist_schedule_save(void);
1.1065 +
1.1066 +/**
1.1067 + * Requests from the user information needed to add a buddy to the
1.1068 + * buddy list.
1.1069 + *
1.1070 + * @param account The account the buddy is added to.
1.1071 + * @param username The username of the buddy.
1.1072 + * @param group The name of the group to place the buddy in.
1.1073 + * @param alias The optional alias for the buddy.
1.1074 + */
1.1075 +void purple_blist_request_add_buddy(PurpleAccount *account, const char *username,
1.1076 + const char *group, const char *alias);
1.1077 +
1.1078 +/**
1.1079 + * Requests from the user information needed to add a chat to the
1.1080 + * buddy list.
1.1081 + *
1.1082 + * @param account The account the buddy is added to.
1.1083 + * @param group The optional group to add the chat to.
1.1084 + * @param alias The optional alias for the chat.
1.1085 + * @param name The required chat name.
1.1086 + */
1.1087 +void purple_blist_request_add_chat(PurpleAccount *account, PurpleGroup *group,
1.1088 + const char *alias, const char *name);
1.1089 +
1.1090 +/**
1.1091 + * Requests from the user information needed to add a group to the
1.1092 + * buddy list.
1.1093 + */
1.1094 +void purple_blist_request_add_group(void);
1.1095 +
1.1096 +/**
1.1097 + * Associates a boolean with a node in the buddy list
1.1098 + *
1.1099 + * @param node The node to associate the data with
1.1100 + * @param key The identifier for the data
1.1101 + * @param value The value to set
1.1102 + */
1.1103 +void purple_blist_node_set_bool(PurpleBlistNode *node, const char *key, gboolean value);
1.1104 +
1.1105 +/**
1.1106 + * Retrieves a named boolean setting from a node in the buddy list
1.1107 + *
1.1108 + * @param node The node to retrieve the data from
1.1109 + * @param key The identifier of the data
1.1110 + *
1.1111 + * @return The value, or FALSE if there is no setting
1.1112 + */
1.1113 +gboolean purple_blist_node_get_bool(PurpleBlistNode *node, const char *key);
1.1114 +
1.1115 +/**
1.1116 + * Associates an integer with a node in the buddy list
1.1117 + *
1.1118 + * @param node The node to associate the data with
1.1119 + * @param key The identifier for the data
1.1120 + * @param value The value to set
1.1121 + */
1.1122 +void purple_blist_node_set_int(PurpleBlistNode *node, const char *key, int value);
1.1123 +
1.1124 +/**
1.1125 + * Retrieves a named integer setting from a node in the buddy list
1.1126 + *
1.1127 + * @param node The node to retrieve the data from
1.1128 + * @param key The identifier of the data
1.1129 + *
1.1130 + * @return The value, or 0 if there is no setting
1.1131 + */
1.1132 +int purple_blist_node_get_int(PurpleBlistNode *node, const char *key);
1.1133 +
1.1134 +/**
1.1135 + * Associates a string with a node in the buddy list
1.1136 + *
1.1137 + * @param node The node to associate the data with
1.1138 + * @param key The identifier for the data
1.1139 + * @param value The value to set
1.1140 + */
1.1141 +void purple_blist_node_set_string(PurpleBlistNode *node, const char *key,
1.1142 + const char *value);
1.1143 +
1.1144 +/**
1.1145 + * Retrieves a named string setting from a node in the buddy list
1.1146 + *
1.1147 + * @param node The node to retrieve the data from
1.1148 + * @param key The identifier of the data
1.1149 + *
1.1150 + * @return The value, or NULL if there is no setting
1.1151 + */
1.1152 +const char *purple_blist_node_get_string(PurpleBlistNode *node, const char *key);
1.1153 +
1.1154 +/**
1.1155 + * Removes a named setting from a blist node
1.1156 + *
1.1157 + * @param node The node from which to remove the setting
1.1158 + * @param key The name of the setting
1.1159 + */
1.1160 +void purple_blist_node_remove_setting(PurpleBlistNode *node, const char *key);
1.1161 +
1.1162 +/**
1.1163 + * Set the flags for the given node. Setting a node's flags will overwrite
1.1164 + * the old flags, so if you want to save them, you must first call
1.1165 + * purple_blist_node_get_flags and modify that appropriately.
1.1166 + *
1.1167 + * @param node The node on which to set the flags.
1.1168 + * @param flags The flags to set. This is a bitmask.
1.1169 + */
1.1170 +void purple_blist_node_set_flags(PurpleBlistNode *node, PurpleBlistNodeFlags flags);
1.1171 +
1.1172 +/**
1.1173 + * Get the current flags on a given node.
1.1174 + *
1.1175 + * @param node The node from which to get the flags.
1.1176 + *
1.1177 + * @return The flags on the node. This is a bitmask.
1.1178 + */
1.1179 +PurpleBlistNodeFlags purple_blist_node_get_flags(PurpleBlistNode *node);
1.1180 +
1.1181 +/**
1.1182 + * Get the type of a given node.
1.1183 + *
1.1184 + * @param node The node.
1.1185 + *
1.1186 + * @return The type of the node.
1.1187 + *
1.1188 + * @since 2.1.0
1.1189 + */
1.1190 +PurpleBlistNodeType purple_blist_node_get_type(PurpleBlistNode *node);
1.1191 +
1.1192 +/*@}*/
1.1193 +
1.1194 +/**
1.1195 + * Retrieves the extended menu items for a buddy list node.
1.1196 + * @param n The blist node for which to obtain the extended menu items.
1.1197 + * @return A list of PurpleMenuAction items, as harvested by the
1.1198 + * blist-node-extended-menu signal.
1.1199 + */
1.1200 +GList *purple_blist_node_get_extended_menu(PurpleBlistNode *n);
1.1201 +
1.1202 +/**************************************************************************/
1.1203 +/** @name UI Registration Functions */
1.1204 +/**************************************************************************/
1.1205 +/*@{*/
1.1206 +
1.1207 +/**
1.1208 + * Sets the UI operations structure to be used for the buddy list.
1.1209 + *
1.1210 + * @param ops The ops struct.
1.1211 + */
1.1212 +void purple_blist_set_ui_ops(PurpleBlistUiOps *ops);
1.1213 +
1.1214 +/**
1.1215 + * Returns the UI operations structure to be used for the buddy list.
1.1216 + *
1.1217 + * @return The UI operations structure.
1.1218 + */
1.1219 +PurpleBlistUiOps *purple_blist_get_ui_ops(void);
1.1220 +
1.1221 +/*@}*/
1.1222 +
1.1223 +/**************************************************************************/
1.1224 +/** @name Buddy List Subsystem */
1.1225 +/**************************************************************************/
1.1226 +/*@{*/
1.1227 +
1.1228 +/**
1.1229 + * Returns the handle for the buddy list subsystem.
1.1230 + *
1.1231 + * @return The buddy list subsystem handle.
1.1232 + */
1.1233 +void *purple_blist_get_handle(void);
1.1234 +
1.1235 +/**
1.1236 + * Initializes the buddy list subsystem.
1.1237 + */
1.1238 +void purple_blist_init(void);
1.1239 +
1.1240 +/**
1.1241 + * Uninitializes the buddy list subsystem.
1.1242 + */
1.1243 +void purple_blist_uninit(void);
1.1244 +
1.1245 +/*@}*/
1.1246 +
1.1247 +#ifdef __cplusplus
1.1248 +}
1.1249 +#endif
1.1250 +
1.1251 +#endif /* _PURPLE_BLIST_H_ */