Mercurial > pidgin.yaz
comparison libpurple/disco.h @ 26342:d6b2944f04b3
s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
'type' seems a more reasonable name (category and type are fairly specific
XMPP-isms even though this is basically only ever going to be useful
for XMPP).
Changing the gateway type (i.e. prpl identifier) to a string means adding
them doesn't require minor bumps (and sane fallback methods should be
implementable).
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Wed, 01 Apr 2009 05:26:25 +0000 |
parents | c619bef09bec |
children | 1de01f9594c8 |
comparison
equal
deleted
inserted
replaced
26341:9d0bad6f4b0d | 26342:d6b2944f04b3 |
---|---|
38 * | 38 * |
39 */ | 39 */ |
40 typedef void (*PurpleDiscoCloseCallback) (PurpleDiscoList *list); | 40 typedef void (*PurpleDiscoCloseCallback) (PurpleDiscoList *list); |
41 | 41 |
42 /** | 42 /** |
43 * The categories of services. | 43 * The types of services. |
44 */ | 44 */ |
45 typedef enum | 45 typedef enum |
46 { | 46 { |
47 PURPLE_DISCO_SERVICE_CAT_UNSET, | 47 PURPLE_DISCO_SERVICE_TYPE_UNSET, |
48 PURPLE_DISCO_SERVICE_CAT_GATEWAY, | 48 /** |
49 PURPLE_DISCO_SERVICE_CAT_DIRECTORY, | 49 * A registerable gateway to another protocol. An example would be |
50 PURPLE_DISCO_SERVICE_CAT_MUC, | 50 * XMPP legacy transports. |
51 PURPLE_DISCO_SERVICE_CAT_OTHER | 51 */ |
52 } PurpleDiscoServiceCategory; | 52 PURPLE_DISCO_SERVICE_TYPE_GATEWAY, |
53 | 53 |
54 /** | 54 /** |
55 * The types of services. | 55 * A directory (e.g. allows the user to search for other users). |
56 */ | 56 */ |
57 typedef enum | 57 PURPLE_DISCO_SERVICE_TYPE_DIRECTORY, |
58 { | 58 |
59 PURPLE_DISCO_SERVICE_TYPE_NONE, | 59 /** |
60 PURPLE_DISCO_SERVICE_TYPE_AIM, | 60 * A chat (multi-user conversation). |
61 PURPLE_DISCO_SERVICE_TYPE_GG, | 61 */ |
62 PURPLE_DISCO_SERVICE_TYPE_GTALK, | 62 PURPLE_DISCO_SERVICE_TYPE_CHAT, |
63 PURPLE_DISCO_SERVICE_TYPE_ICQ, | 63 |
64 PURPLE_DISCO_SERVICE_TYPE_IRC, | 64 /** |
65 PURPLE_DISCO_SERVICE_TYPE_MAIL, | 65 * Something else. Do we need more categories? |
66 PURPLE_DISCO_SERVICE_TYPE_MSN, | 66 */ |
67 PURPLE_DISCO_SERVICE_TYPE_USER, | 67 PURPLE_DISCO_SERVICE_TYPE_OTHER |
68 PURPLE_DISCO_SERVICE_TYPE_QQ, | |
69 PURPLE_DISCO_SERVICE_TYPE_XMPP, | |
70 PURPLE_DISCO_SERVICE_TYPE_YAHOO | |
71 } PurpleDiscoServiceType; | 68 } PurpleDiscoServiceType; |
72 | 69 |
73 /** | 70 /** |
74 * The flags of services. | 71 * The flags of services. |
75 */ | 72 */ |
145 void purple_disco_cancel_get_list(PurpleDiscoList *list); | 142 void purple_disco_cancel_get_list(PurpleDiscoList *list); |
146 | 143 |
147 /** | 144 /** |
148 * Create new service object | 145 * Create new service object |
149 */ | 146 */ |
150 PurpleDiscoService *purple_disco_list_service_new(PurpleDiscoServiceCategory category, const gchar *name, | 147 PurpleDiscoService * |
151 PurpleDiscoServiceType type, const gchar *description, PurpleDiscoServiceFlags flags); | 148 purple_disco_list_service_new(PurpleDiscoServiceType type, const gchar *name, |
149 const gchar *description, | |
150 PurpleDiscoServiceFlags flags); | |
152 | 151 |
153 /** | 152 /** |
154 * Add service to list | 153 * Add service to list |
155 */ | 154 */ |
156 void purple_disco_list_service_add(PurpleDiscoList *list, PurpleDiscoService *service, PurpleDiscoService *parent); | 155 void purple_disco_list_service_add(PurpleDiscoList *list, PurpleDiscoService *service, PurpleDiscoService *parent); |
180 * @since TODO | 179 * @since TODO |
181 */ | 180 */ |
182 const gchar* purple_disco_service_get_description(PurpleDiscoService *service); | 181 const gchar* purple_disco_service_get_description(PurpleDiscoService *service); |
183 | 182 |
184 /** | 183 /** |
185 * Return a service's category. | |
186 * | |
187 * @param service The service. | |
188 * @return The category. | |
189 * | |
190 * @since TODO | |
191 */ | |
192 PurpleDiscoServiceCategory purple_disco_service_get_category(PurpleDiscoService *service); | |
193 | |
194 /** | |
195 * Return a service's type. | 184 * Return a service's type. |
196 * | 185 * |
197 * @param service The service. | 186 * @param service The service. |
198 * @return The type. | 187 * @return The type. |
199 * | 188 * |
208 * @return The flags. | 197 * @return The flags. |
209 * | 198 * |
210 * @since TODO | 199 * @since TODO |
211 */ | 200 */ |
212 PurpleDiscoServiceFlags purple_disco_service_get_flags(PurpleDiscoService *service); | 201 PurpleDiscoServiceFlags purple_disco_service_get_flags(PurpleDiscoService *service); |
202 | |
203 /** | |
204 * Set the gateway type for a gateway service. The gateway type is a string | |
205 * that represents a canonical name of the protocol to which this service is | |
206 * a gateway. For example, for an XMPP legacy transport to AIM, this would | |
207 * be "aim". | |
208 * | |
209 * These strings should conform to the names of the libpurple prpls where | |
210 * possible (so a UI can easily map types to icons) and, as a backup, the | |
211 * XMPP registry list of gateways at | |
212 * http://xmpp.org/registrar/disco-categories.html#gateway. | |
213 */ | |
214 void purple_disco_service_set_gateway_type(PurpleDiscoService *service, | |
215 const gchar *type); | |
216 | |
217 /** | |
218 * Get the gateway type for a gateway service. | |
219 * | |
220 * @param service The service. | |
221 * @returns The gateway type or NULL if none was set or service is not | |
222 * a gateway. | |
223 * | |
224 * @see purple_disco_service_set_gateway_type(). | |
225 */ | |
226 const gchar *purple_disco_service_get_gateway_type(PurpleDiscoService *service); | |
227 | |
213 /** | 228 /** |
214 * Get the account associated with a service list. | 229 * Get the account associated with a service list. |
215 * | 230 * |
216 * @param list The service list. | 231 * @param list The service list. |
217 * @return The account | 232 * @return The account |