|
9193
|
1 /**
|
|
|
2 * @file object.h MSNObject API
|
|
|
3 *
|
|
|
4 * gaim
|
|
|
5 *
|
|
|
6 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org>
|
|
|
7 *
|
|
|
8 * This program is free software; you can redistribute it and/or modify
|
|
|
9 * it under the terms of the GNU General Public License as published by
|
|
|
10 * the Free Software Foundation; either version 2 of the License, or
|
|
|
11 * (at your option) any later version.
|
|
|
12 *
|
|
|
13 * This program is distributed in the hope that it will be useful,
|
|
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
16 * GNU General Public License for more details.
|
|
|
17 *
|
|
|
18 * You should have received a copy of the GNU General Public License
|
|
|
19 * along with this program; if not, write to the Free Software
|
|
|
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
21 */
|
|
|
22 #ifndef _MSN_OBJECT_H_
|
|
|
23 #define _MSN_OBJECT_H_
|
|
|
24
|
|
|
25 #include "internal.h"
|
|
|
26
|
|
|
27 typedef enum
|
|
|
28 {
|
|
|
29 MSN_OBJECT_UNKNOWN = -1, /**< Unknown object */
|
|
|
30 MSN_OBJECT_RESERVED1 = 1, /**< Reserved */
|
|
|
31 MSN_OBJECT_EMOTICON = 2, /**< Custom Emoticon */
|
|
|
32 MSN_OBJECT_USERTILE = 3, /**< UserTile (buddy icon) */
|
|
|
33 MSN_OBJECT_RESERVED2 = 4, /**< Reserved */
|
|
|
34 MSN_OBJECT_BACKGROUND = 5 /**< Background */
|
|
|
35
|
|
|
36 } MsnObjectType;
|
|
|
37
|
|
|
38 typedef struct
|
|
|
39 {
|
|
|
40 gboolean local;
|
|
|
41
|
|
|
42 char *creator;
|
|
|
43 int size;
|
|
|
44 MsnObjectType type;
|
|
|
45 char *real_location;
|
|
|
46 char *location;
|
|
|
47 char *friendly;
|
|
|
48 char *sha1d;
|
|
|
49 char *sha1c;
|
|
|
50
|
|
|
51 } MsnObject;
|
|
|
52
|
|
|
53 /**
|
|
|
54 * Creates a MsnObject structure.
|
|
|
55 *
|
|
|
56 * @return A new MsnObject structure.
|
|
|
57 */
|
|
|
58 MsnObject *msn_object_new();
|
|
|
59
|
|
|
60 /**
|
|
|
61 * Creates a MsnObject structure from a string.
|
|
|
62 *
|
|
|
63 * @param str The string.
|
|
|
64 *
|
|
|
65 * @return The new MsnObject structure.
|
|
|
66 */
|
|
|
67 MsnObject *msn_object_new_from_string(const char *str);
|
|
|
68
|
|
|
69 /**
|
|
|
70 * Destroys an MsnObject structure.
|
|
|
71 *
|
|
|
72 * @param obj The object structure.
|
|
|
73 */
|
|
|
74 void msn_object_destroy(MsnObject *obj);
|
|
|
75
|
|
|
76 /**
|
|
|
77 * Outputs a string representation of an MsnObject.
|
|
|
78 *
|
|
|
79 * @param obj The object.
|
|
|
80 *
|
|
|
81 * @return The string representation. This must be freed.
|
|
|
82 */
|
|
|
83 char *msn_object_to_string(const MsnObject *obj);
|
|
|
84
|
|
|
85 /**
|
|
|
86 * Sets the creator field in a MsnObject.
|
|
|
87 *
|
|
|
88 * @param creator The creator value.
|
|
|
89 */
|
|
|
90 void msn_object_set_creator(MsnObject *obj, const char *creator);
|
|
|
91
|
|
|
92 /**
|
|
|
93 * Sets the size field in a MsnObject.
|
|
|
94 *
|
|
|
95 * @param size The size value.
|
|
|
96 */
|
|
|
97 void msn_object_set_size(MsnObject *obj, int size);
|
|
|
98
|
|
|
99 /**
|
|
|
100 * Sets the type field in a MsnObject.
|
|
|
101 *
|
|
|
102 * @param type The type value.
|
|
|
103 */
|
|
|
104 void msn_object_set_type(MsnObject *obj, MsnObjectType type);
|
|
|
105
|
|
|
106 /**
|
|
|
107 * Sets the location field in a MsnObject.
|
|
|
108 *
|
|
|
109 * @param location The location value.
|
|
|
110 */
|
|
|
111 void msn_object_set_location(MsnObject *obj, const char *location);
|
|
|
112
|
|
|
113 /**
|
|
|
114 * Sets the friendly name field in a MsnObject.
|
|
|
115 *
|
|
|
116 * @param friendly The friendly name value.
|
|
|
117 */
|
|
|
118 void msn_object_set_friendly(MsnObject *obj, const char *friendly);
|
|
|
119
|
|
|
120 /**
|
|
|
121 * Sets the SHA1D field in a MsnObject.
|
|
|
122 *
|
|
|
123 * @param sha1d The sha1d value.
|
|
|
124 */
|
|
|
125 void msn_object_set_sha1d(MsnObject *obj, const char *sha1d);
|
|
|
126
|
|
|
127 /**
|
|
|
128 * Sets the SHA1C field in a MsnObject.
|
|
|
129 *
|
|
|
130 * @param sha1c The sha1c value.
|
|
|
131 */
|
|
|
132 void msn_object_set_sha1c(MsnObject *obj, const char *sha1c);
|
|
|
133
|
|
|
134 /**
|
|
|
135 * Returns a MsnObject's creator value.
|
|
|
136 *
|
|
|
137 * @param obj The object.
|
|
|
138 *
|
|
|
139 * @return The creator value.
|
|
|
140 */
|
|
|
141 const char *msn_object_get_creator(const MsnObject *obj);
|
|
|
142
|
|
|
143 /**
|
|
|
144 * Returns a MsnObject's size value.
|
|
|
145 *
|
|
|
146 * @param obj The object.
|
|
|
147 *
|
|
|
148 * @return The size value.
|
|
|
149 */
|
|
|
150 int msn_object_get_size(const MsnObject *obj);
|
|
|
151
|
|
|
152 /**
|
|
|
153 * Returns a MsnObject's type.
|
|
|
154 *
|
|
|
155 * @param obj The object.
|
|
|
156 *
|
|
|
157 * @return The object type.
|
|
|
158 */
|
|
|
159 MsnObjectType msn_object_get_type(const MsnObject *obj);
|
|
|
160
|
|
|
161 /**
|
|
|
162 * Returns a MsnObject's location value.
|
|
|
163 *
|
|
|
164 * @param obj The object.
|
|
|
165 *
|
|
|
166 * @return The location value.
|
|
|
167 */
|
|
|
168 const char *msn_object_get_location(const MsnObject *obj);
|
|
|
169
|
|
|
170 /**
|
|
|
171 * Returns a MsnObject's friendly name value.
|
|
|
172 *
|
|
|
173 * @param obj The object.
|
|
|
174 *
|
|
|
175 * @return The friendly name value.
|
|
|
176 */
|
|
|
177 const char *msn_object_get_friendly(const MsnObject *obj);
|
|
|
178
|
|
|
179 /**
|
|
|
180 * Returns a MsnObject's SHA1D value.
|
|
|
181 *
|
|
|
182 * @param obj The object.
|
|
|
183 *
|
|
|
184 * @return The SHA1D value.
|
|
|
185 */
|
|
|
186 const char *msn_object_get_sha1d(const MsnObject *obj);
|
|
|
187
|
|
|
188 /**
|
|
|
189 * Returns a MsnObject's SHA1C value.
|
|
|
190 *
|
|
|
191 * @param obj The object.
|
|
|
192 *
|
|
|
193 * @return The SHA1C value.
|
|
|
194 */
|
|
|
195 const char *msn_object_get_sha1c(const MsnObject *obj);
|
|
|
196
|
|
|
197 void msn_object_set_local(MsnObject *obj);
|
|
|
198 const char *msn_object_get_real_location(const MsnObject *obj);
|
|
|
199 void msn_object_set_real_location(MsnObject *obj,
|
|
|
200 const char *real_location);
|
|
|
201
|
|
|
202 #endif /* _MSN_OBJECT_H_ */
|