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 
00097 PurpleSmiley *
00098 purple_smiley_new_from_file(const char *shortcut, const char *filepath);
00099 
00105 void
00106 purple_smiley_delete(PurpleSmiley *smiley);
00107 
00117 gboolean
00118 purple_smiley_set_shortcut(PurpleSmiley *smiley, const char *shortcut);
00119 
00132 void
00133 purple_smiley_set_data(PurpleSmiley *smiley, guchar *smiley_data,
00134                                            size_t smiley_data_len);
00135 
00143 const char *purple_smiley_get_shortcut(const PurpleSmiley *smiley);
00144 
00152 const char *purple_smiley_get_checksum(const PurpleSmiley *smiley);
00153 
00164 PurpleStoredImage *purple_smiley_get_stored_image(const PurpleSmiley *smiley);
00165 
00175 gconstpointer purple_smiley_get_data(const PurpleSmiley *smiley, size_t *len);
00176 
00185 const char *purple_smiley_get_extension(const PurpleSmiley *smiley);
00186 
00202 char *purple_smiley_get_full_path(PurpleSmiley *smiley);
00203 
00207 /**************************************************************************/
00209 /**************************************************************************/
00217 GList *
00218 purple_smileys_get_all(void);
00219 
00228 PurpleSmiley *
00229 purple_smileys_find_by_shortcut(const char *shortcut);
00230 
00239 PurpleSmiley *
00240 purple_smileys_find_by_checksum(const char *checksum);
00241 
00250 const char *purple_smileys_get_storing_dir(void);
00251 
00255 void purple_smileys_init(void);
00256 
00260 void purple_smileys_uninit(void);
00261 
00264 #ifdef __cplusplus
00265 }
00266 #endif
00267 
00268 #endif /* _PURPLE_SMILEY_H_ */
00269