buddyicon.h
Go to the documentation of this file.
/* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PURPLE_BUDDYICON_H_
#define _PURPLE_BUDDYICON_H_
typedef struct _PurpleBuddyIcon PurpleBuddyIcon;
#include "account.h"
#include "blist.h"
#include "imgstore.h"
#include "prpl.h"
#include "util.h"
#ifdef __cplusplus
extern "C" {
#endif
/**************************************************************************/
/**************************************************************************/
PurpleBuddyIcon *purple_buddy_icon_new(PurpleAccount *account, const char *username,
void *icon_data, size_t icon_len,
const char *checksum);
PurpleBuddyIcon *purple_buddy_icon_ref(PurpleBuddyIcon *icon);
PurpleBuddyIcon *purple_buddy_icon_unref(PurpleBuddyIcon *icon);
void purple_buddy_icon_update(PurpleBuddyIcon *icon);
void
purple_buddy_icon_set_data(PurpleBuddyIcon *icon, guchar *data,
size_t len, const char *checksum);
PurpleAccount *purple_buddy_icon_get_account(const PurpleBuddyIcon *icon);
const char *purple_buddy_icon_get_username(const PurpleBuddyIcon *icon);
const char *purple_buddy_icon_get_checksum(const PurpleBuddyIcon *icon);
gconstpointer purple_buddy_icon_get_data(const PurpleBuddyIcon *icon, size_t *len);
const char *purple_buddy_icon_get_extension(const PurpleBuddyIcon *icon);
char *purple_buddy_icon_get_full_path(PurpleBuddyIcon *icon);
/**************************************************************************/
/**************************************************************************/
void
purple_buddy_icons_set_for_user(PurpleAccount *account, const char *username,
void *icon_data, size_t icon_len,
const char *checksum);
const char *
purple_buddy_icons_get_checksum_for_user(PurpleBuddy *buddy);
PurpleBuddyIcon *
purple_buddy_icons_find(PurpleAccount *account, const char *username);
PurpleStoredImage *
purple_buddy_icons_find_account_icon(PurpleAccount *account);
PurpleStoredImage *
purple_buddy_icons_set_account_icon(PurpleAccount *account,
guchar *icon_data, size_t icon_len);
time_t
purple_buddy_icons_get_account_icon_timestamp(PurpleAccount *account);
gboolean
purple_buddy_icons_node_has_custom_icon(PurpleBlistNode *node);
PurpleStoredImage *
purple_buddy_icons_node_find_custom_icon(PurpleBlistNode *node);
PurpleStoredImage *
purple_buddy_icons_node_set_custom_icon(PurpleBlistNode *node,
guchar *icon_data, size_t icon_len);
PurpleStoredImage *
purple_buddy_icons_node_set_custom_icon_from_file(PurpleBlistNode *node,
const gchar *filename);
#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BUDDYICON_C_)
gboolean
purple_buddy_icons_has_custom_icon(PurpleContact *contact);
PurpleStoredImage *
purple_buddy_icons_find_custom_icon(PurpleContact *contact);
PurpleStoredImage *
purple_buddy_icons_set_custom_icon(PurpleContact *contact,
guchar *icon_data, size_t icon_len);
#endif
void purple_buddy_icons_set_caching(gboolean caching);
gboolean purple_buddy_icons_is_caching(void);
void purple_buddy_icons_set_cache_dir(const char *cache_dir);
const char *purple_buddy_icons_get_cache_dir(void);
void *purple_buddy_icons_get_handle(void);
void purple_buddy_icons_init(void);
void purple_buddy_icons_uninit(void);
/**************************************************************************/
/**************************************************************************/
void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int *height);
#ifdef __cplusplus
}
#endif
#endif /* _PURPLE_BUDDYICON_H_ */
prpl.h
purple_buddy_icon_get_checksum
const char * purple_buddy_icon_get_checksum(const PurpleBuddyIcon *icon)
Returns the buddy icon's checksum.
purple_buddy_icons_init
void purple_buddy_icons_init(void)
Initializes the buddy icon subsystem.
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_icon_get_data
gconstpointer purple_buddy_icon_get_data(const PurpleBuddyIcon *icon, size_t *len)
Returns the buddy icon's data.
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_unref
PurpleBuddyIcon * purple_buddy_icon_unref(PurpleBuddyIcon *icon)
Decrements the reference count on a buddy icon.
account.h
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
purple_buddy_icons_find
PurpleBuddyIcon * purple_buddy_icons_find(PurpleAccount *account, const char *username)
Returns the buddy icon information for a user.
_PurpleBuddyIconSpec
A description of a Buddy Icon specification.
Definition: prpl.h:85
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.
blist.h
purple_buddy_icons_get_handle
void * purple_buddy_icons_get_handle(void)
Returns the buddy icon subsystem handle.
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_set_caching
void purple_buddy_icons_set_caching(gboolean caching)
Sets whether or not buddy icon caching is enabled.
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_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_username
const char * purple_buddy_icon_get_username(const PurpleBuddyIcon *icon)
Returns the buddy icon's username.
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_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_icon_get_account
PurpleAccount * purple_buddy_icon_get_account(const PurpleBuddyIcon *icon)
Returns the buddy icon's account.
_PurpleAccount
Structure representing an account.
Definition: account.h:169
_PurpleBlistNode
A Buddy list node.
Definition: blist.h:124
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_icon_update
void purple_buddy_icon_update(PurpleBuddyIcon *icon)
Updates every instance of this 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_icon_ref
PurpleBuddyIcon * purple_buddy_icon_ref(PurpleBuddyIcon *icon)
Increments the reference count on a buddy icon.
_PurpleContact
A contact.
Definition: blist.h:153
purple_buddy_icons_uninit
void purple_buddy_icons_uninit(void)
Uninitializes the buddy icon subsystem.
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_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_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.
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_icon_get_full_path
char * purple_buddy_icon_get_full_path(PurpleBuddyIcon *icon)
Returns a full path to an icon.
util.h
_PurpleBuddy
A buddy.
Definition: blist.h:138
imgstore.h
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_is_caching
gboolean purple_buddy_icons_is_caching(void)
Returns whether or not buddy icon caching should be enabled.
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_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_get_cache_dir
const char * purple_buddy_icons_get_cache_dir(void)
Returns the directory used to store buddy icon cache files.
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.