2 * @file object.h MSNObject API
6 * Purple is the legal property of its developers, whose names are too numerous
7 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
24 #ifndef _MSN_OBJECT_H_
25 #define _MSN_OBJECT_H_
33 MSN_OBJECT_UNKNOWN = -1, /**< Unknown object */
34 MSN_OBJECT_RESERVED1 = 1, /**< Reserved */
35 MSN_OBJECT_EMOTICON = 2, /**< Custom Emoticon */
36 MSN_OBJECT_USERTILE = 3, /**< UserTile (buddy icon) */
37 MSN_OBJECT_RESERVED2 = 4, /**< Reserved */
38 MSN_OBJECT_BACKGROUND = 5 /**< Background */
49 PurpleStoredImage *img;
58 * Creates a MsnObject structure.
60 * @return A new MsnObject structure.
62 MsnObject *msn_object_new(void);
65 * Creates a MsnObject structure from a string.
67 * @param str The string.
69 * @return The new MsnObject structure.
71 MsnObject *msn_object_new_from_string(const char *str);
74 * Creates a MsnObject structure from a stored image
76 * @param img The image associated to object
77 * @param location The object location as stored in MsnObject
78 * @param creator The creator of the object
79 * @param type The type of the object
81 * @return A new MsnObject structure
83 MsnObject *msn_object_new_from_image(PurpleStoredImage *img,
84 const char *location, const char *creator, MsnObjectType type);
87 * Destroys an MsnObject structure.
89 * @param obj The object structure.
91 void msn_object_destroy(MsnObject *obj);
94 * Outputs a string representation of an MsnObject.
96 * @param obj The object.
98 * @return The string representation. This must be freed.
100 char *msn_object_to_string(const MsnObject *obj);
103 * Sets the creator field in a MsnObject.
105 * @param creator The creator value.
107 void msn_object_set_creator(MsnObject *obj, const char *creator);
110 * Sets the size field in a MsnObject.
112 * @param size The size value.
114 void msn_object_set_size(MsnObject *obj, int size);
117 * Sets the type field in a MsnObject.
119 * @param type The type value.
121 void msn_object_set_type(MsnObject *obj, MsnObjectType type);
124 * Sets the location field in a MsnObject.
126 * @param location The location value.
128 void msn_object_set_location(MsnObject *obj, const char *location);
131 * Sets the friendly name field in a MsnObject.
133 * @param friendly The friendly name value.
135 void msn_object_set_friendly(MsnObject *obj, const char *friendly);
138 * Sets the SHA1D field in a MsnObject.
140 * @param sha1d The sha1d value.
142 void msn_object_set_sha1d(MsnObject *obj, const char *sha1d);
145 * Sets the SHA1C field in a MsnObject.
147 * @param sha1c The sha1c value.
149 void msn_object_set_sha1c(MsnObject *obj, const char *sha1c);
152 * Associates an image with a MsnObject.
154 * @param obj The object.
155 * @param img The image to associate.
157 void msn_object_set_image(MsnObject *obj, PurpleStoredImage *img);
160 * Returns a MsnObject's creator value.
162 * @param obj The object.
164 * @return The creator value.
166 const char *msn_object_get_creator(const MsnObject *obj);
169 * Returns a MsnObject's size value.
171 * @param obj The object.
173 * @return The size value.
175 int msn_object_get_size(const MsnObject *obj);
178 * Returns a MsnObject's type.
180 * @param obj The object.
182 * @return The object type.
184 MsnObjectType msn_object_get_type(const MsnObject *obj);
187 * Returns a MsnObject's location value.
189 * @param obj The object.
191 * @return The location value.
193 const char *msn_object_get_location(const MsnObject *obj);
196 * Returns a MsnObject's friendly name value.
198 * @param obj The object.
200 * @return The friendly name value.
202 const char *msn_object_get_friendly(const MsnObject *obj);
205 * Returns a MsnObject's SHA1D value.
207 * @param obj The object.
209 * @return The SHA1D value.
211 const char *msn_object_get_sha1d(const MsnObject *obj);
214 * Returns a MsnObject's SHA1C value.
216 * @param obj The object.
218 * @return The SHA1C value.
220 const char *msn_object_get_sha1c(const MsnObject *obj);
223 * Returns a MsnObject's SHA1C value if it exists, otherwise SHA1D.
225 * @param obj The object.
227 * @return The SHA1C value.
229 const char *msn_object_get_sha1(const MsnObject *obj);
232 * Returns the image associated with the MsnObject.
234 * @param obj The object.
236 * @return The associated image.
238 PurpleStoredImage *msn_object_get_image(const MsnObject *obj);
240 void msn_object_set_local(MsnObject *obj);
242 #endif /* _MSN_OBJECT_H_ */