annotate src/buddyicon.h @ 7190:13c725566078

[gaim-migrate @ 7759] See if this fixes the assertion error with gaim_notify_emails in MSN that people seem to be getting. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Wed, 08 Oct 2003 15:11:45 +0000
parents c47633e9e2a4
children fa6395637e2c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6846
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
6869
7ec9c81dfe72 [gaim-migrate @ 7415]
Mark Doliner <mark@kingant.net>
parents: 6846
diff changeset
2 * @file buddyicon.h Buddy Icon API
6846
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 * @ingroup core
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org>
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * (at your option) any later version.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * GNU General Public License for more details.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 #ifndef _GAIM_ICON_H_
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 #define _GAIM_ICON_H_
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 typedef struct _GaimBuddyIcon GaimBuddyIcon;
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 #include "account.h"
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 struct _GaimBuddyIcon
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 {
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 GaimAccount *account; /**< The account the user is on. */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 char *username; /**< The username the icon belongs to. */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35 void *data; /**< The buddy icon data. */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 size_t len; /**< The length of the buddy icon data. */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38 int ref_count; /**< The buddy icon reference count. */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 };
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41 /**************************************************************************/
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 /** @name Buddy Icon API */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 /**************************************************************************/
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 /*@{*/
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 * Creates a new buddy icon structure.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49 * @param account The account the user is on.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50 * @param username The username the icon belongs to.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 * @param icon_data The buddy icon data.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52 * @param icon_len The buddy icon length.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54 * @return The buddy icon structure.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56 GaimBuddyIcon *gaim_buddy_icon_new(GaimAccount *account, const char *username,
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57 void *icon_data, size_t icon_len);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60 * Destroys a buddy icon structure.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 * If the buddy icon's reference count is greater than 1, this will
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63 * just decrease the reference count and return.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 * @param icon The buddy icon structure to destroy.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 void gaim_buddy_icon_destroy(GaimBuddyIcon *icon);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 * Increments the reference count on a buddy icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 * @param icon The buddy icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 * @return @a icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 GaimBuddyIcon *gaim_buddy_icon_ref(GaimBuddyIcon *icon);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 * Decrements the reference count on a buddy icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 * If the reference count reaches 0, the icon will be destroyed.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 * @param icon The buddy icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 * @return @a icon, or @c NULL if the reference count reached 0.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 GaimBuddyIcon *gaim_buddy_icon_unref(GaimBuddyIcon *icon);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 * Updates every instance of this icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 * @param icon The buddy icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 void gaim_buddy_icon_update(GaimBuddyIcon *icon);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96 /**
6886
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
97 * Caches a buddy icon associated with a specific buddy to disk.
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
98 *
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
99 * @param icon The buddy icon.
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
100 * @param buddy The buddy that this icon belongs to.
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
101 */
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
102 void gaim_buddy_icon_cache(GaimBuddyIcon *icon, GaimBuddy *buddy);
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
103
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
104 /**
6846
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
105 * Sets the buddy icon's account.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107 * @param icon The buddy icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108 * @param account The account.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110 void gaim_buddy_icon_set_account(GaimBuddyIcon *icon, GaimAccount *account);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
112 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
113 * Sets the buddy icon's username.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
114 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115 * @param icon The buddy icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
116 * @param username The username.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
117 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118 void gaim_buddy_icon_set_username(GaimBuddyIcon *icon, const char *username);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
120 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121 * Sets the buddy icon's icon data.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123 * @param icon The buddy icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124 * @param data The buddy icon data.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
125 * @param len The length of the icon data.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
126 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
127 void gaim_buddy_icon_set_data(GaimBuddyIcon *icon, void *data, size_t len);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
128
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
129 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130 * Returns the buddy icon's account.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
131 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
132 * @param icon The buddy icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
133 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
134 * @return The account.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
136 GaimAccount *gaim_buddy_icon_get_account(const GaimBuddyIcon *icon);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
137
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
138 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
139 * Returns the buddy icon's username.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
140 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
141 * @param icon The buddy icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
142 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143 * @return The username.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
145 const char *gaim_buddy_icon_get_username(const GaimBuddyIcon *icon);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
146
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
147 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
148 * Returns the buddy icon's data.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
149 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
150 * @param icon The buddy icon.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
151 * @param len The returned icon length.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
152 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153 * @return The icon data.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
154 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155 const void *gaim_buddy_icon_get_data(const GaimBuddyIcon *icon, size_t *len);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
157 /*@}*/
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
158
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
159 /**************************************************************************/
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
160 /** @name Buddy Icon Subsystem API */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
161 /**************************************************************************/
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
162 /*@{*/
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
163
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
164 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
165 * Sets a buddy icon for a user.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
166 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
167 * @param account The account the user is on.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
168 * @param username The username of the user.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
169 * @param icon_data The icon data.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
170 * @param icon_len The length of the icon data.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
171 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
172 void gaim_buddy_icons_set_for_user(GaimAccount *account, const char *username,
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
173 void *icon_data, size_t icon_len);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
174
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
175 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
176 * Returns the buddy icon information for a user.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
177 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
178 * @param account The account the user is on.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
179 * @param username The username of the user.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
180 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
181 * @return The icon data if found, or @c NULL if not found.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
182 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
183 GaimBuddyIcon *gaim_buddy_icons_find(const GaimAccount *account,
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
184 const char *username);
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
185
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
186 /**
6886
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
187 * Sets whether or not buddy icon caching is enabled.
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
188 *
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
189 * @param caching TRUE of buddy icon caching should be enabled, or
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
190 * FALSE otherwise.
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
191 */
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
192 void gaim_buddy_icons_set_caching(gboolean caching);
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
193
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
194 /**
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
195 * Returns whether or not buddy icon caching should be enabled.
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
196 *
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
197 * The default is TRUE, unless otherwise specified by
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
198 * gaim_buddy_icons_set_caching().
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
199 *
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
200 * @return TRUE if buddy icon caching is enabled, or FALSE otherwise.
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
201 */
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
202 gboolean gaim_buddy_icons_is_caching(void);
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
203
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
204 /**
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
205 * Sets the directory used to store buddy icon cache files.
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
206 *
7114
c47633e9e2a4 [gaim-migrate @ 7681]
Christian Hammond <chipx86@chipx86.com>
parents: 6886
diff changeset
207 * @param cache_dir The directory to store buddy icon cache files to.
6886
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
208 */
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
209 void gaim_buddy_icons_set_cache_dir(const char *cache_dir);
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
210
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
211 /**
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
212 * Returns the directory used to store buddy icon cache files.
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
213 *
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
214 * The default directory is GAIMDIR/icons, unless otherwise specified
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
215 * by gaim_buddy_icons_set_cache_dir().
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
216 *
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
217 * @return The directory to store buddy icon cache files to.
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
218 */
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
219 const char *gaim_buddy_icons_get_cache_dir(void);
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
220
b5fb1d5282e5 [gaim-migrate @ 7432]
Christian Hammond <chipx86@chipx86.com>
parents: 6869
diff changeset
221 /**
6846
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
222 * Returns the buddy icon subsystem handle.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
223 *
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
224 * @return The subsystem handle.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
225 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
226 void *gaim_buddy_icons_get_handle();
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
227
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
228 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
229 * Initializes the buddy icon subsystem.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
230 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
231 void gaim_buddy_icons_init();
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
232
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
233 /**
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
234 * Uninitializes the buddy icon subsystem.
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
235 */
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
236 void gaim_buddy_icons_uninit();
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
237
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
238 /*@}*/
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
239
8ab95f4c9800 [gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
240 #endif /* _GAIM_ICON_H_ */