comparison libpurple/imgstore.h @ 15374:5fe8042783c1

Rename gtk/ and libgaim/ to pidgin/ and libpurple/
author Sean Egan <seanegan@gmail.com>
date Sat, 20 Jan 2007 02:32:10 +0000
parents
children 32c366eeeb99
comparison
equal deleted inserted replaced
15373:f79e0f4df793 15374:5fe8042783c1
1 /**
2 * @file imgstore.h IM Image Store API
3 * @ingroup core
4 *
5 * gaim
6 *
7 * Gaim is the legal property of its developers, whose names are too numerous
8 * to list here. Please refer to the COPYRIGHT file distributed with this
9 * source distribution.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 */
26 #ifndef _GAIM_IMGSTORE_H_
27 #define _GAIM_IMGSTORE_H_
28
29 struct _GaimStoredImage;
30 typedef struct _GaimStoredImage GaimStoredImage;
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 /**
37 * Add an image to the store. The caller owns a reference
38 * to the image in the store, and must dereference the image
39 * with gaim_imgstore_unref for it to be freed.
40 *
41 * @param data Pointer to the image data.
42 * @param size Image data's size.
43 * @param filename Filename associated with image.
44
45 * @return ID for the image.
46 */
47 int gaim_imgstore_add(const void *data, size_t size, const char *filename);
48
49 /**
50 * Retrieve an image from the store. The caller does not own a
51 * reference to the image.
52 *
53 * @param id The ID for the image.
54 *
55 * @return A pointer to the requested image, or NULL if it was not found.
56 */
57 GaimStoredImage *gaim_imgstore_get(int id);
58
59 /**
60 * Retrieves a pointer to the image's data.
61 *
62 * @param i The Image
63 *
64 * @return A pointer to the data, which must not
65 * be freed or modified.
66 */
67 gpointer gaim_imgstore_get_data(GaimStoredImage *i);
68
69 /**
70 * Retrieves the length of the image's data.
71 *
72 * @param i The Image
73 *
74 * @return The size of the data that the pointer returned by
75 * gaim_imgstore_get_data points to.
76 */
77 size_t gaim_imgstore_get_size(GaimStoredImage *i);
78
79 /**
80 * Retrieves a pointer to the image's filename.
81 *
82 * @param i The Image
83 *
84 * @return A pointer to the filename, which must not
85 * be freed or modified.
86 */
87 const char *gaim_imgstore_get_filename(GaimStoredImage *i);
88
89 /**
90 * Increment the reference count for an image in the store. The
91 * image will be removed from the store when the reference count
92 * is zero.
93 *
94 * @param id The ID for the image.
95 */
96 void gaim_imgstore_ref(int id);
97
98 /**
99 * Decrement the reference count for an image in the store. The
100 * image will be removed from the store when the reference count
101 * is zero.
102 *
103 * @param id The ID for the image.
104 */
105 void gaim_imgstore_unref(int id);
106
107 #ifdef __cplusplus
108 }
109 #endif
110
111 #endif /* _GAIM_IMGSTORE_H_ */