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 /**************************************************************************/
00193 void
00194 purple_buddy_icons_set_for_user(PurpleAccount *account, const char *username,
00195                                 void *icon_data, size_t icon_len,
00196                                 const char *checksum);
00197 
00208 const char *
00209 purple_buddy_icons_get_checksum_for_user(PurpleBuddy *buddy);
00210 
00220 PurpleBuddyIcon *
00221 purple_buddy_icons_find(PurpleAccount *account, const char *username);
00222 
00237 PurpleStoredImage *
00238 purple_buddy_icons_find_account_icon(PurpleAccount *account);
00239 
00255 PurpleStoredImage *
00256 purple_buddy_icons_set_account_icon(PurpleAccount *account,
00257                                     guchar *icon_data, size_t icon_len);
00258 
00269 time_t
00270 purple_buddy_icons_get_account_icon_timestamp(PurpleAccount *account);
00271 
00280 gboolean
00281 purple_buddy_icons_node_has_custom_icon(PurpleBlistNode *node);
00282 
00298 PurpleStoredImage *
00299 purple_buddy_icons_node_find_custom_icon(PurpleBlistNode *node);
00300 
00316 PurpleStoredImage *
00317 purple_buddy_icons_node_set_custom_icon(PurpleBlistNode *node,
00318                                         guchar *icon_data, size_t icon_len);
00319 
00334 PurpleStoredImage *
00335 purple_buddy_icons_node_set_custom_icon_from_file(PurpleBlistNode *node,
00336                                                   const gchar *filename);
00337 
00338 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BUDDYICON_C_)
00339 
00346 gboolean
00347 purple_buddy_icons_has_custom_icon(PurpleContact *contact);
00348 
00356 PurpleStoredImage *
00357 purple_buddy_icons_find_custom_icon(PurpleContact *contact);
00358 
00366 PurpleStoredImage *
00367 purple_buddy_icons_set_custom_icon(PurpleContact *contact,
00368                                    guchar *icon_data, size_t icon_len);
00369 #endif
00370 
00377 void purple_buddy_icons_set_caching(gboolean caching);
00378 
00387 gboolean purple_buddy_icons_is_caching(void);
00388 
00394 void purple_buddy_icons_set_cache_dir(const char *cache_dir);
00395 
00404 const char *purple_buddy_icons_get_cache_dir(void);
00405 
00411 void *purple_buddy_icons_get_handle(void);
00412 
00416 void purple_buddy_icons_init(void);
00417 
00421 void purple_buddy_icons_uninit(void);
00422 
00425 /**************************************************************************/
00427 /**************************************************************************/
00433 void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int *height);
00434 
00437 #ifdef __cplusplus
00438 }
00439 #endif
00440 
00441 #endif /* _PURPLE_BUDDYICON_H_ */