buddyicon.h

Go to the documentation of this file.
00001 
00006 /* purple
00007  *
00008  * Purple is the legal property of its developers, whose names are too numerous
00009  * to list here.  Please refer to the COPYRIGHT file distributed with this
00010  * source distribution.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00025  */
00026 #ifndef _PURPLE_BUDDYICON_H_
00027 #define _PURPLE_BUDDYICON_H_
00028 
00034 typedef struct _PurpleBuddyIcon PurpleBuddyIcon;
00035 
00036 #include "account.h"
00037 #include "blist.h"
00038 #include "imgstore.h"
00039 #include "prpl.h"
00040 #include "util.h"
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 
00047 /**************************************************************************/
00049 /**************************************************************************/
00066 PurpleBuddyIcon *purple_buddy_icon_new(PurpleAccount *account, const char *username,
00067                                        void *icon_data, size_t icon_len,
00068                                        const char *checksum);
00069 
00077 PurpleBuddyIcon *purple_buddy_icon_ref(PurpleBuddyIcon *icon);
00078 
00088 PurpleBuddyIcon *purple_buddy_icon_unref(PurpleBuddyIcon *icon);
00089 
00095 void purple_buddy_icon_update(PurpleBuddyIcon *icon);
00096 
00106 void
00107 purple_buddy_icon_set_data(PurpleBuddyIcon *icon, guchar *data,
00108                            size_t len, const char *checksum);
00109 
00117 PurpleAccount *purple_buddy_icon_get_account(const PurpleBuddyIcon *icon);
00118 
00126 const char *purple_buddy_icon_get_username(const PurpleBuddyIcon *icon);
00127 
00137 const char *purple_buddy_icon_get_checksum(const PurpleBuddyIcon *icon);
00138 
00148 gconstpointer purple_buddy_icon_get_data(const PurpleBuddyIcon *icon, size_t *len);
00149 
00158 const char *purple_buddy_icon_get_extension(const PurpleBuddyIcon *icon);
00159 
00174 char *purple_buddy_icon_get_full_path(PurpleBuddyIcon *icon);
00175 
00178 /**************************************************************************/
00180 /**************************************************************************/
00195 void
00196 purple_buddy_icons_set_for_user(PurpleAccount *account, const char *username,
00197                                 void *icon_data, size_t icon_len,
00198                                 const char *checksum);
00199 
00210 const char *
00211 purple_buddy_icons_get_checksum_for_user(PurpleBuddy *buddy);
00212 
00222 PurpleBuddyIcon *
00223 purple_buddy_icons_find(PurpleAccount *account, const char *username);
00224 
00239 PurpleStoredImage *
00240 purple_buddy_icons_find_account_icon(PurpleAccount *account);
00241 
00257 PurpleStoredImage *
00258 purple_buddy_icons_set_account_icon(PurpleAccount *account,
00259                                     guchar *icon_data, size_t icon_len);
00260 
00271 time_t
00272 purple_buddy_icons_get_account_icon_timestamp(PurpleAccount *account);
00273 
00282 gboolean
00283 purple_buddy_icons_node_has_custom_icon(PurpleBlistNode *node);
00284 
00300 PurpleStoredImage *
00301 purple_buddy_icons_node_find_custom_icon(PurpleBlistNode *node);
00302 
00318 PurpleStoredImage *
00319 purple_buddy_icons_node_set_custom_icon(PurpleBlistNode *node,
00320                                         guchar *icon_data, size_t icon_len);
00321 
00336 PurpleStoredImage *
00337 purple_buddy_icons_node_set_custom_icon_from_file(PurpleBlistNode *node,
00338                                                   const gchar *filename);
00339 
00340 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BUDDYICON_C_)
00341 
00348 gboolean
00349 purple_buddy_icons_has_custom_icon(PurpleContact *contact);
00350 
00358 PurpleStoredImage *
00359 purple_buddy_icons_find_custom_icon(PurpleContact *contact);
00360 
00368 PurpleStoredImage *
00369 purple_buddy_icons_set_custom_icon(PurpleContact *contact,
00370                                    guchar *icon_data, size_t icon_len);
00371 #endif
00372 
00379 void purple_buddy_icons_set_caching(gboolean caching);
00380 
00389 gboolean purple_buddy_icons_is_caching(void);
00390 
00396 void purple_buddy_icons_set_cache_dir(const char *cache_dir);
00397 
00406 const char *purple_buddy_icons_get_cache_dir(void);
00407 
00413 void *purple_buddy_icons_get_handle(void);
00414 
00418 void purple_buddy_icons_init(void);
00419 
00423 void purple_buddy_icons_uninit(void);
00424 
00427 /**************************************************************************/
00429 /**************************************************************************/
00435 void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int *height);
00436 
00439 #ifdef __cplusplus
00440 }
00441 #endif
00442 
00443 #endif /* _PURPLE_BUDDYICON_H_ */