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 
00335 PurpleStoredImage *
00336 purple_buddy_icons_node_set_custom_icon_from_file(PurpleBlistNode *node,
00337                                                   const gchar *filename);
00338 
00339 #ifndef PURPLE_DISABLE_DEPRECATED
00340 
00347 gboolean
00348 purple_buddy_icons_has_custom_icon(PurpleContact *contact);
00349 
00357 PurpleStoredImage *
00358 purple_buddy_icons_find_custom_icon(PurpleContact *contact);
00359 
00367 PurpleStoredImage *
00368 purple_buddy_icons_set_custom_icon(PurpleContact *contact,
00369                                    guchar *icon_data, size_t icon_len);
00370 #endif
00371 
00378 void purple_buddy_icons_set_caching(gboolean caching);
00379 
00388 gboolean purple_buddy_icons_is_caching(void);
00389 
00395 void purple_buddy_icons_set_cache_dir(const char *cache_dir);
00396 
00405 const char *purple_buddy_icons_get_cache_dir(void);
00406 
00412 void *purple_buddy_icons_get_handle(void);
00413 
00417 void purple_buddy_icons_init(void);
00418 
00422 void purple_buddy_icons_uninit(void);
00423 
00426 /**************************************************************************/
00428 /**************************************************************************/
00434 void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int *height);
00435 
00438 #ifdef __cplusplus
00439 }
00440 #endif
00441 
00442 #endif /* _PURPLE_BUDDYICON_H_ */

Generated on Sun Sep 21 12:18:43 2008 for pidgin by  doxygen 1.5.5