Sun, 11 Nov 2007 14:12:51 +0000
Explicitly cast from xmlChar (== unsigned char) to char, squishing a warning.
| 5228 | 1 | /** |
|
5497
da3c08f3af25
[gaim-migrate @ 5893]
Mark Doliner <markdoliner@pidgin.im>
parents:
5277
diff
changeset
|
2 | * @file blist.h Buddy List API |
| 5228 | 3 | * @ingroup core |
|
20889
3d0ef192f98c
All the links to libpurple signal pages were in the comment containing the
Will Thompson <resiak@pidgin.im>
parents:
20620
diff
changeset
|
4 | * @see @ref blist-signals |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
7 | /* purple |
| 5228 | 8 | * |
| 15884 | 9 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 10 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 11 | * source distribution. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
12 | * |
| 5228 | 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 | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18414
diff
changeset
|
25 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5228 | 26 | */ |
| 15884 | 27 | #ifndef _PURPLE_BLIST_H_ |
| 28 | #define _PURPLE_BLIST_H_ | |
| 5228 | 29 | |
| 30 | /* I can't believe I let ChipX86 inspire me to write good code. -Sean */ | |
| 31 | ||
| 32 | #include <glib.h> | |
| 33 | ||
| 15884 | 34 | typedef struct _PurpleBuddyList PurpleBuddyList; |
| 35 | typedef struct _PurpleBlistUiOps PurpleBlistUiOps; | |
| 36 | typedef struct _PurpleBlistNode PurpleBlistNode; | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
37 | |
| 15884 | 38 | typedef struct _PurpleChat PurpleChat; |
| 39 | typedef struct _PurpleGroup PurpleGroup; | |
| 40 | typedef struct _PurpleContact PurpleContact; | |
| 41 | typedef struct _PurpleBuddy PurpleBuddy; | |
|
5564
1779a1bfbdb8
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
42 | |
|
20817
79a95c8d9b2c
A request field for buddylist nodes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20620
diff
changeset
|
43 | typedef gboolean (*PurpleFilterBlistFunc)(PurpleBlistNode *node); |
|
79a95c8d9b2c
A request field for buddylist nodes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20620
diff
changeset
|
44 | |
| 5228 | 45 | /**************************************************************************/ |
| 46 | /* Enumerations */ | |
| 47 | /**************************************************************************/ | |
|
7098
22eabd4f5ed4
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7060
diff
changeset
|
48 | typedef enum |
|
22eabd4f5ed4
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7060
diff
changeset
|
49 | { |
| 15884 | 50 | PURPLE_BLIST_GROUP_NODE, |
| 51 | PURPLE_BLIST_CONTACT_NODE, | |
| 52 | PURPLE_BLIST_BUDDY_NODE, | |
| 53 | PURPLE_BLIST_CHAT_NODE, | |
| 54 | PURPLE_BLIST_OTHER_NODE | |
|
7098
22eabd4f5ed4
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7060
diff
changeset
|
55 | |
| 15884 | 56 | } PurpleBlistNodeType; |
| 5228 | 57 | |
| 15884 | 58 | #define PURPLE_BLIST_NODE_IS_CHAT(n) ((n)->type == PURPLE_BLIST_CHAT_NODE) |
| 59 | #define PURPLE_BLIST_NODE_IS_BUDDY(n) ((n)->type == PURPLE_BLIST_BUDDY_NODE) | |
| 60 | #define PURPLE_BLIST_NODE_IS_CONTACT(n) ((n)->type == PURPLE_BLIST_CONTACT_NODE) | |
| 61 | #define PURPLE_BLIST_NODE_IS_GROUP(n) ((n)->type == PURPLE_BLIST_GROUP_NODE) | |
| 5228 | 62 | |
| 15884 | 63 | #define PURPLE_BUDDY_IS_ONLINE(b) \ |
| 64 | ((b) != NULL && purple_account_is_connected((b)->account) && \ | |
| 65 | purple_presence_is_online(purple_buddy_get_presence(b))) | |
| 5228 | 66 | |
|
9787
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
67 | typedef enum |
|
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
68 | { |
|
20620
daa111825e61
Looking at purple_contact_set_alias and purple_blist_alias_contact functions
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
69 | PURPLE_BLIST_NODE_FLAG_NO_SAVE = 1 << 0, /**< node should not be saved with the buddy list */ |
|
20817
79a95c8d9b2c
A request field for buddylist nodes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20620
diff
changeset
|
70 | PURPLE_BLIST_NODE_HAS_CONVERSATION = 1 << 1, /**< node (buddy or chat) has an open conversation */ |
|
10008
1de3454a0dca
[gaim-migrate @ 10925]
Mark Doliner <markdoliner@pidgin.im>
parents:
9997
diff
changeset
|
71 | |
| 15884 | 72 | } PurpleBlistNodeFlags; |
|
9787
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
73 | |
|
20817
79a95c8d9b2c
A request field for buddylist nodes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20620
diff
changeset
|
74 | #define PURPLE_BLIST_NODE_SET_FLAG(node, f) (((PurpleBlistNode *)node)->flags |= (f)) |
|
79a95c8d9b2c
A request field for buddylist nodes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20620
diff
changeset
|
75 | #define PURPLE_BLIST_NODE_UNSET_FLAG(node, f) (((PurpleBlistNode *)node)->flags &= ~(f)) |
|
20620
daa111825e61
Looking at purple_contact_set_alias and purple_blist_alias_contact functions
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
76 | #define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (((PurpleBlistNode*)(b))->flags & (f)) |
| 15884 | 77 | #define PURPLE_BLIST_NODE_SHOULD_SAVE(b) (! PURPLE_BLIST_NODE_HAS_FLAG(b, PURPLE_BLIST_NODE_FLAG_NO_SAVE)) |
|
9787
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
78 | |
| 15884 | 79 | #define PURPLE_BLIST_NODE_NAME(n) ((n)->type == PURPLE_BLIST_CHAT_NODE ? purple_chat_get_name((PurpleChat*)n) : \ |
| 80 | (n)->type == PURPLE_BLIST_BUDDY_NODE ? purple_buddy_get_name((PurpleBuddy*)n) : NULL) | |
| 12519 | 81 | |
|
10008
1de3454a0dca
[gaim-migrate @ 10925]
Mark Doliner <markdoliner@pidgin.im>
parents:
9997
diff
changeset
|
82 | #include "account.h" |
|
1de3454a0dca
[gaim-migrate @ 10925]
Mark Doliner <markdoliner@pidgin.im>
parents:
9997
diff
changeset
|
83 | #include "buddyicon.h" |
|
1de3454a0dca
[gaim-migrate @ 10925]
Mark Doliner <markdoliner@pidgin.im>
parents:
9997
diff
changeset
|
84 | #include "status.h" |
| 5228 | 85 | |
| 86 | /**************************************************************************/ | |
| 87 | /* Data Structures */ | |
| 88 | /**************************************************************************/ | |
| 89 | ||
| 90 | /** | |
| 10566 | 91 | * A Buddy list node. This can represent a group, a buddy, or anything else. |
| 92 | * This is a base class for struct buddy and struct group and for anything | |
| 93 | * else that wants to put itself in the buddy list. */ | |
| 15884 | 94 | struct _PurpleBlistNode { |
| 95 | PurpleBlistNodeType type; /**< The type of node this is */ | |
| 96 | PurpleBlistNode *prev; /**< The sibling before this buddy. */ | |
| 97 | PurpleBlistNode *next; /**< The sibling after this buddy. */ | |
| 98 | PurpleBlistNode *parent; /**< The parent of this node */ | |
| 99 | PurpleBlistNode *child; /**< The child of this node */ | |
| 7693 | 100 | GHashTable *settings; /**< per-node settings */ |
|
7098
22eabd4f5ed4
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7060
diff
changeset
|
101 | void *ui_data; /**< The UI can put data here. */ |
| 15884 | 102 | PurpleBlistNodeFlags flags; /**< The buddy flags */ |
| 5228 | 103 | }; |
| 104 | ||
| 105 | /** | |
| 15884 | 106 | * A buddy. This contains everything Purple will ever need to know about someone on the buddy list. Everything. |
| 5228 | 107 | */ |
| 15884 | 108 | struct _PurpleBuddy { |
| 109 | PurpleBlistNode node; /**< The node that this buddy inherits from */ | |
| 5228 | 110 | char *name; /**< The screenname of the buddy. */ |
| 111 | char *alias; /**< The user-set alias of the buddy */ | |
| 6695 | 112 | char *server_alias; /**< The server-specified alias of the buddy. (i.e. MSN "Friendly Names") */ |
| 5228 | 113 | void *proto_data; /**< This allows the prpl to associate whatever data it wants with a buddy */ |
| 15884 | 114 | PurpleBuddyIcon *icon; /**< The buddy icon. */ |
| 115 | PurpleAccount *account; /**< the account this buddy belongs to */ | |
| 116 | PurplePresence *presence; | |
| 5228 | 117 | }; |
| 118 | ||
| 119 | /** | |
| 15884 | 120 | * A contact. This contains everything Purple will ever need to know about a contact. |
| 6695 | 121 | */ |
| 15884 | 122 | struct _PurpleContact { |
| 123 | PurpleBlistNode node; /**< The node that this contact inherits from. */ | |
| 6755 | 124 | char *alias; /**< The user-set alias of the contact */ |
| 125 | int totalsize; /**< The number of buddies in this contact */ | |
| 126 | int currentsize; /**< The number of buddies in this contact corresponding to online accounts */ | |
| 127 | int online; /**< The number of buddies in this contact who are currently online */ | |
| 15884 | 128 | PurpleBuddy *priority; /**< The "top" buddy for this contact */ |
| 10378 | 129 | gboolean priority_valid; /**< Is priority valid? */ |
| 6695 | 130 | }; |
| 131 | ||
| 132 | ||
| 133 | /** | |
| 15884 | 134 | * A group. This contains everything Purple will ever need to know about a group. |
| 5228 | 135 | */ |
| 15884 | 136 | struct _PurpleGroup { |
| 137 | PurpleBlistNode node; /**< The node that this group inherits from */ | |
| 5228 | 138 | char *name; /**< The name of this group. */ |
| 6695 | 139 | int totalsize; /**< The number of chats and contacts in this group */ |
| 140 | int currentsize; /**< The number of chats and contacts in this group corresponding to online accounts */ | |
| 141 | int online; /**< The number of chats and contacts in this group who are currently online */ | |
| 5228 | 142 | }; |
| 143 | ||
| 5234 | 144 | /** |
| 15884 | 145 | * A chat. This contains everything Purple needs to put a chat room in the |
| 5234 | 146 | * buddy list. |
| 147 | */ | |
| 15884 | 148 | struct _PurpleChat { |
| 149 | PurpleBlistNode node; /**< The node that this chat inherits from */ | |
| 5234 | 150 | char *alias; /**< The display name of this chat. */ |
| 151 | GHashTable *components; /**< the stuff the protocol needs to know to join the chat */ | |
| 15884 | 152 | PurpleAccount *account; /**< The account this chat is attached to */ |
| 5234 | 153 | }; |
| 154 | ||
| 5228 | 155 | |
| 156 | /** | |
| 157 | * The Buddy List | |
| 158 | */ | |
| 15884 | 159 | struct _PurpleBuddyList { |
| 160 | PurpleBlistNode *root; /**< The first node in the buddy list */ | |
|
7098
22eabd4f5ed4
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7060
diff
changeset
|
161 | GHashTable *buddies; /**< Every buddy in this list */ |
|
22eabd4f5ed4
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7060
diff
changeset
|
162 | void *ui_data; /**< UI-specific data. */ |
| 5228 | 163 | }; |
| 164 | ||
| 12054 | 165 | /** |
| 166 | * Buddy list UI operations. | |
| 167 | * | |
| 15884 | 168 | * Any UI representing a buddy list must assign a filled-out PurpleBlistUiOps |
| 12054 | 169 | * structure to the buddy list core. |
| 170 | */ | |
| 15884 | 171 | struct _PurpleBlistUiOps |
| 12054 | 172 | { |
| 15884 | 173 | void (*new_list)(PurpleBuddyList *list); /**< Sets UI-specific data on a buddy list. */ |
| 174 | void (*new_node)(PurpleBlistNode *node); /**< Sets UI-specific data on a node. */ | |
| 175 | void (*show)(PurpleBuddyList *list); /**< The core will call this when it's finished doing its core stuff */ | |
| 176 | void (*update)(PurpleBuddyList *list, | |
| 177 | PurpleBlistNode *node); /**< This will update a node in the buddy list. */ | |
| 178 | void (*remove)(PurpleBuddyList *list, | |
| 179 | PurpleBlistNode *node); /**< This removes a node from the list */ | |
| 180 | void (*destroy)(PurpleBuddyList *list); /**< When the list gets destroyed, this gets called to destroy the UI. */ | |
| 181 | void (*set_visible)(PurpleBuddyList *list, | |
| 12054 | 182 | gboolean show); /**< Hides or unhides the buddy list */ |
| 15884 | 183 | void (*request_add_buddy)(PurpleAccount *account, const char *username, |
| 12054 | 184 | const char *group, const char *alias); |
| 15884 | 185 | void (*request_add_chat)(PurpleAccount *account, PurpleGroup *group, |
| 12054 | 186 | const char *alias, const char *name); |
| 187 | void (*request_add_group)(void); | |
|
16743
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
188 | |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
189 | void (*_purple_reserved1)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
190 | void (*_purple_reserved2)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
191 | void (*_purple_reserved3)(void); |
|
1ce5ffe12e2a
Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
192 | void (*_purple_reserved4)(void); |
| 12054 | 193 | }; |
| 194 | ||
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
195 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
196 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
197 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
198 | |
| 5228 | 199 | /**************************************************************************/ |
| 200 | /** @name Buddy List API */ | |
| 201 | /**************************************************************************/ | |
| 202 | /*@{*/ | |
| 203 | ||
| 204 | /** | |
| 205 | * Creates a new buddy list | |
|
10071
d2ba11541693
[gaim-migrate @ 11047]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
10052
diff
changeset
|
206 | * |
|
d2ba11541693
[gaim-migrate @ 11047]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
10052
diff
changeset
|
207 | * @return The new buddy list. |
| 5228 | 208 | */ |
| 15884 | 209 | PurpleBuddyList *purple_blist_new(void); |
| 5228 | 210 | |
| 211 | /** | |
| 212 | * Sets the main buddy list. | |
| 213 | * | |
|
10071
d2ba11541693
[gaim-migrate @ 11047]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
10052
diff
changeset
|
214 | * @param blist The buddy list you want to use. |
| 5228 | 215 | */ |
| 15884 | 216 | void purple_set_blist(PurpleBuddyList *blist); |
| 5228 | 217 | |
| 218 | /** | |
| 219 | * Returns the main buddy list. | |
| 220 | * | |
| 221 | * @return The main buddy list. | |
| 222 | */ | |
| 15884 | 223 | PurpleBuddyList *purple_get_blist(void); |
| 5228 | 224 | |
| 225 | /** | |
| 13485 | 226 | * Returns the root node of the main buddy list. |
| 227 | * | |
| 228 | * @return The root node. | |
| 229 | */ | |
| 15884 | 230 | PurpleBlistNode *purple_blist_get_root(void); |
| 13485 | 231 | |
| 232 | /** | |
|
12112
86a24bbf9a2c
[gaim-migrate @ 14412]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12088
diff
changeset
|
233 | * Returns the next node of a given node. This function is to be used to iterate |
| 15884 | 234 | * over the tree returned by purple_get_blist. |
|
12112
86a24bbf9a2c
[gaim-migrate @ 14412]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12088
diff
changeset
|
235 | * |
|
86a24bbf9a2c
[gaim-migrate @ 14412]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12088
diff
changeset
|
236 | * @param node A node. |
|
86a24bbf9a2c
[gaim-migrate @ 14412]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12088
diff
changeset
|
237 | * @param offline Whether to include nodes for offline accounts |
|
86a24bbf9a2c
[gaim-migrate @ 14412]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12088
diff
changeset
|
238 | * @return The next node |
|
86a24bbf9a2c
[gaim-migrate @ 14412]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12088
diff
changeset
|
239 | */ |
| 15884 | 240 | PurpleBlistNode *purple_blist_node_next(PurpleBlistNode *node, gboolean offline); |
|
12112
86a24bbf9a2c
[gaim-migrate @ 14412]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12088
diff
changeset
|
241 | |
|
86a24bbf9a2c
[gaim-migrate @ 14412]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12088
diff
changeset
|
242 | /** |
| 5228 | 243 | * Shows the buddy list, creating a new one if necessary. |
| 244 | */ | |
| 15884 | 245 | void purple_blist_show(void); |
| 5228 | 246 | |
| 247 | ||
| 248 | /** | |
| 249 | * Destroys the buddy list window. | |
| 250 | */ | |
| 15884 | 251 | void purple_blist_destroy(void); |
| 5228 | 252 | |
| 253 | /** | |
| 254 | * Hides or unhides the buddy list. | |
| 255 | * | |
| 256 | * @param show Whether or not to show the buddy list | |
| 257 | */ | |
| 15884 | 258 | void purple_blist_set_visible(gboolean show); |
| 5228 | 259 | |
| 260 | /** | |
| 261 | * Updates a buddy's status. | |
| 5234 | 262 | * |
|
10052
329dad7e2da3
[gaim-migrate @ 11013]
Dave West <kat@users.sourceforge.net>
parents:
10037
diff
changeset
|
263 | * @param buddy The buddy whose status has changed. |
|
329dad7e2da3
[gaim-migrate @ 11013]
Dave West <kat@users.sourceforge.net>
parents:
10037
diff
changeset
|
264 | * @param old_status The status from which we are changing. |
| 5228 | 265 | */ |
| 15884 | 266 | void purple_blist_update_buddy_status(PurpleBuddy *buddy, PurpleStatus *old_status); |
| 5228 | 267 | |
| 7950 | 268 | /** |
| 5228 | 269 | * Updates a buddy's icon. |
| 270 | * | |
| 271 | * @param buddy The buddy whose buddy icon has changed | |
| 272 | */ | |
| 15884 | 273 | void purple_blist_update_buddy_icon(PurpleBuddy *buddy); |
| 5228 | 274 | |
| 275 | /** | |
| 276 | * Renames a buddy in the buddy list. | |
| 277 | * | |
| 278 | * @param buddy The buddy whose name will be changed. | |
| 279 | * @param name The new name of the buddy. | |
| 280 | */ | |
| 15884 | 281 | void purple_blist_rename_buddy(PurpleBuddy *buddy, const char *name); |
| 5228 | 282 | |
|
12319
42a0e8cecea3
[gaim-migrate @ 14623]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
283 | /** |
|
42a0e8cecea3
[gaim-migrate @ 14623]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
284 | * Aliases a contact in the buddy list. |
|
42a0e8cecea3
[gaim-migrate @ 14623]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
285 | * |
|
42a0e8cecea3
[gaim-migrate @ 14623]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
286 | * @param contact The contact whose alias will be changed. |
|
42a0e8cecea3
[gaim-migrate @ 14623]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
287 | * @param alias The contact's alias. |
|
42a0e8cecea3
[gaim-migrate @ 14623]
Richard Laager <rlaager@pidgin.im>
parents:
12286
diff
changeset
|
288 | */ |
| 15884 | 289 | void purple_blist_alias_contact(PurpleContact *contact, const char *alias); |
| 5228 | 290 | |
| 291 | /** | |
| 292 | * Aliases a buddy in the buddy list. | |
| 293 | * | |
| 294 | * @param buddy The buddy whose alias will be changed. | |
| 295 | * @param alias The buddy's alias. | |
| 296 | */ | |
| 15884 | 297 | void purple_blist_alias_buddy(PurpleBuddy *buddy, const char *alias); |
| 5228 | 298 | |
| 5234 | 299 | /** |
|
6059
9934c862ca14
[gaim-migrate @ 6509]
John Silvestri <john.silvestri@gmail.com>
parents:
6058
diff
changeset
|
300 | * Sets the server-sent alias of a buddy in the buddy list. |
|
13952
2bc729a80bd3
[gaim-migrate @ 16372]
Mark Doliner <markdoliner@pidgin.im>
parents:
13929
diff
changeset
|
301 | * PRPLs should call serv_got_alias() instead of this. |
|
6058
0d5c66a5da5d
[gaim-migrate @ 6508]
Mark Doliner <markdoliner@pidgin.im>
parents:
6036
diff
changeset
|
302 | * |
|
0d5c66a5da5d
[gaim-migrate @ 6508]
Mark Doliner <markdoliner@pidgin.im>
parents:
6036
diff
changeset
|
303 | * @param buddy The buddy whose alias will be changed. |
|
0d5c66a5da5d
[gaim-migrate @ 6508]
Mark Doliner <markdoliner@pidgin.im>
parents:
6036
diff
changeset
|
304 | * @param alias The buddy's "official" alias. |
|
0d5c66a5da5d
[gaim-migrate @ 6508]
Mark Doliner <markdoliner@pidgin.im>
parents:
6036
diff
changeset
|
305 | */ |
| 15884 | 306 | void purple_blist_server_alias_buddy(PurpleBuddy *buddy, const char *alias); |
|
6058
0d5c66a5da5d
[gaim-migrate @ 6508]
Mark Doliner <markdoliner@pidgin.im>
parents:
6036
diff
changeset
|
307 | |
|
0d5c66a5da5d
[gaim-migrate @ 6508]
Mark Doliner <markdoliner@pidgin.im>
parents:
6036
diff
changeset
|
308 | /** |
| 5234 | 309 | * Aliases a chat in the buddy list. |
| 310 | * | |
| 311 | * @param chat The chat whose alias will be changed. | |
| 312 | * @param alias The chat's new alias. | |
| 313 | */ | |
| 15884 | 314 | void purple_blist_alias_chat(PurpleChat *chat, const char *alias); |
| 5228 | 315 | |
| 316 | /** | |
| 317 | * Renames a group | |
| 318 | * | |
| 319 | * @param group The group to rename | |
| 320 | * @param name The new name | |
| 321 | */ | |
| 15884 | 322 | void purple_blist_rename_group(PurpleGroup *group, const char *name); |
| 5228 | 323 | |
| 5234 | 324 | /** |
| 325 | * Creates a new chat for the buddy list | |
| 326 | * | |
| 327 | * @param account The account this chat will get added to | |
| 328 | * @param alias The alias of the new chat | |
|
15203
1a092806f344
[gaim-migrate @ 17927]
Mark Doliner <markdoliner@pidgin.im>
parents:
14814
diff
changeset
|
329 | * @param components The info the prpl needs to join the chat. The |
|
1a092806f344
[gaim-migrate @ 17927]
Mark Doliner <markdoliner@pidgin.im>
parents:
14814
diff
changeset
|
330 | * hash function should be g_str_hash() and the |
|
1a092806f344
[gaim-migrate @ 17927]
Mark Doliner <markdoliner@pidgin.im>
parents:
14814
diff
changeset
|
331 | * equal function should be g_str_equal(). |
| 5234 | 332 | * @return A newly allocated chat |
| 333 | */ | |
| 15884 | 334 | PurpleChat *purple_chat_new(PurpleAccount *account, const char *alias, GHashTable *components); |
| 5234 | 335 | |
| 336 | /** | |
| 337 | * Adds a new chat to the buddy list. | |
| 338 | * | |
| 339 | * The chat will be inserted right after node or appended to the end | |
| 340 | * of group if node is NULL. If both are NULL, the buddy will be added to | |
| 341 | * the "Chats" group. | |
| 342 | * | |
| 343 | * @param chat The new chat who gets added | |
| 344 | * @param group The group to add the new chat to. | |
| 345 | * @param node The insertion point | |
| 346 | */ | |
| 15884 | 347 | void purple_blist_add_chat(PurpleChat *chat, PurpleGroup *group, PurpleBlistNode *node); |
| 5228 | 348 | |
| 349 | /** | |
| 350 | * Creates a new buddy | |
| 351 | * | |
| 352 | * @param account The account this buddy will get added to | |
| 353 | * @param screenname The screenname of the new buddy | |
| 354 | * @param alias The alias of the new buddy (or NULL if unaliased) | |
| 355 | * @return A newly allocated buddy | |
| 356 | */ | |
| 15884 | 357 | PurpleBuddy *purple_buddy_new(PurpleAccount *account, const char *screenname, const char *alias); |
| 5228 | 358 | |
| 359 | /** | |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
360 | * Sets a buddy's icon. |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
361 | * |
| 15884 | 362 | * This should only be called from within Purple. You probably want to |
| 363 | * call purple_buddy_icon_set_data(). | |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
364 | * |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
365 | * @param buddy The buddy. |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
366 | * @param icon The buddy icon. |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
367 | * |
| 15884 | 368 | * @see purple_buddy_icon_set_data() |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
369 | */ |
| 15884 | 370 | void purple_buddy_set_icon(PurpleBuddy *buddy, PurpleBuddyIcon *icon); |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
371 | |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
372 | /** |
|
10037
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
373 | * Returns a buddy's account. |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
374 | * |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
375 | * @param buddy The buddy. |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
376 | * |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
377 | * @return The account |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
378 | */ |
| 15884 | 379 | PurpleAccount *purple_buddy_get_account(const PurpleBuddy *buddy); |
|
10037
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
380 | |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
381 | /** |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
382 | * Returns a buddy's name |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
383 | * |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
384 | * @param buddy The buddy. |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
385 | * |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
386 | * @return The name. |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
387 | */ |
| 15884 | 388 | const char *purple_buddy_get_name(const PurpleBuddy *buddy); |
|
10037
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
389 | |
|
5f5b72040fa2
[gaim-migrate @ 10996]
Dave West <kat@users.sourceforge.net>
parents:
10012
diff
changeset
|
390 | /** |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
391 | * Returns a buddy's icon. |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
392 | * |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
393 | * @param buddy The buddy. |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
394 | * |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
395 | * @return The buddy icon. |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
396 | */ |
| 15884 | 397 | PurpleBuddyIcon *purple_buddy_get_icon(const PurpleBuddy *buddy); |
|
6846
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
398 | |
|
f814f02dca87
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6843
diff
changeset
|
399 | /** |
| 7312 | 400 | * Returns a buddy's contact. |
| 401 | * | |
| 402 | * @param buddy The buddy. | |
| 403 | * | |
| 404 | * @return The buddy's contact. | |
| 405 | */ | |
| 15884 | 406 | PurpleContact *purple_buddy_get_contact(PurpleBuddy *buddy); |
| 7312 | 407 | |
| 408 | /** | |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9939
diff
changeset
|
409 | * Returns a buddy's presence. |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9939
diff
changeset
|
410 | * |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9939
diff
changeset
|
411 | * @param buddy The buddy. |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9939
diff
changeset
|
412 | * |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9939
diff
changeset
|
413 | * @return The buddy's presence. |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9939
diff
changeset
|
414 | */ |
| 15884 | 415 | PurplePresence *purple_buddy_get_presence(const PurpleBuddy *buddy); |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9939
diff
changeset
|
416 | |
|
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9939
diff
changeset
|
417 | /** |
| 5228 | 418 | * Adds a new buddy to the buddy list. |
| 419 | * | |
| 6695 | 420 | * The buddy will be inserted right after node or prepended to the |
| 421 | * group if node is NULL. If both are NULL, the buddy will be added to | |
| 5228 | 422 | * the "Buddies" group. |
| 423 | * | |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
424 | * @param buddy The new buddy who gets added |
|
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
425 | * @param contact The optional contact to place the buddy in. |
|
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
426 | * @param group The group to add the new buddy to. |
|
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
427 | * @param node The insertion point |
| 5228 | 428 | */ |
| 15884 | 429 | void purple_blist_add_buddy(PurpleBuddy *buddy, PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node); |
| 5228 | 430 | |
| 431 | /** | |
| 432 | * Creates a new group | |
| 433 | * | |
| 6695 | 434 | * You can't have more than one group with the same name. Sorry. If you pass |
| 435 | * this the * name of a group that already exists, it will return that group. | |
| 5228 | 436 | * |
| 437 | * @param name The name of the new group | |
| 6695 | 438 | * @return A new group struct |
| 5228 | 439 | */ |
| 15884 | 440 | PurpleGroup *purple_group_new(const char *name); |
| 5228 | 441 | |
| 442 | /** | |
| 443 | * Adds a new group to the buddy list. | |
| 444 | * | |
| 6695 | 445 | * The new group will be inserted after insert or prepended to the list if |
| 446 | * node is NULL. | |
| 447 | * | |
| 448 | * @param group The group | |
| 449 | * @param node The insertion point | |
| 450 | */ | |
| 15884 | 451 | void purple_blist_add_group(PurpleGroup *group, PurpleBlistNode *node); |
| 6695 | 452 | |
| 453 | /** | |
| 454 | * Creates a new contact | |
| 5228 | 455 | * |
| 6695 | 456 | * @return A new contact struct |
| 5228 | 457 | */ |
| 15884 | 458 | PurpleContact *purple_contact_new(void); |
| 6695 | 459 | |
| 460 | /** | |
| 461 | * Adds a new contact to the buddy list. | |
| 462 | * | |
| 463 | * The new contact will be inserted after insert or prepended to the list if | |
| 464 | * node is NULL. | |
| 465 | * | |
| 466 | * @param contact The contact | |
| 467 | * @param group The group to add the contact to | |
| 468 | * @param node The insertion point | |
| 469 | */ | |
| 15884 | 470 | void purple_blist_add_contact(PurpleContact *contact, PurpleGroup *group, PurpleBlistNode *node); |
| 6695 | 471 | |
| 472 | /** | |
| 6965 | 473 | * Merges two contacts |
| 474 | * | |
| 475 | * All of the buddies from source will be moved to target | |
| 476 | * | |
| 477 | * @param source The contact to merge | |
| 7246 | 478 | * @param node The place to merge to (a buddy or contact) |
| 6965 | 479 | */ |
| 15884 | 480 | void purple_blist_merge_contact(PurpleContact *source, PurpleBlistNode *node); |
| 6965 | 481 | |
| 482 | /** | |
| 6695 | 483 | * Returns the highest priority buddy for a given contact. |
| 484 | * | |
| 485 | * @param contact The contact | |
| 486 | * @return The highest priority buddy | |
| 487 | */ | |
| 15884 | 488 | PurpleBuddy *purple_contact_get_priority_buddy(PurpleContact *contact); |
| 5228 | 489 | |
|
20808
e3524e9d502c
Honor a PURPLE_DISABLE_DEPRECATED define to allow plugins to catch
Richard Laager <rlaager@pidgin.im>
parents:
20620
diff
changeset
|
490 | #ifndef PURPLE_DISABLE_DEPRECATED |
| 5228 | 491 | /** |
| 6755 | 492 | * Sets the alias for a contact. |
| 493 | * | |
| 494 | * @param contact The contact | |
| 495 | * @param alias The alias to set, or NULL to unset | |
|
20620
daa111825e61
Looking at purple_contact_set_alias and purple_blist_alias_contact functions
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
496 | * |
|
daa111825e61
Looking at purple_contact_set_alias and purple_blist_alias_contact functions
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
497 | * @deprecated Use purple_blist_alias_contact() instead. |
| 6755 | 498 | */ |
| 15884 | 499 | void purple_contact_set_alias(PurpleContact *contact, const char *alias); |
|
20808
e3524e9d502c
Honor a PURPLE_DISABLE_DEPRECATED define to allow plugins to catch
Richard Laager <rlaager@pidgin.im>
parents:
20620
diff
changeset
|
500 | #endif |
| 6755 | 501 | |
| 502 | /** | |
| 503 | * Gets the alias for a contact. | |
| 504 | * | |
| 505 | * @param contact The contact | |
| 506 | * @return The alias, or NULL if it is not set. | |
| 507 | */ | |
| 15884 | 508 | const char *purple_contact_get_alias(PurpleContact *contact); |
| 6755 | 509 | |
| 510 | /** | |
|
9787
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
511 | * Determines whether an account owns any buddies in a given contact |
|
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
512 | * |
|
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
513 | * @param contact The contact to search through. |
|
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
514 | * @param account The account. |
|
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
515 | * |
|
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
516 | * @return TRUE if there are any buddies from account in the contact, or FALSE otherwise. |
|
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
517 | */ |
| 15884 | 518 | gboolean purple_contact_on_account(PurpleContact *contact, PurpleAccount *account); |
|
9787
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
519 | |
|
a88b7e860699
[gaim-migrate @ 10655]
Christopher O'Brien <siege@pidgin.im>
parents:
9754
diff
changeset
|
520 | /** |
| 10378 | 521 | * Invalidates the priority buddy so that the next call to |
| 15884 | 522 | * purple_contact_get_priority_buddy recomputes it. |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9939
diff
changeset
|
523 | * |
| 10378 | 524 | * @param contact The contact |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9939
diff
changeset
|
525 | */ |
| 15884 | 526 | void purple_contact_invalidate_priority_buddy(PurpleContact *contact); |
|
9944
71ef020ec4b0
[gaim-migrate @ 10838]
Christian Hammond <chipx86@chipx86.com>
parents:
9939
diff
changeset
|
527 | /** |
| 5228 | 528 | * Removes a buddy from the buddy list and frees the memory allocated to it. |
| 529 | * | |
| 530 | * @param buddy The buddy to be removed | |
| 531 | */ | |
| 15884 | 532 | void purple_blist_remove_buddy(PurpleBuddy *buddy); |
| 6695 | 533 | |
| 534 | /** | |
| 535 | * Removes a contact, and any buddies it contains, and frees the memory | |
| 536 | * allocated to it. | |
| 537 | * | |
| 538 | * @param contact The contact to be removed | |
| 539 | */ | |
| 15884 | 540 | void purple_blist_remove_contact(PurpleContact *contact); |
| 5228 | 541 | |
| 542 | /** | |
| 5234 | 543 | * Removes a chat from the buddy list and frees the memory allocated to it. |
| 544 | * | |
| 545 | * @param chat The chat to be removed | |
| 546 | */ | |
| 15884 | 547 | void purple_blist_remove_chat(PurpleChat *chat); |
| 5234 | 548 | |
| 549 | /** | |
| 5228 | 550 | * Removes a group from the buddy list and frees the memory allocated to it and to |
| 551 | * its children | |
| 552 | * | |
| 553 | * @param group The group to be removed | |
| 554 | */ | |
| 15884 | 555 | void purple_blist_remove_group(PurpleGroup *group); |
| 5228 | 556 | |
| 557 | /** | |
| 558 | * Returns the alias of a buddy. | |
| 559 | * | |
| 560 | * @param buddy The buddy whose name will be returned. | |
| 10349 | 561 | * @return The alias (if set), server alias (if set), |
| 562 | * or NULL. | |
| 5228 | 563 | */ |
| 15884 | 564 | const char *purple_buddy_get_alias_only(PurpleBuddy *buddy); |
| 5228 | 565 | |
|
14553
905eb6bb4afb
[gaim-migrate @ 17210]
Jérôme Poulin <ticpu@users.sourceforge.net>
parents:
14254
diff
changeset
|
566 | /** |
|
905eb6bb4afb
[gaim-migrate @ 17210]
Jérôme Poulin <ticpu@users.sourceforge.net>
parents:
14254
diff
changeset
|
567 | * Gets the server alias for a buddy. |
|
905eb6bb4afb
[gaim-migrate @ 17210]
Jérôme Poulin <ticpu@users.sourceforge.net>
parents:
14254
diff
changeset
|
568 | * |
|
905eb6bb4afb
[gaim-migrate @ 17210]
Jérôme Poulin <ticpu@users.sourceforge.net>
parents:
14254
diff
changeset
|
569 | * @param buddy The buddy whose name will be returned |
|
905eb6bb4afb
[gaim-migrate @ 17210]
Jérôme Poulin <ticpu@users.sourceforge.net>
parents:
14254
diff
changeset
|
570 | * @return The server alias, or NULL if it is not set. |
|
905eb6bb4afb
[gaim-migrate @ 17210]
Jérôme Poulin <ticpu@users.sourceforge.net>
parents:
14254
diff
changeset
|
571 | */ |
| 15884 | 572 | const char *purple_buddy_get_server_alias(PurpleBuddy *buddy); |
| 5228 | 573 | |
| 574 | /** | |
|
9620
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
575 | * Returns the correct name to display for a buddy, taking the contact alias |
|
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
576 | * into account. In order of precedence: the buddy's alias; the buddy's |
|
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
577 | * contact alias; the buddy's server alias; the buddy's user name. |
|
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
578 | * |
|
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
579 | * @param buddy The buddy whose name will be returned |
|
9635
4f705de0334c
[gaim-migrate @ 10479]
Mark Doliner <markdoliner@pidgin.im>
parents:
9620
diff
changeset
|
580 | * @return The appropriate name or alias, or NULL. |
|
9620
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
581 | * |
|
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
582 | */ |
| 15884 | 583 | const char *purple_buddy_get_contact_alias(PurpleBuddy *buddy); |
|
9620
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
584 | |
| 10349 | 585 | /** |
| 586 | * Returns the correct alias for this user, ignoring server aliases. Used | |
| 587 | * when a user-recognizable name is required. In order: buddy's alias; buddy's | |
| 588 | * contact alias; buddy's user name. | |
| 589 | * | |
| 590 | * @param buddy The buddy whose alias will be returned. | |
| 591 | * @return The appropriate name or alias. | |
| 592 | */ | |
| 15884 | 593 | const char *purple_buddy_get_local_alias(PurpleBuddy *buddy); |
|
9620
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
594 | |
|
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
595 | /** |
|
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
596 | * Returns the correct name to display for a buddy. In order of precedence: |
|
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
597 | * the buddy's alias; the buddy's server alias; the buddy's contact alias; |
|
fe99fcea5c1c
[gaim-migrate @ 10464]
Christopher O'Brien <siege@pidgin.im>
parents:
9460
diff
changeset
|
598 | * the buddy's user name. |
| 5228 | 599 | * |
| 600 | * @param buddy The buddy whose name will be returned. | |
|
9635
4f705de0334c
[gaim-migrate @ 10479]
Mark Doliner <markdoliner@pidgin.im>
parents:
9620
diff
changeset
|
601 | * @return The appropriate name or alias, or NULL |
| 5228 | 602 | */ |
| 15884 | 603 | const char *purple_buddy_get_alias(PurpleBuddy *buddy); |
| 5228 | 604 | |
| 605 | /** | |
| 6744 | 606 | * Returns the correct name to display for a blist chat. |
| 607 | * | |
| 608 | * @param chat The chat whose name will be returned. | |
| 609 | * @return The alias (if set), or first component value. | |
| 610 | */ | |
| 15884 | 611 | const char *purple_chat_get_name(PurpleChat *chat); |
| 6744 | 612 | |
| 613 | /** | |
| 5228 | 614 | * Finds the buddy struct given a screenname and an account |
| 615 | * | |
|
10071
d2ba11541693
[gaim-migrate @ 11047]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
10052
diff
changeset
|
616 | * @param account The account this buddy belongs to |
| 6872 | 617 | * @param name The buddy's screenname |
| 5228 | 618 | * @return The buddy or NULL if the buddy does not exist |
| 619 | */ | |
| 15884 | 620 | PurpleBuddy *purple_find_buddy(PurpleAccount *account, const char *name); |
| 6245 | 621 | |
| 622 | /** | |
| 6872 | 623 | * Finds the buddy struct given a screenname, an account, and a group |
| 624 | * | |
|
10071
d2ba11541693
[gaim-migrate @ 11047]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
10052
diff
changeset
|
625 | * @param account The account this buddy belongs to |
| 6872 | 626 | * @param name The buddy's screenname |
| 627 | * @param group The group to look in | |
| 628 | * @return The buddy or NULL if the buddy does not exist in the group | |
| 629 | */ | |
| 15884 | 630 | PurpleBuddy *purple_find_buddy_in_group(PurpleAccount *account, const char *name, |
| 631 | PurpleGroup *group); | |
| 6872 | 632 | |
| 633 | /** | |
| 15884 | 634 | * Finds all PurpleBuddy structs given a screenname and an account |
| 6245 | 635 | * |
|
10071
d2ba11541693
[gaim-migrate @ 11047]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
10052
diff
changeset
|
636 | * @param account The account this buddy belongs to |
|
14814
479ac60fb641
[gaim-migrate @ 17509]
Daniel Atallah <datallah@pidgin.im>
parents:
14553
diff
changeset
|
637 | * @param name The buddy's screenname (or NULL to return all buddies in the account) |
| 6245 | 638 | * |
| 639 | * @return A GSList of buddies (which must be freed), or NULL if the buddy doesn't exist | |
| 640 | */ | |
| 15884 | 641 | GSList *purple_find_buddies(PurpleAccount *account, const char *name); |
| 6245 | 642 | |
| 5228 | 643 | |
| 644 | /** | |
| 645 | * Finds a group by name | |
| 646 | * | |
|
18414
b08108fc6ffc
Add a missing apostrophe in a comment.
Will Thompson <resiak@pidgin.im>
parents:
18412
diff
changeset
|
647 | * @param name The group's name |
| 5228 | 648 | * @return The group or NULL if the group does not exist |
| 649 | */ | |
| 15884 | 650 | PurpleGroup *purple_find_group(const char *name); |
| 6695 | 651 | |
| 652 | /** | |
|
6456
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
653 | * Finds a chat by name. |
|
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
654 | * |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
655 | * @param account The chat's account. |
|
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
656 | * @param name The chat's name. |
|
6456
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
657 | * |
|
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
658 | * @return The chat, or @c NULL if the chat does not exist. |
|
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
659 | */ |
| 15884 | 660 | PurpleChat *purple_blist_find_chat(PurpleAccount *account, const char *name); |
|
6456
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
661 | |
|
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
662 | /** |
|
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
663 | * Returns the group of which the chat is a member. |
|
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
664 | * |
|
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
665 | * @param chat The chat. |
|
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
666 | * |
|
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
667 | * @return The parent group, or @c NULL if the chat is not in a group. |
|
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
668 | */ |
| 15884 | 669 | PurpleGroup *purple_chat_get_group(PurpleChat *chat); |
|
6456
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
670 | |
|
e4e7dee16c1a
[gaim-migrate @ 6965]
Christian Hammond <chipx86@chipx86.com>
parents:
6245
diff
changeset
|
671 | /** |
| 5228 | 672 | * Returns the group of which the buddy is a member. |
| 673 | * | |
| 674 | * @param buddy The buddy | |
| 675 | * @return The group or NULL if the buddy is not in a group | |
| 676 | */ | |
| 15884 | 677 | PurpleGroup *purple_buddy_get_group(PurpleBuddy *buddy); |
| 5228 | 678 | |
| 679 | ||
| 680 | /** | |
| 681 | * Returns a list of accounts that have buddies in this group | |
| 682 | * | |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
683 | * @param g The group |
|
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
684 | * |
| 15884 | 685 | * @return A list of purple_accounts |
| 5228 | 686 | */ |
| 15884 | 687 | GSList *purple_group_get_accounts(PurpleGroup *g); |
| 5228 | 688 | |
| 689 | /** | |
| 690 | * Determines whether an account owns any buddies in a given group | |
| 691 | * | |
| 692 | * @param g The group to search through. | |
| 693 | * @param account The account. | |
|
6720
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
694 | * |
|
cdc5348dd848
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
695 | * @return TRUE if there are any buddies in the group, or FALSE otherwise. |
| 5228 | 696 | */ |
| 15884 | 697 | gboolean purple_group_on_account(PurpleGroup *g, PurpleAccount *account); |
| 5228 | 698 | |
| 699 | /** | |
|
16822
d1ee7a30e9b8
Add a missing function useful for dbus clients, requested by Andrey Kostenko. And fix a crash from badly written dbus code.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
700 | * Returns the name of a group. |
|
d1ee7a30e9b8
Add a missing function useful for dbus clients, requested by Andrey Kostenko. And fix a crash from badly written dbus code.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
701 | * |
|
d1ee7a30e9b8
Add a missing function useful for dbus clients, requested by Andrey Kostenko. And fix a crash from badly written dbus code.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
702 | * @param group The group. |
|
d1ee7a30e9b8
Add a missing function useful for dbus clients, requested by Andrey Kostenko. And fix a crash from badly written dbus code.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
703 | * |
|
d1ee7a30e9b8
Add a missing function useful for dbus clients, requested by Andrey Kostenko. And fix a crash from badly written dbus code.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
704 | * @return The name of the group. |
|
d1ee7a30e9b8
Add a missing function useful for dbus clients, requested by Andrey Kostenko. And fix a crash from badly written dbus code.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
705 | */ |
|
d1ee7a30e9b8
Add a missing function useful for dbus clients, requested by Andrey Kostenko. And fix a crash from badly written dbus code.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
706 | const char *purple_group_get_name(PurpleGroup *group); |
|
d1ee7a30e9b8
Add a missing function useful for dbus clients, requested by Andrey Kostenko. And fix a crash from badly written dbus code.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
707 | |
|
d1ee7a30e9b8
Add a missing function useful for dbus clients, requested by Andrey Kostenko. And fix a crash from badly written dbus code.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16743
diff
changeset
|
708 | /** |
| 5234 | 709 | * Called when an account gets signed on. Tells the UI to update all the |
| 710 | * buddies. | |
| 711 | * | |
| 712 | * @param account The account | |
| 713 | */ | |
| 15884 | 714 | void purple_blist_add_account(PurpleAccount *account); |
| 5234 | 715 | |
| 716 | ||
| 717 | /** | |
| 5228 | 718 | * Called when an account gets signed off. Sets the presence of all the buddies to 0 |
| 719 | * and tells the UI to update them. | |
| 720 | * | |
| 6695 | 721 | * @param account The account |
| 5228 | 722 | */ |
| 15884 | 723 | void purple_blist_remove_account(PurpleAccount *account); |
| 5228 | 724 | |
| 725 | ||
| 726 | /** | |
| 727 | * Determines the total size of a group | |
| 728 | * | |
| 729 | * @param group The group | |
| 730 | * @param offline Count buddies in offline accounts | |
| 731 | * @return The number of buddies in the group | |
| 732 | */ | |
| 15884 | 733 | int purple_blist_get_group_size(PurpleGroup *group, gboolean offline); |
| 5228 | 734 | |
| 735 | /** | |
| 736 | * Determines the number of online buddies in a group | |
| 737 | * | |
| 738 | * @param group The group | |
| 739 | * @return The number of online buddies in the group, or 0 if the group is NULL | |
| 740 | */ | |
| 15884 | 741 | int purple_blist_get_group_online_count(PurpleGroup *group); |
| 5228 | 742 | |
| 743 | /*@}*/ | |
| 744 | ||
| 745 | /****************************************************************************************/ | |
| 746 | /** @name Buddy list file management API */ | |
| 747 | /****************************************************************************************/ | |
| 748 | ||
| 749 | /** | |
| 15884 | 750 | * Loads the buddy list from ~/.purple/blist.xml. |
| 5228 | 751 | */ |
| 15884 | 752 | void purple_blist_load(void); |
| 5228 | 753 | |
| 754 | /** | |
|
10704
99a466f384d2
[gaim-migrate @ 12288]
Mark Doliner <markdoliner@pidgin.im>
parents:
10662
diff
changeset
|
755 | * Schedule a save of the blist.xml file. This is used by the privacy |
|
99a466f384d2
[gaim-migrate @ 12288]
Mark Doliner <markdoliner@pidgin.im>
parents:
10662
diff
changeset
|
756 | * API whenever the privacy settings are changed. If you make a change |
|
99a466f384d2
[gaim-migrate @ 12288]
Mark Doliner <markdoliner@pidgin.im>
parents:
10662
diff
changeset
|
757 | * to blist.xml using one of the functions in the buddy list API, then |
|
99a466f384d2
[gaim-migrate @ 12288]
Mark Doliner <markdoliner@pidgin.im>
parents:
10662
diff
changeset
|
758 | * the buddy list is saved automatically, so you should not need to |
|
99a466f384d2
[gaim-migrate @ 12288]
Mark Doliner <markdoliner@pidgin.im>
parents:
10662
diff
changeset
|
759 | * call this. |
|
10350
a72a43212626
[gaim-migrate @ 11565]
Mark Doliner <markdoliner@pidgin.im>
parents:
10349
diff
changeset
|
760 | */ |
| 15884 | 761 | void purple_blist_schedule_save(void); |
|
10350
a72a43212626
[gaim-migrate @ 11565]
Mark Doliner <markdoliner@pidgin.im>
parents:
10349
diff
changeset
|
762 | |
|
a72a43212626
[gaim-migrate @ 11565]
Mark Doliner <markdoliner@pidgin.im>
parents:
10349
diff
changeset
|
763 | /** |
|
7060
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
764 | * Requests from the user information needed to add a buddy to the |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
765 | * buddy list. |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
766 | * |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
767 | * @param account The account the buddy is added to. |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
768 | * @param username The username of the buddy. |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
769 | * @param group The name of the group to place the buddy in. |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
770 | * @param alias The optional alias for the buddy. |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
771 | */ |
| 15884 | 772 | void purple_blist_request_add_buddy(PurpleAccount *account, const char *username, |
|
7060
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
773 | const char *group, const char *alias); |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
774 | |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
775 | /** |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
776 | * Requests from the user information needed to add a chat to the |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
777 | * buddy list. |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
778 | * |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
779 | * @param account The account the buddy is added to. |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
780 | * @param group The optional group to add the chat to. |
| 9000 | 781 | * @param alias The optional alias for the chat. |
| 9939 | 782 | * @param name The required chat name. |
|
7060
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
783 | */ |
| 15884 | 784 | void purple_blist_request_add_chat(PurpleAccount *account, PurpleGroup *group, |
|
9754
3a17eee239b2
[gaim-migrate @ 10621]
Nathan Fredrickson <nathan@silverorange.com>
parents:
9713
diff
changeset
|
785 | const char *alias, const char *name); |
|
7060
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
786 | |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
787 | /** |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
788 | * Requests from the user information needed to add a group to the |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
789 | * buddy list. |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
790 | */ |
| 15884 | 791 | void purple_blist_request_add_group(void); |
|
7060
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
792 | |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
793 | /** |
| 7693 | 794 | * Associates a boolean with a node in the buddy list |
| 795 | * | |
| 796 | * @param node The node to associate the data with | |
| 797 | * @param key The identifier for the data | |
| 798 | * @param value The value to set | |
| 799 | */ | |
| 15884 | 800 | void purple_blist_node_set_bool(PurpleBlistNode *node, const char *key, gboolean value); |
| 7693 | 801 | |
| 802 | /** | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8710
diff
changeset
|
803 | * Retrieves a named boolean setting from a node in the buddy list |
| 7693 | 804 | * |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8710
diff
changeset
|
805 | * @param node The node to retrieve the data from |
| 7693 | 806 | * @param key The identifier of the data |
| 807 | * | |
| 808 | * @return The value, or FALSE if there is no setting | |
| 809 | */ | |
| 15884 | 810 | gboolean purple_blist_node_get_bool(PurpleBlistNode *node, const char *key); |
| 7693 | 811 | |
| 812 | /** | |
| 813 | * Associates an integer with a node in the buddy list | |
| 814 | * | |
| 815 | * @param node The node to associate the data with | |
| 816 | * @param key The identifier for the data | |
| 817 | * @param value The value to set | |
| 818 | */ | |
| 15884 | 819 | void purple_blist_node_set_int(PurpleBlistNode *node, const char *key, int value); |
| 7693 | 820 | |
| 821 | /** | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8710
diff
changeset
|
822 | * Retrieves a named integer setting from a node in the buddy list |
| 7693 | 823 | * |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8710
diff
changeset
|
824 | * @param node The node to retrieve the data from |
| 7693 | 825 | * @param key The identifier of the data |
| 826 | * | |
| 827 | * @return The value, or 0 if there is no setting | |
| 828 | */ | |
| 15884 | 829 | int purple_blist_node_get_int(PurpleBlistNode *node, const char *key); |
| 7693 | 830 | |
| 831 | /** | |
| 832 | * Associates a string with a node in the buddy list | |
| 833 | * | |
| 834 | * @param node The node to associate the data with | |
| 835 | * @param key The identifier for the data | |
| 836 | * @param value The value to set | |
| 837 | */ | |
| 15884 | 838 | void purple_blist_node_set_string(PurpleBlistNode *node, const char *key, |
| 7693 | 839 | const char *value); |
| 840 | ||
| 841 | /** | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8710
diff
changeset
|
842 | * Retrieves a named string setting from a node in the buddy list |
| 7693 | 843 | * |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8710
diff
changeset
|
844 | * @param node The node to retrieve the data from |
| 7693 | 845 | * @param key The identifier of the data |
| 846 | * | |
| 847 | * @return The value, or NULL if there is no setting | |
| 848 | */ | |
| 15884 | 849 | const char *purple_blist_node_get_string(PurpleBlistNode *node, const char *key); |
| 7693 | 850 | |
| 851 | /** | |
| 7811 | 852 | * Removes a named setting from a blist node |
| 853 | * | |
| 854 | * @param node The node from which to remove the setting | |
| 855 | * @param key The name of the setting | |
| 856 | */ | |
| 15884 | 857 | void purple_blist_node_remove_setting(PurpleBlistNode *node, const char *key); |
| 7811 | 858 | |
|
10548
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
859 | /** |
|
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
860 | * Set the flags for the given node. Setting a node's flags will overwrite |
|
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
861 | * the old flags, so if you want to save them, you must first call |
| 15884 | 862 | * purple_blist_node_get_flags and modify that appropriately. |
|
10548
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
863 | * |
|
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
864 | * @param node The node on which to set the flags. |
|
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
865 | * @param flags The flags to set. This is a bitmask. |
|
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
866 | */ |
| 15884 | 867 | void purple_blist_node_set_flags(PurpleBlistNode *node, PurpleBlistNodeFlags flags); |
|
10548
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
868 | |
|
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
869 | /** |
|
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
870 | * Get the current flags on a given node. |
|
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
871 | * |
|
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
872 | * @param node The node from which to get the flags. |
|
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
873 | * |
|
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
874 | * @return The flags on the node. This is a bitmask. |
|
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
875 | */ |
| 15884 | 876 | PurpleBlistNodeFlags purple_blist_node_get_flags(PurpleBlistNode *node); |
|
10548
990b3ec2758e
[gaim-migrate @ 11918]
Mark Doliner <markdoliner@pidgin.im>
parents:
10433
diff
changeset
|
877 | |
|
17859
afbace92af8d
New function purple_blist_node_get_type.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16822
diff
changeset
|
878 | /** |
|
afbace92af8d
New function purple_blist_node_get_type.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16822
diff
changeset
|
879 | * Get the type of a given node. |
|
afbace92af8d
New function purple_blist_node_get_type.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16822
diff
changeset
|
880 | * |
|
afbace92af8d
New function purple_blist_node_get_type.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16822
diff
changeset
|
881 | * @param node The node. |
|
afbace92af8d
New function purple_blist_node_get_type.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16822
diff
changeset
|
882 | * |
|
afbace92af8d
New function purple_blist_node_get_type.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16822
diff
changeset
|
883 | * @return The type of the node. |
|
afbace92af8d
New function purple_blist_node_get_type.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16822
diff
changeset
|
884 | */ |
|
afbace92af8d
New function purple_blist_node_get_type.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16822
diff
changeset
|
885 | PurpleBlistNodeType purple_blist_node_get_type(PurpleBlistNode *node); |
|
afbace92af8d
New function purple_blist_node_get_type.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16822
diff
changeset
|
886 | |
| 5228 | 887 | /*@}*/ |
| 888 | ||
|
8710
360b660e428d
[gaim-migrate @ 9464]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
889 | /** |
|
9030
7b574a641391
[gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents:
9013
diff
changeset
|
890 | * Retrieves the extended menu items for a buddy list node. |
| 12286 | 891 | * @param n The blist node for which to obtain the extended menu items. |
| 15884 | 892 | * @return A list of PurpleMenuAction items, as harvested by the |
| 12286 | 893 | * blist-node-extended-menu signal. |
|
9030
7b574a641391
[gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents:
9013
diff
changeset
|
894 | */ |
| 15884 | 895 | GList *purple_blist_node_get_extended_menu(PurpleBlistNode *n); |
|
9030
7b574a641391
[gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents:
9013
diff
changeset
|
896 | |
| 5228 | 897 | /**************************************************************************/ |
| 12054 | 898 | /** @name UI Registration Functions */ |
| 899 | /**************************************************************************/ | |
| 900 | /*@{*/ | |
| 901 | ||
| 902 | /** | |
| 903 | * Sets the UI operations structure to be used for the buddy list. | |
| 904 | * | |
| 905 | * @param ops The ops struct. | |
| 906 | */ | |
| 15884 | 907 | void purple_blist_set_ui_ops(PurpleBlistUiOps *ops); |
| 12054 | 908 | |
| 909 | /** | |
| 910 | * Returns the UI operations structure to be used for the buddy list. | |
| 911 | * | |
| 912 | * @return The UI operations structure. | |
| 913 | */ | |
| 15884 | 914 | PurpleBlistUiOps *purple_blist_get_ui_ops(void); |
| 12054 | 915 | |
| 916 | /*@}*/ | |
| 917 | ||
| 918 | /**************************************************************************/ | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
919 | /** @name Buddy List Subsystem */ |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
920 | /**************************************************************************/ |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
921 | /*@{*/ |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
922 | |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
923 | /** |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
924 | * Returns the handle for the buddy list subsystem. |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
925 | * |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
926 | * @return The buddy list subsystem handle. |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
927 | */ |
| 15884 | 928 | void *purple_blist_get_handle(void); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
929 | |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
930 | /** |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
931 | * Initializes the buddy list subsystem. |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
932 | */ |
| 15884 | 933 | void purple_blist_init(void); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
934 | |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
935 | /** |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
936 | * Uninitializes the buddy list subsystem. |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
937 | */ |
| 15884 | 938 | void purple_blist_uninit(void); |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
939 | |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
940 | /*@}*/ |
|
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6456
diff
changeset
|
941 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
942 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
943 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
944 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
945 | |
| 15884 | 946 | #endif /* _PURPLE_BLIST_H_ */ |