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 
00029 typedef struct _PurpleBuddyIcon PurpleBuddyIcon;
00030 
00031 #include "account.h"
00032 #include "blist.h"
00033 #include "imgstore.h"
00034 #include "prpl.h"
00035 #include "util.h"
00036 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 
00042 /**************************************************************************/
00044 /**************************************************************************/
00061 PurpleBuddyIcon *purple_buddy_icon_new(PurpleAccount *account, const char *username,
00062                                        void *icon_data, size_t icon_len,
00063                                        const char *checksum);
00064 
00072 PurpleBuddyIcon *purple_buddy_icon_ref(PurpleBuddyIcon *icon);
00073 
00083 PurpleBuddyIcon *purple_buddy_icon_unref(PurpleBuddyIcon *icon);
00084 
00090 void purple_buddy_icon_update(PurpleBuddyIcon *icon);
00091 
00101 void
00102 purple_buddy_icon_set_data(PurpleBuddyIcon *icon, guchar *data,
00103                            size_t len, const char *checksum);
00104 
00112 PurpleAccount *purple_buddy_icon_get_account(const PurpleBuddyIcon *icon);
00113 
00121 const char *purple_buddy_icon_get_username(const PurpleBuddyIcon *icon);
00122 
00132 const char *purple_buddy_icon_get_checksum(const PurpleBuddyIcon *icon);
00133 
00143 gconstpointer purple_buddy_icon_get_data(const PurpleBuddyIcon *icon, size_t *len);
00144 
00153 const char *purple_buddy_icon_get_extension(const PurpleBuddyIcon *icon);
00154 
00169 char *purple_buddy_icon_get_full_path(PurpleBuddyIcon *icon);
00170 
00173 /**************************************************************************/
00175 /**************************************************************************/
00190 void
00191 purple_buddy_icons_set_for_user(PurpleAccount *account, const char *username,
00192                                 void *icon_data, size_t icon_len,
00193                                 const char *checksum);
00194 
00205 const char *
00206 purple_buddy_icons_get_checksum_for_user(PurpleBuddy *buddy);
00207 
00217 PurpleBuddyIcon *
00218 purple_buddy_icons_find(PurpleAccount *account, const char *username);
00219 
00227 gboolean
00228 purple_buddy_icons_has_custom_icon(PurpleContact *contact);
00229 
00244 PurpleStoredImage *
00245 purple_buddy_icons_find_account_icon(PurpleAccount *account);
00246 
00262 PurpleStoredImage *
00263 purple_buddy_icons_set_account_icon(PurpleAccount *account,
00264                                     guchar *icon_data, size_t icon_len);
00265 
00276 time_t
00277 purple_buddy_icons_get_account_icon_timestamp(PurpleAccount *account);
00278 
00293 PurpleStoredImage *
00294 purple_buddy_icons_find_custom_icon(PurpleContact *contact);
00295 
00311 PurpleStoredImage *
00312 purple_buddy_icons_set_custom_icon(PurpleContact *contact,
00313                                    guchar *icon_data, size_t icon_len);
00314 
00321 void purple_buddy_icons_set_caching(gboolean caching);
00322 
00331 gboolean purple_buddy_icons_is_caching(void);
00332 
00338 void purple_buddy_icons_set_cache_dir(const char *cache_dir);
00339 
00348 const char *purple_buddy_icons_get_cache_dir(void);
00349 
00355 void *purple_buddy_icons_get_handle(void);
00356 
00360 void purple_buddy_icons_init(void);
00361 
00365 void purple_buddy_icons_uninit(void);
00366 
00369 /**************************************************************************/
00371 /**************************************************************************/
00377 void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int *height);
00378 
00381 #ifdef __cplusplus
00382 }
00383 #endif
00384 
00385 #endif /* _PURPLE_BUDDYICON_H_ */