pidgin: buddyicon.h Source File

pidgin 2.14.4

Loading...
Searching...
No Matches
buddyicon.h
Go to the documentation of this file.
1
6/* purple
7 *
8 * Purple is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 */
26#ifndef _PURPLE_BUDDYICON_H_
27#define _PURPLE_BUDDYICON_H_
28
34 typedef struct _PurpleBuddyIcon PurpleBuddyIcon;
35
36#include "account.h"
37#include "blist.h"
38#include "imgstore.h"
39#include "prpl.h"
40#include "util.h"
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46
47/**************************************************************************/
49/**************************************************************************/
66 PurpleBuddyIcon *purple_buddy_icon_new(PurpleAccount *account, const char *username,
67 void *icon_data, size_t icon_len,
68 const char *checksum);
69
77 PurpleBuddyIcon *purple_buddy_icon_ref(PurpleBuddyIcon *icon);
78
88 PurpleBuddyIcon *purple_buddy_icon_unref(PurpleBuddyIcon *icon);
89
95 void purple_buddy_icon_update(PurpleBuddyIcon *icon);
96
106void
107purple_buddy_icon_set_data(PurpleBuddyIcon *icon, guchar *data,
108 size_t len, const char *checksum);
109
117 PurpleAccount *purple_buddy_icon_get_account(const PurpleBuddyIcon *icon);
118
126 const char *purple_buddy_icon_get_username(const PurpleBuddyIcon *icon);
127
137 const char *purple_buddy_icon_get_checksum(const PurpleBuddyIcon *icon);
138
148gconstpointer purple_buddy_icon_get_data(const PurpleBuddyIcon *icon, size_t *len);
149
158 const char *purple_buddy_icon_get_extension(const PurpleBuddyIcon *icon);
159
174 char *purple_buddy_icon_get_full_path(PurpleBuddyIcon *icon);
175
178/**************************************************************************/
180/**************************************************************************/
193void
194purple_buddy_icons_set_for_user(PurpleAccount *account, const char *username,
195 void *icon_data, size_t icon_len,
196 const char *checksum);
197
208const char *
209purple_buddy_icons_get_checksum_for_user(PurpleBuddy *buddy);
210
220 PurpleBuddyIcon *
221purple_buddy_icons_find(PurpleAccount *account, const char *username);
222
237 PurpleStoredImage *
238purple_buddy_icons_find_account_icon(PurpleAccount *account);
239
255 PurpleStoredImage *
256purple_buddy_icons_set_account_icon(PurpleAccount *account,
257 guchar *icon_data, size_t icon_len);
258
269time_t
270purple_buddy_icons_get_account_icon_timestamp(PurpleAccount *account);
271
280gboolean
281purple_buddy_icons_node_has_custom_icon(PurpleBlistNode *node);
282
298 PurpleStoredImage *
299purple_buddy_icons_node_find_custom_icon(PurpleBlistNode *node);
300
316 PurpleStoredImage *
317purple_buddy_icons_node_set_custom_icon(PurpleBlistNode *node,
318 guchar *icon_data, size_t icon_len);
319
334 PurpleStoredImage *
335purple_buddy_icons_node_set_custom_icon_from_file(PurpleBlistNode *node,
336 const gchar *filename);
337
338#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BUDDYICON_C_)
346gboolean
347purple_buddy_icons_has_custom_icon(PurpleContact *contact);
348
356 PurpleStoredImage *
357purple_buddy_icons_find_custom_icon(PurpleContact *contact);
358
366 PurpleStoredImage *
367purple_buddy_icons_set_custom_icon(PurpleContact *contact,
368 guchar *icon_data, size_t icon_len);
369#endif
370
377 void purple_buddy_icons_set_caching(gboolean caching);
378
387gboolean purple_buddy_icons_is_caching(void);
388
394 void purple_buddy_icons_set_cache_dir(const char *cache_dir);
395
404 const char *purple_buddy_icons_get_cache_dir(void);
405
411 void *purple_buddy_icons_get_handle(void);
412
416 void purple_buddy_icons_init(void);
417
421 void purple_buddy_icons_uninit(void);
422
425/**************************************************************************/
427/**************************************************************************/
433 void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int *height);
434
437#ifdef __cplusplus
438}
439#endif
440
441#endif /* _PURPLE_BUDDYICON_H_ */
account.h
Account API.
blist.h
Buddy List API.
purple_buddy_icons_get_account_icon_timestamp
time_t purple_buddy_icons_get_account_icon_timestamp(PurpleAccount *account)
Returns the timestamp of when the icon was set.
purple_buddy_icons_find
PurpleBuddyIcon * purple_buddy_icons_find(PurpleAccount *account, const char *username)
Returns the buddy icon information for a user.
purple_buddy_icon_get_full_path
char * purple_buddy_icon_get_full_path(PurpleBuddyIcon *icon)
Returns a full path to an icon.
PurpleBuddyIcon
struct _PurpleBuddyIcon PurpleBuddyIcon
An opaque structure representing a buddy icon for a particular user on a particular PurpleAccount.
Definition: buddyicon.h:34
purple_buddy_icons_set_for_user
void purple_buddy_icons_set_for_user(PurpleAccount *account, const char *username, void *icon_data, size_t icon_len, const char *checksum)
Sets a buddy icon for a user.
purple_buddy_icon_get_username
const char * purple_buddy_icon_get_username(const PurpleBuddyIcon *icon)
Returns the buddy icon's username.
purple_buddy_icons_get_cache_dir
const char * purple_buddy_icons_get_cache_dir(void)
Returns the directory used to store buddy icon cache files.
purple_buddy_icon_unref
PurpleBuddyIcon * purple_buddy_icon_unref(PurpleBuddyIcon *icon)
Decrements the reference count on a buddy icon.
purple_buddy_icons_find_custom_icon
PurpleStoredImage * purple_buddy_icons_find_custom_icon(PurpleContact *contact)
PurpleContact version of purple_buddy_icons_node_find_custom_icon.
purple_buddy_icons_get_checksum_for_user
const char * purple_buddy_icons_get_checksum_for_user(PurpleBuddy *buddy)
Returns the checksum for the buddy icon of a specified buddy.
purple_buddy_icons_node_set_custom_icon
PurpleStoredImage * purple_buddy_icons_node_set_custom_icon(PurpleBlistNode *node, guchar *icon_data, size_t icon_len)
Sets a custom buddy icon for a blist node.
purple_buddy_icons_uninit
void purple_buddy_icons_uninit(void)
Uninitializes the buddy icon subsystem.
purple_buddy_icons_has_custom_icon
gboolean purple_buddy_icons_has_custom_icon(PurpleContact *contact)
PurpleContact version of purple_buddy_icons_node_has_custom_icon.
purple_buddy_icon_new
PurpleBuddyIcon * purple_buddy_icon_new(PurpleAccount *account, const char *username, void *icon_data, size_t icon_len, const char *checksum)
Creates a new buddy icon structure and populates it.
purple_buddy_icons_set_cache_dir
void purple_buddy_icons_set_cache_dir(const char *cache_dir)
Sets the directory used to store buddy icon cache files.
purple_buddy_icons_find_account_icon
PurpleStoredImage * purple_buddy_icons_find_account_icon(PurpleAccount *account)
Returns the buddy icon image for an account.
purple_buddy_icons_set_custom_icon
PurpleStoredImage * purple_buddy_icons_set_custom_icon(PurpleContact *contact, guchar *icon_data, size_t icon_len)
PurpleContact version of purple_buddy_icons_node_set_custom_icon.
purple_buddy_icons_node_set_custom_icon_from_file
PurpleStoredImage * purple_buddy_icons_node_set_custom_icon_from_file(PurpleBlistNode *node, const gchar *filename)
Sets a custom buddy icon for a blist node.
purple_buddy_icon_get_checksum
const char * purple_buddy_icon_get_checksum(const PurpleBuddyIcon *icon)
Returns the buddy icon's checksum.
purple_buddy_icons_get_handle
void * purple_buddy_icons_get_handle(void)
Returns the buddy icon subsystem handle.
purple_buddy_icon_get_data
gconstpointer purple_buddy_icon_get_data(const PurpleBuddyIcon *icon, size_t *len)
Returns the buddy icon's data.
purple_buddy_icons_set_account_icon
PurpleStoredImage * purple_buddy_icons_set_account_icon(PurpleAccount *account, guchar *icon_data, size_t icon_len)
Sets a buddy icon for an account.
purple_buddy_icons_node_has_custom_icon
gboolean purple_buddy_icons_node_has_custom_icon(PurpleBlistNode *node)
Returns a boolean indicating if a given blist node has a custom buddy icon.
purple_buddy_icon_update
void purple_buddy_icon_update(PurpleBuddyIcon *icon)
Updates every instance of this icon.
purple_buddy_icon_get_extension
const char * purple_buddy_icon_get_extension(const PurpleBuddyIcon *icon)
Returns an extension corresponding to the buddy icon's file type.
purple_buddy_icon_get_scale_size
void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int *height)
Gets display size for a buddy icon.
purple_buddy_icon_get_account
PurpleAccount * purple_buddy_icon_get_account(const PurpleBuddyIcon *icon)
Returns the buddy icon's account.
purple_buddy_icon_ref
PurpleBuddyIcon * purple_buddy_icon_ref(PurpleBuddyIcon *icon)
Increments the reference count on a buddy icon.
purple_buddy_icons_set_caching
void purple_buddy_icons_set_caching(gboolean caching)
Sets whether or not buddy icon caching is enabled.
purple_buddy_icons_is_caching
gboolean purple_buddy_icons_is_caching(void)
Returns whether or not buddy icon caching should be enabled.
purple_buddy_icons_node_find_custom_icon
PurpleStoredImage * purple_buddy_icons_node_find_custom_icon(PurpleBlistNode *node)
Returns the custom buddy icon image for a blist node.
purple_buddy_icons_init
void purple_buddy_icons_init(void)
Initializes the buddy icon subsystem.
purple_buddy_icon_set_data
void purple_buddy_icon_set_data(PurpleBuddyIcon *icon, guchar *data, size_t len, const char *checksum)
Sets the buddy icon's data.
imgstore.h
IM Image Store API.
PurpleStoredImage
struct _PurpleStoredImage PurpleStoredImage
A set of utility functions that provide a reference-counted immutable wrapper around an image's data ...
Definition: imgstore.h:37
prpl.h
Protocol Plugin functions.
_PurpleAccount
Structure representing an account.
Definition: account.h:170
_PurpleBlistNode
A Buddy list node.
Definition: blist.h:126
_PurpleBuddyIconSpec
A description of a Buddy Icon specification.
Definition: prpl.h:85
_PurpleBuddy
A buddy.
Definition: blist.h:140
_PurpleContact
A contact.
Definition: blist.h:155
util.h
Utility Functions.