blist.h
Go to the documentation of this file.
1
7 /* purple
8 *
9 * Purple is the legal property of its developers, whose names are too numerous
10 * to list here. Please refer to the COPYRIGHT file distributed with this
11 * source distribution.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26 */
27 #ifndef _PURPLE_BLIST_H_
28 #define _PURPLE_BLIST_H_
29
30 /* I can't believe I let ChipX86 inspire me to write good code. -Sean */
31
32 #include <glib.h>
33
35 typedef struct _PurpleBuddyList PurpleBuddyList;
37 typedef struct _PurpleBlistUiOps PurpleBlistUiOps;
39 typedef struct _PurpleBlistNode PurpleBlistNode;
40
42 typedef struct _PurpleChat PurpleChat;
44 typedef struct _PurpleGroup PurpleGroup;
46 typedef struct _PurpleContact PurpleContact;
48 typedef struct _PurpleBuddy PurpleBuddy;
49
50 /**************************************************************************/
51 /* Enumerations */
52 /**************************************************************************/
53 typedef enum
54 {
55 PURPLE_BLIST_GROUP_NODE,
56 PURPLE_BLIST_CONTACT_NODE,
57 PURPLE_BLIST_BUDDY_NODE,
58 PURPLE_BLIST_CHAT_NODE,
59 PURPLE_BLIST_OTHER_NODE
60
61 } PurpleBlistNodeType;
62
63 #define PURPLE_BLIST_NODE_IS_CHAT(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CHAT_NODE)
64 #define PURPLE_BLIST_NODE_IS_BUDDY(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_BUDDY_NODE)
65 #define PURPLE_BLIST_NODE_IS_CONTACT(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CONTACT_NODE)
66 #define PURPLE_BLIST_NODE_IS_GROUP(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_GROUP_NODE)
67
68 #define PURPLE_BUDDY_IS_ONLINE(b) \
69 ((b) != NULL && purple_account_is_connected(purple_buddy_get_account(b)) && \
70 purple_presence_is_online(purple_buddy_get_presence(b)))
71
72 typedef enum
73 {
74 PURPLE_BLIST_NODE_FLAG_NO_SAVE = 1 << 0
76 } PurpleBlistNodeFlags;
77
81 #define PURPLE_BLIST_NODE(obj) ((PurpleBlistNode *)(obj))
82
83 #define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (purple_blist_node_get_flags((PurpleBlistNode*)(b)) & (f))
84 #define PURPLE_BLIST_NODE_SHOULD_SAVE(b) (! PURPLE_BLIST_NODE_HAS_FLAG(b, PURPLE_BLIST_NODE_FLAG_NO_SAVE))
85
86 #define PURPLE_BLIST_NODE_NAME(n) (purple_blist_node_get_type(n) == PURPLE_BLIST_CHAT_NODE ? purple_chat_get_name((PurpleChat*)n) : \
87 purple_blist_node_get_type(n) == PURPLE_BLIST_BUDDY_NODE ? purple_buddy_get_name((PurpleBuddy*)n) : NULL)
88
92 #define PURPLE_GROUP(obj) ((PurpleGroup *)(obj))
93
97 #define PURPLE_CONTACT(obj) ((PurpleContact *)(obj))
98
102 #define PURPLE_BUDDY(obj) ((PurpleBuddy *)(obj))
103
107 #define PURPLE_CHAT(obj) ((PurpleChat *)(obj))
108
109 #include "account.h"
110 #include "buddyicon.h"
111 #include "media.h"
112 #include "status.h"
113
114 /**************************************************************************/
115 /* Data Structures */
116 /**************************************************************************/
117
118 #if !(defined PURPLE_HIDE_STRUCTS) || (defined _PURPLE_BLIST_C_)
119
124 struct _PurpleBlistNode {
125 PurpleBlistNodeType type;
126 PurpleBlistNode *prev;
127 PurpleBlistNode *next;
128 PurpleBlistNode *parent;
129 PurpleBlistNode *child;
130 GHashTable *settings;
131 void *ui_data;
132 PurpleBlistNodeFlags flags;
133 };
134
138 struct _PurpleBuddy {
139 PurpleBlistNode node;
140 char *name;
141 char *alias;
142 char *server_alias;
143 void *proto_data;
144 PurpleBuddyIcon *icon;
145 PurpleAccount *account;
146 PurplePresence *presence;
147 PurpleMediaCaps media_caps;
148 };
149
153 struct _PurpleContact {
154 PurpleBlistNode node;
155 char *alias;
156 int totalsize;
157 int currentsize;
158 int online;
159 PurpleBuddy *priority;
160 gboolean priority_valid;
161 };
162
163
167 struct _PurpleGroup {
168 PurpleBlistNode node;
169 char *name;
170 int totalsize;
171 int currentsize;
172 int online;
173 };
174
179 struct _PurpleChat {
180 PurpleBlistNode node;
181 char *alias;
182 GHashTable *components;
183 PurpleAccount *account;
184 };
185
189 struct _PurpleBuddyList {
190 PurpleBlistNode *root;
191 GHashTable *buddies;
192 void *ui_data;
193 };
194
195 #endif /* PURPLE_HIDE_STRUCTS && PURPLE_BLIST_STRUCTS */
196
203 struct _PurpleBlistUiOps
204 {
205 void (*new_list)(PurpleBuddyList *list);
206 void (*new_node)(PurpleBlistNode *node);
207 void (*show)(PurpleBuddyList *list);
208 void (*update)(PurpleBuddyList *list,
209 PurpleBlistNode *node);
210 void (*remove)(PurpleBuddyList *list,
211 PurpleBlistNode *node);
212 void (*destroy)(PurpleBuddyList *list);
213 void (*set_visible)(PurpleBuddyList *list,
214 gboolean show);
215 void (*request_add_buddy)(PurpleAccount *account, const char *username,
216 const char *group, const char *alias);
217 void (*request_add_chat)(PurpleAccount *account, PurpleGroup *group,
218 const char *alias, const char *name);
219 void (*request_add_group)(void);
220
232 void (*save_node)(PurpleBlistNode *node);
233
246 void (*remove_node)(PurpleBlistNode *node);
247
261 void (*save_account)(PurpleAccount *account);
262
263 void (*_purple_reserved1)(void);
264 };
265
266 #ifdef __cplusplus
267 extern "C" {
268 #endif
269
270 /**************************************************************************/
272 /**************************************************************************/
281 PurpleBuddyList *purple_blist_new(void);
282
289 void purple_set_blist(PurpleBuddyList *blist);
290
296 PurpleBuddyList *purple_get_blist(void);
297
303 PurpleBlistNode *purple_blist_get_root(void);
304
316 GSList *purple_blist_get_buddies(void);
317
325 gpointer purple_blist_get_ui_data(void);
326
334 void purple_blist_set_ui_data(gpointer ui_data);
335
348 PurpleBlistNode *purple_blist_node_next(PurpleBlistNode *node, gboolean offline);
349
361 PurpleBlistNode *purple_blist_node_get_parent(PurpleBlistNode *node);
362
374 PurpleBlistNode *purple_blist_node_get_first_child(PurpleBlistNode *node);
375
387 PurpleBlistNode *purple_blist_node_get_sibling_next(PurpleBlistNode *node);
388
400 PurpleBlistNode *purple_blist_node_get_sibling_prev(PurpleBlistNode *node);
401
409 gpointer purple_blist_node_get_ui_data(const PurpleBlistNode *node);
410
419 void purple_blist_node_set_ui_data(PurpleBlistNode *node, gpointer ui_data);
420
424 void purple_blist_show(void);
425
426
434 void purple_blist_destroy(void);
435
441 void purple_blist_set_visible(gboolean show);
442
451 void purple_blist_update_buddy_status(PurpleBuddy *buddy, PurpleStatus *old_status);
452
460 void purple_blist_update_node_icon(PurpleBlistNode *node);
461
462 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
463
469 void purple_blist_update_buddy_icon(PurpleBuddy *buddy);
470 #endif
471
478 void purple_blist_rename_buddy(PurpleBuddy *buddy, const char *name);
479
486 void purple_blist_alias_contact(PurpleContact *contact, const char *alias);
487
494 void purple_blist_alias_buddy(PurpleBuddy *buddy, const char *alias);
495
503 void purple_blist_server_alias_buddy(PurpleBuddy *buddy, const char *alias);
504
511 void purple_blist_alias_chat(PurpleChat *chat, const char *alias);
512
519 void purple_blist_rename_group(PurpleGroup *group, const char *name);
520
531 PurpleChat *purple_chat_new(PurpleAccount *account, const char *alias, GHashTable *components);
532
538 void purple_chat_destroy(PurpleChat *chat);
539
551 void purple_blist_add_chat(PurpleChat *chat, PurpleGroup *group, PurpleBlistNode *node);
552
568 PurpleBuddy *purple_buddy_new(PurpleAccount *account, const char *name, const char *alias);
569
575 void purple_buddy_destroy(PurpleBuddy *buddy);
576
588 void purple_buddy_set_icon(PurpleBuddy *buddy, PurpleBuddyIcon *icon);
589
597 PurpleAccount *purple_buddy_get_account(const PurpleBuddy *buddy);
598
606 const char *purple_buddy_get_name(const PurpleBuddy *buddy);
607
615 PurpleBuddyIcon *purple_buddy_get_icon(const PurpleBuddy *buddy);
616
628 gpointer purple_buddy_get_protocol_data(const PurpleBuddy *buddy);
629
641 void purple_buddy_set_protocol_data(PurpleBuddy *buddy, gpointer data);
642
650 PurpleContact *purple_buddy_get_contact(PurpleBuddy *buddy);
651
659 PurplePresence *purple_buddy_get_presence(const PurpleBuddy *buddy);
660
669 PurpleMediaCaps purple_buddy_get_media_caps(const PurpleBuddy *buddy);
670
677 void purple_buddy_set_media_caps(PurpleBuddy *buddy, PurpleMediaCaps media_caps);
678
692 void purple_blist_add_buddy(PurpleBuddy *buddy, PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node);
693
703 PurpleGroup *purple_group_new(const char *name);
704
710 void purple_group_destroy(PurpleGroup *group);
711
721 void purple_blist_add_group(PurpleGroup *group, PurpleBlistNode *node);
722
728 PurpleContact *purple_contact_new(void);
729
735 void purple_contact_destroy(PurpleContact *contact);
736
745 PurpleGroup *purple_contact_get_group(const PurpleContact *contact);
746
757 void purple_blist_add_contact(PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node);
758
767 void purple_blist_merge_contact(PurpleContact *source, PurpleBlistNode *node);
768
775 PurpleBuddy *purple_contact_get_priority_buddy(PurpleContact *contact);
776
777 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
778
786 void purple_contact_set_alias(PurpleContact *contact, const char *alias);
787 #endif
788
795 const char *purple_contact_get_alias(PurpleContact *contact);
796
805 gboolean purple_contact_on_account(PurpleContact *contact, PurpleAccount *account);
806
813 void purple_contact_invalidate_priority_buddy(PurpleContact *contact);
814
823 void purple_blist_remove_buddy(PurpleBuddy *buddy);
824
834 void purple_blist_remove_contact(PurpleContact *contact);
835
841 void purple_blist_remove_chat(PurpleChat *chat);
842
849 void purple_blist_remove_group(PurpleGroup *group);
850
858 const char *purple_buddy_get_alias_only(PurpleBuddy *buddy);
859
866 const char *purple_buddy_get_server_alias(PurpleBuddy *buddy);
867
877 const char *purple_buddy_get_contact_alias(PurpleBuddy *buddy);
878
879 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
880
889 const char *purple_buddy_get_local_alias(PurpleBuddy *buddy);
890 #endif
891
900 const char *purple_buddy_get_alias(PurpleBuddy *buddy);
901
910 const char *purple_buddy_get_local_buddy_alias(PurpleBuddy *buddy);
911
918 const char *purple_chat_get_name(PurpleChat *chat);
919
927 PurpleBuddy *purple_find_buddy(PurpleAccount *account, const char *name);
928
937 PurpleBuddy *purple_find_buddy_in_group(PurpleAccount *account, const char *name,
938 PurpleGroup *group);
939
948 GSList *purple_find_buddies(PurpleAccount *account, const char *name);
949
950
957 PurpleGroup *purple_find_group(const char *name);
958
967 PurpleChat *purple_blist_find_chat(PurpleAccount *account, const char *name);
968
976 PurpleGroup *purple_chat_get_group(PurpleChat *chat);
977
987 PurpleAccount *purple_chat_get_account(PurpleChat *chat);
988
998 GHashTable *purple_chat_get_components(PurpleChat *chat);
999
1006 PurpleGroup *purple_buddy_get_group(PurpleBuddy *buddy);
1007
1008
1017 GSList *purple_group_get_accounts(PurpleGroup *g);
1018
1027 gboolean purple_group_on_account(PurpleGroup *g, PurpleAccount *account);
1028
1036 const char *purple_group_get_name(PurpleGroup *group);
1037
1044 void purple_blist_add_account(PurpleAccount *account);
1045
1046
1053 void purple_blist_remove_account(PurpleAccount *account);
1054
1055
1063 int purple_blist_get_group_size(PurpleGroup *group, gboolean offline);
1064
1071 int purple_blist_get_group_online_count(PurpleGroup *group);
1072
1075 /****************************************************************************************/
1077 /****************************************************************************************/
1078
1082 void purple_blist_load(void);
1083
1091 void purple_blist_schedule_save(void);
1092
1102 void purple_blist_request_add_buddy(PurpleAccount *account, const char *username,
1103 const char *group, const char *alias);
1104
1114 void purple_blist_request_add_chat(PurpleAccount *account, PurpleGroup *group,
1115 const char *alias, const char *name);
1116
1121 void purple_blist_request_add_group(void);
1122
1130 void purple_blist_node_set_bool(PurpleBlistNode *node, const char *key, gboolean value);
1131
1140 gboolean purple_blist_node_get_bool(PurpleBlistNode *node, const char *key);
1141
1149 void purple_blist_node_set_int(PurpleBlistNode *node, const char *key, int value);
1150
1159 int purple_blist_node_get_int(PurpleBlistNode *node, const char *key);
1160
1168 void purple_blist_node_set_string(PurpleBlistNode *node, const char *key,
1169 const char *value);
1170
1179 const char *purple_blist_node_get_string(PurpleBlistNode *node, const char *key);
1180
1187 void purple_blist_node_remove_setting(PurpleBlistNode *node, const char *key);
1188
1197 void purple_blist_node_set_flags(PurpleBlistNode *node, PurpleBlistNodeFlags flags);
1198
1206 PurpleBlistNodeFlags purple_blist_node_get_flags(PurpleBlistNode *node);
1207
1217 PurpleBlistNodeType purple_blist_node_get_type(PurpleBlistNode *node);
1218
1227 GList *purple_blist_node_get_extended_menu(PurpleBlistNode *n);
1228
1229 /**************************************************************************/
1231 /**************************************************************************/
1239 void purple_blist_set_ui_ops(PurpleBlistUiOps *ops);
1240
1246 PurpleBlistUiOps *purple_blist_get_ui_ops(void);
1247
1250 /**************************************************************************/
1252 /**************************************************************************/
1260 void *purple_blist_get_handle(void);
1261
1265 void purple_blist_init(void);
1266
1270 void purple_blist_uninit(void);
1271
1274 #ifdef __cplusplus
1275 }
1276 #endif
1277
1278 #endif /* _PURPLE_BLIST_H_ */
purple_blist_remove_group
void purple_blist_remove_group(PurpleGroup *group)
Removes a group from the buddy list and frees the memory allocated to it and to its children...
purple_contact_on_account
gboolean purple_contact_on_account(PurpleContact *contact, PurpleAccount *account)
Determines whether an account owns any buddies in a given contact.
purple_group_get_accounts
GSList * purple_group_get_accounts(PurpleGroup *g)
Returns a list of accounts that have buddies in this group.
_PurpleGroup
A group.
Definition: blist.h:167
purple_blist_node_next
PurpleBlistNode * purple_blist_node_next(PurpleBlistNode *node, gboolean offline)
Returns the next node of a given node.
purple_blist_remove_account
void purple_blist_remove_account(PurpleAccount *account)
Called when an account disconnects.
purple_blist_merge_contact
void purple_blist_merge_contact(PurpleContact *source, PurpleBlistNode *node)
Merges two contacts.
purple_blist_schedule_save
void purple_blist_schedule_save(void)
Schedule a save of the blist.xml file.
purple_blist_request_add_chat
void purple_blist_request_add_chat(PurpleAccount *account, PurpleGroup *group, const char *alias, const char *name)
Requests from the user information needed to add a chat to the buddy list.
purple_blist_update_buddy_icon
void purple_blist_update_buddy_icon(PurpleBuddy *buddy)
Updates a buddy&#39;s icon.
_PurpleBlistUiOps::save_node
void(* save_node)(PurpleBlistNode *node)
This is called when a node has been modified and should be saved.
Definition: blist.h:232
_PurpleBlistNode::next
PurpleBlistNode * next
The sibling after this buddy.
Definition: blist.h:127
purple_blist_add_contact
void purple_blist_add_contact(PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node)
Adds a new contact to the buddy list.
purple_blist_add_group
void purple_blist_add_group(PurpleGroup *group, PurpleBlistNode *node)
Adds a new group to the buddy list.
purple_buddy_get_media_caps
PurpleMediaCaps purple_buddy_get_media_caps(const PurpleBuddy *buddy)
Gets the media caps from a buddy.
purple_blist_node_get_flags
PurpleBlistNodeFlags purple_blist_node_get_flags(PurpleBlistNode *node)
Get the current flags on a given node.
_PurpleContact::priority
PurpleBuddy * priority
The "top" buddy for this contact.
Definition: blist.h:159
_PurpleBuddyList::ui_data
void * ui_data
UI-specific data.
Definition: blist.h:192
purple_blist_set_visible
void purple_blist_set_visible(gboolean show)
Hides or unhides the buddy list.
purple_blist_update_node_icon
void purple_blist_update_node_icon(PurpleBlistNode *node)
Updates a node&#39;s custom icon.
_PurpleBlistNode
A Buddy list node.
Definition: blist.h:124
_PurpleBlistNode::type
PurpleBlistNodeType type
The type of node this is.
Definition: blist.h:125
purple_chat_get_group
PurpleGroup * purple_chat_get_group(PurpleChat *chat)
Returns the group of which the chat is a member.
purple_buddy_get_protocol_data
gpointer purple_buddy_get_protocol_data(const PurpleBuddy *buddy)
Returns a buddy&#39;s protocol-specific data.
purple_buddy_set_protocol_data
void purple_buddy_set_protocol_data(PurpleBuddy *buddy, gpointer data)
Sets a buddy&#39;s protocol-specific data.
purple_blist_remove_chat
void purple_blist_remove_chat(PurpleChat *chat)
Removes a chat from the buddy list and frees the memory allocated to it.
purple_group_new
PurpleGroup * purple_group_new(const char *name)
Creates a new group.
purple_contact_invalidate_priority_buddy
void purple_contact_invalidate_priority_buddy(PurpleContact *contact)
Invalidates the priority buddy so that the next call to purple_contact_get_priority_buddy recomputes ...
purple_blist_get_group_size
int purple_blist_get_group_size(PurpleGroup *group, gboolean offline)
Determines the total size of a group.
purple_blist_remove_contact
void purple_blist_remove_contact(PurpleContact *contact)
Removes a contact, and any buddies it contains, and frees the memory allocated to it...
purple_buddy_get_contact
PurpleContact * purple_buddy_get_contact(PurpleBuddy *buddy)
Returns a buddy&#39;s contact.
purple_blist_add_buddy
void purple_blist_add_buddy(PurpleBuddy *buddy, PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node)
Adds a new buddy to the buddy list.
PurpleBuddyIcon
struct _PurpleBuddyIcon PurpleBuddyIcon
An opaque structure representing a buddy icon for a particular user on a particular PurpleAccount...
Definition: buddyicon.h:34
purple_blist_destroy
void purple_blist_destroy(void)
Destroys the buddy list window.
purple_buddy_new
PurpleBuddy * purple_buddy_new(PurpleAccount *account, const char *name, const char *alias)
Creates a new buddy.
_PurpleBuddy::icon
PurpleBuddyIcon * icon
The buddy icon.
Definition: blist.h:144
purple_blist_node_set_string
void purple_blist_node_set_string(PurpleBlistNode *node, const char *key, const char *value)
Associates a string with a node in the buddy list.
media.h
Media API.
purple_buddy_get_server_alias
const char * purple_buddy_get_server_alias(PurpleBuddy *buddy)
Gets the server alias for a buddy.
_PurpleContact::node
PurpleBlistNode node
The node that this contact inherits from.
Definition: blist.h:154
_PurpleBlistNode::prev
PurpleBlistNode * prev
The sibling before this buddy.
Definition: blist.h:126
PurpleBlistNodeFlags
PurpleBlistNodeFlags
Definition: blist.h:72
_PurpleChat::alias
char * alias
The display name of this chat.
Definition: blist.h:181
purple_find_buddy
PurpleBuddy * purple_find_buddy(PurpleAccount *account, const char *name)
Finds the buddy struct given a name and an account.
purple_blist_remove_buddy
void purple_blist_remove_buddy(PurpleBuddy *buddy)
Removes a buddy from the buddy list and frees the memory allocated to it.
purple_find_group
PurpleGroup * purple_find_group(const char *name)
Finds a group by name.
purple_blist_get_ui_data
gpointer purple_blist_get_ui_data(void)
Returns the UI data for the list.
purple_group_on_account
gboolean purple_group_on_account(PurpleGroup *g, PurpleAccount *account)
Determines whether an account owns any buddies in a given group.
_PurpleContact::totalsize
int totalsize
The number of buddies in this contact.
Definition: blist.h:156
purple_contact_new
PurpleContact * purple_contact_new(void)
Creates a new contact.
_PurpleBlistUiOps::new_node
void(* new_node)(PurpleBlistNode *node)
Sets UI-specific data on a node.
Definition: blist.h:206
_PurpleBlistUiOps::save_account
void(* save_account)(PurpleAccount *account)
Called to save all the data for an account.
Definition: blist.h:261
_PurpleContact::priority_valid
gboolean priority_valid
Is priority valid?
Definition: blist.h:160
purple_blist_node_set_flags
void purple_blist_node_set_flags(PurpleBlistNode *node, PurpleBlistNodeFlags flags)
Set the flags for the given node.
_PurpleBuddy::name
char * name
The name of the buddy.
Definition: blist.h:140
_PurpleBlistUiOps::destroy
void(* destroy)(PurpleBuddyList *list)
When the list is destroyed, this is called to destroy the UI.
Definition: blist.h:212
_PurpleAccount
Structure representing an account.
Definition: account.h:169
purple_blist_node_get_int
int purple_blist_node_get_int(PurpleBlistNode *node, const char *key)
Retrieves a named integer setting from a node in the buddy list.
_PurpleGroup::totalsize
int totalsize
The number of chats and contacts in this group.
Definition: blist.h:170
_PurpleGroup::name
char * name
The name of this group.
Definition: blist.h:169
purple_buddy_get_name
const char * purple_buddy_get_name(const PurpleBuddy *buddy)
Returns a buddy&#39;s name.
purple_group_destroy
void purple_group_destroy(PurpleGroup *group)
Destroys a group.
purple_find_buddy_in_group
PurpleBuddy * purple_find_buddy_in_group(PurpleAccount *account, const char *name, PurpleGroup *group)
Finds the buddy struct given a name, an account, and a group.
purple_blist_get_root
PurpleBlistNode * purple_blist_get_root(void)
Returns the root node of the main buddy list.
_PurpleBuddyList::buddies
GHashTable * buddies
Every buddy in this list.
Definition: blist.h:191
purple_blist_init
void purple_blist_init(void)
Initializes the buddy list subsystem.
_PurpleBlistUiOps::remove_node
void(* remove_node)(PurpleBlistNode *node)
Called when a node is about to be removed from the buddy list.
Definition: blist.h:246
purple_blist_add_account
void purple_blist_add_account(PurpleAccount *account)
Called when an account connects.
purple_blist_server_alias_buddy
void purple_blist_server_alias_buddy(PurpleBuddy *buddy, const char *alias)
Sets the server-sent alias of a buddy in the buddy list.
purple_buddy_destroy
void purple_buddy_destroy(PurpleBuddy *buddy)
Destroys a buddy.
purple_buddy_get_account
PurpleAccount * purple_buddy_get_account(const PurpleBuddy *buddy)
Returns a buddy&#39;s account.
purple_chat_new
PurpleChat * purple_chat_new(PurpleAccount *account, const char *alias, GHashTable *components)
Creates a new chat for the buddy list.
_PurpleBuddyList
The Buddy List.
Definition: blist.h:189
_PurpleContact
A contact.
Definition: blist.h:153
_PurpleGroup::currentsize
int currentsize
The number of chats and contacts in this group corresponding to online accounts.
Definition: blist.h:171
purple_chat_destroy
void purple_chat_destroy(PurpleChat *chat)
Destroys a chat.
purple_blist_alias_chat
void purple_blist_alias_chat(PurpleChat *chat, const char *alias)
Aliases a chat in the buddy list.
purple_blist_node_get_first_child
PurpleBlistNode * purple_blist_node_get_first_child(PurpleBlistNode *node)
Returns the the first child node of a given node.
purple_blist_get_group_online_count
int purple_blist_get_group_online_count(PurpleGroup *group)
Determines the number of online buddies in a group.
purple_blist_node_get_extended_menu
GList * purple_blist_node_get_extended_menu(PurpleBlistNode *n)
Retrieves the extended menu items for a buddy list node.
purple_contact_set_alias
void purple_contact_set_alias(PurpleContact *contact, const char *alias)
Sets the alias for a contact.
purple_blist_rename_group
void purple_blist_rename_group(PurpleGroup *group, const char *name)
Renames a group.
purple_get_blist
PurpleBuddyList * purple_get_blist(void)
Returns the main buddy list.
purple_contact_destroy
void purple_contact_destroy(PurpleContact *contact)
Destroys a contact.
purple_blist_node_set_int
void purple_blist_node_set_int(PurpleBlistNode *node, const char *key, int value)
Associates an integer with a node in the buddy list.
purple_buddy_get_alias
const char * purple_buddy_get_alias(PurpleBuddy *buddy)
Returns the correct name to display for a buddy.
purple_blist_get_handle
void * purple_blist_get_handle(void)
Returns the handle for the buddy list subsystem.
_PurpleChat::node
PurpleBlistNode node
The node that this chat inherits from.
Definition: blist.h:180
purple_buddy_get_local_buddy_alias
const char * purple_buddy_get_local_buddy_alias(PurpleBuddy *buddy)
Returns the local alias for the buddy, or NULL if none exists.
purple_blist_node_get_string
const char * purple_blist_node_get_string(PurpleBlistNode *node, const char *key)
Retrieves a named string setting from a node in the buddy list.
purple_blist_uninit
void purple_blist_uninit(void)
Uninitializes the buddy list subsystem.
purple_chat_get_name
const char * purple_chat_get_name(PurpleChat *chat)
Returns the correct name to display for a blist chat.
purple_blist_update_buddy_status
void purple_blist_update_buddy_status(PurpleBuddy *buddy, PurpleStatus *old_status)
Updates a buddy&#39;s status.
purple_buddy_set_media_caps
void purple_buddy_set_media_caps(PurpleBuddy *buddy, PurpleMediaCaps media_caps)
Sets the media caps for a buddy.
purple_set_blist
void purple_set_blist(PurpleBuddyList *blist)
Sets the main buddy list.
purple_blist_load
void purple_blist_load(void)
Loads the buddy list from ~/.purple/blist.xml.
purple_group_get_name
const char * purple_group_get_name(PurpleGroup *group)
Returns the name of a group.
_PurpleBlistUiOps::new_list
void(* new_list)(PurpleBuddyList *list)
Sets UI-specific data on a buddy list.
Definition: blist.h:205
purple_buddy_get_alias_only
const char * purple_buddy_get_alias_only(PurpleBuddy *buddy)
Returns the alias of a buddy.
_PurpleGroup::node
PurpleBlistNode node
The node that this group inherits from.
Definition: blist.h:168
purple_blist_get_ui_ops
PurpleBlistUiOps * purple_blist_get_ui_ops(void)
Returns the UI operations structure to be used for the buddy list.
purple_buddy_get_contact_alias
const char * purple_buddy_get_contact_alias(PurpleBuddy *buddy)
Returns the correct name to display for a buddy, taking the contact alias into account.
_PurpleBlistUiOps::show
void(* show)(PurpleBuddyList *list)
The core will call this when it&#39;s finished doing its core stuff.
Definition: blist.h:207
_PurpleChat
A chat.
Definition: blist.h:179
_PurpleChat::components
GHashTable * components
the stuff the protocol needs to know to join the chat
Definition: blist.h:182
account.h
Account API.
_PurpleBlistNode::settings
GHashTable * settings
per-node settings
Definition: blist.h:130
PURPLE_BLIST_NODE_FLAG_NO_SAVE
node should not be saved with the buddy list
Definition: blist.h:74
purple_blist_alias_contact
void purple_blist_alias_contact(PurpleContact *contact, const char *alias)
Aliases a contact in the buddy list.
_PurpleBlistUiOps
Buddy list UI operations.
Definition: blist.h:203
purple_buddy_get_presence
PurplePresence * purple_buddy_get_presence(const PurpleBuddy *buddy)
Returns a buddy&#39;s presence.
purple_blist_node_get_sibling_next
PurpleBlistNode * purple_blist_node_get_sibling_next(PurpleBlistNode *node)
Returns the sibling node of a given node.
purple_blist_add_chat
void purple_blist_add_chat(PurpleChat *chat, PurpleGroup *group, PurpleBlistNode *node)
Adds a new chat to the buddy list.
_PurpleBlistUiOps::update
void(* update)(PurpleBuddyList *list, PurpleBlistNode *node)
This will update a node in the buddy list.
Definition: blist.h:208
status.h
Status APIA brief explanation of the status API:
_PurpleBuddy::media_caps
PurpleMediaCaps media_caps
The media capabilities of the buddy.
Definition: blist.h:147
buddyicon.h
Buddy Icon API.
_PurpleChat::account
PurpleAccount * account
The account this chat is attached to.
Definition: blist.h:183
purple_blist_node_remove_setting
void purple_blist_node_remove_setting(PurpleBlistNode *node, const char *key)
Removes a named setting from a blist node.
purple_find_buddies
GSList * purple_find_buddies(PurpleAccount *account, const char *name)
Finds all PurpleBuddy structs given a name and an account.
_PurpleBuddyList::root
PurpleBlistNode * root
The first node in the buddy list.
Definition: blist.h:190
purple_blist_rename_buddy
void purple_blist_rename_buddy(PurpleBuddy *buddy, const char *name)
Renames a buddy in the buddy list.
purple_blist_node_set_bool
void purple_blist_node_set_bool(PurpleBlistNode *node, const char *key, gboolean value)
Associates a boolean with a node in the buddy list.
purple_blist_node_get_sibling_prev
PurpleBlistNode * purple_blist_node_get_sibling_prev(PurpleBlistNode *node)
Returns the previous sibling node of a given node.
purple_blist_node_get_ui_data
gpointer purple_blist_node_get_ui_data(const PurpleBlistNode *node)
Returns the UI data of a given node.
purple_chat_get_components
GHashTable * purple_chat_get_components(PurpleChat *chat)
Get a hashtable containing information about a chat.
_PurpleBuddy::proto_data
void * proto_data
This allows the prpl to associate whatever data it wants with a buddy.
Definition: blist.h:143
_PurpleBlistNode::flags
PurpleBlistNodeFlags flags
The buddy flags.
Definition: blist.h:132
_PurpleContact::currentsize
int currentsize
The number of buddies in this contact corresponding to online accounts.
Definition: blist.h:157
_PurpleBuddy::account
PurpleAccount * account
the account this buddy belongs to
Definition: blist.h:145
_PurpleBlistNode::ui_data
void * ui_data
The UI can put data here.
Definition: blist.h:131
purple_contact_get_group
PurpleGroup * purple_contact_get_group(const PurpleContact *contact)
Gets the PurpleGroup from a PurpleContact.
_PurpleBuddy
A buddy.
Definition: blist.h:138
_PurpleBuddy::server_alias
char * server_alias
The server-specified alias of the buddy.
Definition: blist.h:142
purple_contact_get_priority_buddy
PurpleBuddy * purple_contact_get_priority_buddy(PurpleContact *contact)
Returns the highest priority buddy for a given contact.
purple_blist_show
void purple_blist_show(void)
Shows the buddy list, creating a new one if necessary.
purple_blist_alias_buddy
void purple_blist_alias_buddy(PurpleBuddy *buddy, const char *alias)
Aliases a buddy in the buddy list.
purple_blist_find_chat
PurpleChat * purple_blist_find_chat(PurpleAccount *account, const char *name)
Finds a chat by name.
purple_blist_set_ui_ops
void purple_blist_set_ui_ops(PurpleBlistUiOps *ops)
Sets the UI operations structure to be used for the buddy list.
_PurpleContact::online
int online
The number of buddies in this contact who are currently online.
Definition: blist.h:158
_PurpleContact::alias
char * alias
The user-set alias of the contact.
Definition: blist.h:155
_PurpleBuddy::node
PurpleBlistNode node
The node that this buddy inherits from.
Definition: blist.h:139
purple_blist_request_add_buddy
void purple_blist_request_add_buddy(PurpleAccount *account, const char *username, const char *group, const char *alias)
Requests from the user information needed to add a buddy to the buddy list.
purple_blist_request_add_group
void purple_blist_request_add_group(void)
Requests from the user information needed to add a group to the buddy list.
purple_blist_node_get_type
PurpleBlistNodeType purple_blist_node_get_type(PurpleBlistNode *node)
Get the type of a given node.
_PurpleBuddy::alias
char * alias
The user-set alias of the buddy.
Definition: blist.h:141
purple_buddy_get_local_alias
const char * purple_buddy_get_local_alias(PurpleBuddy *buddy)
Returns the correct alias for this user, ignoring server aliases.
_PurpleGroup::online
int online
The number of chats and contacts in this group who are currently online.
Definition: blist.h:172
purple_blist_get_buddies
GSList * purple_blist_get_buddies(void)
Returns a list of every buddy in the list.
purple_buddy_set_icon
void purple_buddy_set_icon(PurpleBuddy *buddy, PurpleBuddyIcon *icon)
Sets a buddy&#39;s icon.
purple_blist_node_set_ui_data
void purple_blist_node_set_ui_data(PurpleBlistNode *node, gpointer ui_data)
Sets the UI data of a given node.
_PurpleBlistUiOps::set_visible
void(* set_visible)(PurpleBuddyList *list, gboolean show)
Hides or unhides the buddy list.
Definition: blist.h:213
purple_chat_get_account
PurpleAccount * purple_chat_get_account(PurpleChat *chat)
Returns the account the chat belongs to.
_PurpleBlistNode::child
PurpleBlistNode * child
The child of this node.
Definition: blist.h:129
purple_blist_node_get_bool
gboolean purple_blist_node_get_bool(PurpleBlistNode *node, const char *key)
Retrieves a named boolean setting from a node in the buddy list.
purple_blist_set_ui_data
void purple_blist_set_ui_data(gpointer ui_data)
Sets the UI data for the list.
purple_buddy_get_icon
PurpleBuddyIcon * purple_buddy_get_icon(const PurpleBuddy *buddy)
Returns a buddy&#39;s icon.
purple_blist_new
PurpleBuddyList * purple_blist_new(void)
Creates a new buddy list.
purple_contact_get_alias
const char * purple_contact_get_alias(PurpleContact *contact)
Gets the alias for a contact.
purple_buddy_get_group
PurpleGroup * purple_buddy_get_group(PurpleBuddy *buddy)
Returns the group of which the buddy is a member.
purple_blist_node_get_parent
PurpleBlistNode * purple_blist_node_get_parent(PurpleBlistNode *node)
Returns the parent node of a given node.
_PurpleBlistNode::parent
PurpleBlistNode * parent
The parent of this node.
Definition: blist.h:128