smiley.h

Go to the documentation of this file.
00001 
00007 /* purple
00008  *
00009  * Purple is the legal property of its developers, whose names are too numerous
00010  * to list here.  Please refer to the COPYRIGHT file distributed with this
00011  * source distribution.
00012  *
00013  * This program is free software; you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation; either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * This program is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to the Free Software
00025  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00026  *
00027  */
00028 
00029 #ifndef _PURPLE_SMILEY_H_
00030 #define _PURPLE_SMILEY_H_
00031 
00032 #include <glib-object.h>
00033 
00034 #include "imgstore.h"
00035 #include "util.h"
00036 
00044 typedef struct _PurpleSmiley        PurpleSmiley;
00045 typedef struct _PurpleSmileyClass   PurpleSmileyClass;
00046 
00047 #define PURPLE_TYPE_SMILEY             (purple_smiley_get_type ())
00048 #define PURPLE_SMILEY(smiley)          (G_TYPE_CHECK_INSTANCE_CAST ((smiley), PURPLE_TYPE_SMILEY, PurpleSmiley))
00049 #define PURPLE_SMILEY_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), PURPLE_TYPE_SMILEY, PurpleSmileyClass))
00050 #define PURPLE_IS_SMILEY(smiley)       (G_TYPE_CHECK_INSTANCE_TYPE ((smiley), PURPLE_TYPE_SMILEY))
00051 #define PURPLE_IS_SMILEY_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), PURPLE_TYPE_SMILEY))
00052 #define PURPLE_SMILEY_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), PURPLE_TYPE_SMILEY, PurpleSmileyClass))
00053 
00054 #ifdef __cplusplus
00055 extern "C" {
00056 #endif
00057 
00058 /**************************************************************************/
00060 /**************************************************************************/
00067 GType purple_smiley_get_type(void);
00068 
00080 PurpleSmiley *
00081 purple_smiley_new(PurpleStoredImage *img, const char *shortcut);
00082 
00094 PurpleSmiley *
00095 purple_smiley_new_from_file(const char *shortcut, const char *filepath);
00096 
00102 void
00103 purple_smiley_delete(PurpleSmiley *smiley);
00104 
00114 gboolean
00115 purple_smiley_set_shortcut(PurpleSmiley *smiley, const char *shortcut);
00116 
00125 void
00126 purple_smiley_set_data(PurpleSmiley *smiley, guchar *smiley_data,
00127                                            size_t smiley_data_len);
00128 
00136 const char *purple_smiley_get_shortcut(const PurpleSmiley *smiley);
00137 
00145 const char *purple_smiley_get_checksum(const PurpleSmiley *smiley);
00146 
00157 PurpleStoredImage *purple_smiley_get_stored_image(const PurpleSmiley *smiley);
00158 
00168 gconstpointer purple_smiley_get_data(const PurpleSmiley *smiley, size_t *len);
00169 
00178 const char *purple_smiley_get_extension(const PurpleSmiley *smiley);
00179 
00197 char *purple_smiley_get_full_path(PurpleSmiley *smiley);
00198 
00202 /**************************************************************************/
00204 /**************************************************************************/
00213 GList *
00214 purple_smileys_get_all(void);
00215 
00223 PurpleSmiley *
00224 purple_smileys_find_by_shortcut(const char *shortcut);
00225 
00233 PurpleSmiley *
00234 purple_smileys_find_by_checksum(const char *checksum);
00235 
00243 const char *purple_smileys_get_storing_dir(void);
00244 
00248 void purple_smileys_init(void);
00249 
00253 void purple_smileys_uninit(void);
00254 
00257 #ifdef __cplusplus
00258 }
00259 #endif
00260 
00261 #endif /* _PURPLE_SMILEY_H_ */
00262