Mercurial > pidgin
comparison libpurple/request.h @ 21218:9faacf8aa044
Missing buddylist request field stuff.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Thu, 04 Oct 2007 04:15:56 +0000 |
parents | 6bf32c9e15a7 |
children | e98c08afb706 593d119b7980 |
comparison
equal
deleted
inserted
replaced
21217:0af37f1abb17 | 21218:9faacf8aa044 |
---|---|
59 PURPLE_REQUEST_FIELD_BOOLEAN, | 59 PURPLE_REQUEST_FIELD_BOOLEAN, |
60 PURPLE_REQUEST_FIELD_CHOICE, | 60 PURPLE_REQUEST_FIELD_CHOICE, |
61 PURPLE_REQUEST_FIELD_LIST, | 61 PURPLE_REQUEST_FIELD_LIST, |
62 PURPLE_REQUEST_FIELD_LABEL, | 62 PURPLE_REQUEST_FIELD_LABEL, |
63 PURPLE_REQUEST_FIELD_IMAGE, | 63 PURPLE_REQUEST_FIELD_IMAGE, |
64 PURPLE_REQUEST_FIELD_ACCOUNT | 64 PURPLE_REQUEST_FIELD_ACCOUNT, |
65 PURPLE_REQUEST_FIELD_BLIST, | |
65 | 66 |
66 } PurpleRequestFieldType; | 67 } PurpleRequestFieldType; |
67 | 68 |
68 /** | 69 /** |
69 * Multiple fields request data. | 70 * Multiple fields request data. |
90 char *title; | 91 char *title; |
91 | 92 |
92 GList *fields; | 93 GList *fields; |
93 | 94 |
94 } PurpleRequestFieldGroup; | 95 } PurpleRequestFieldGroup; |
96 | |
97 /** | |
98 * Flags that can be used for Buddylist Fields. | |
99 */ | |
100 typedef enum | |
101 { | |
102 PURPLE_REQUEST_BLIST_FLAG_BUDDY = 0x01, /**< Include buddies in the list. */ | |
103 PURPLE_REQUEST_BLIST_FLAG_CHAT = 0x02, /**< Include chats in the list. */ | |
104 PURPLE_REQUEST_BLIST_FLAG_GROUP = 0x04, /**< Include groups in the list. */ | |
105 PURPLE_REQUEST_BLIST_FLAG_ALLOW_OFFLINE = 0x08, /**< Include offline buddies in the list. */ | |
106 } PurpleRequestBlistFlags; | |
95 | 107 |
96 /** | 108 /** |
97 * A request field. | 109 * A request field. |
98 */ | 110 */ |
99 typedef struct | 111 typedef struct |
169 unsigned int scale_x; | 181 unsigned int scale_x; |
170 unsigned int scale_y; | 182 unsigned int scale_y; |
171 const char *buffer; | 183 const char *buffer; |
172 gsize size; | 184 gsize size; |
173 } image; | 185 } image; |
186 | |
187 struct | |
188 { | |
189 GList *default_nodes; | |
190 PurpleRequestBlistFlags flags; | |
191 GList *selecteds; | |
192 PurpleFilterBlistFunc filter; | |
193 } blist; | |
174 | 194 |
175 } u; | 195 } u; |
176 | 196 |
177 void *ui_data; | 197 void *ui_data; |
178 | 198 |
1149 const PurpleRequestField *field); | 1169 const PurpleRequestField *field); |
1150 | 1170 |
1151 /*@}*/ | 1171 /*@}*/ |
1152 | 1172 |
1153 /**************************************************************************/ | 1173 /**************************************************************************/ |
1174 /** @name Buddylist Field API */ | |
1175 /**************************************************************************/ | |
1176 /*@{*/ | |
1177 | |
1178 /** | |
1179 * Creates a buddylist field. | |
1180 * | |
1181 * @param id The field ID. | |
1182 * @param text The label for the field. | |
1183 * @param flag Flags dictating what kind of blist nodes should be | |
1184 * included in the request field. | |
1185 * @param selected A list of PurpleBlistNode's to select by default, or @c NULL. | |
1186 * | |
1187 * @return The new field. | |
1188 */ | |
1189 PurpleRequestField *purple_request_field_blist_nodes_new(const char *id, const char *text, | |
1190 PurpleRequestBlistFlags flag, GList *selected); | |
1191 | |
1192 /** | |
1193 * Set a filter for the request field. | |
1194 * | |
1195 * @param field The request field. | |
1196 * @param filter The filter function. | |
1197 * | |
1198 * @return The old filter function, or @c NULL if there was none. | |
1199 */ | |
1200 PurpleFilterBlistFunc purple_request_field_blist_set_filter(PurpleRequestField *field, PurpleFilterBlistFunc filter); | |
1201 | |
1202 /** | |
1203 * Get the filter function for the request field. | |
1204 * | |
1205 * @param field The request field. | |
1206 * | |
1207 * @return The filter function, or @c NULL if there isn't any. | |
1208 */ | |
1209 PurpleFilterBlistFunc purple_request_field_blist_get_filter(const PurpleRequestField *field); | |
1210 | |
1211 /** | |
1212 * Add a PurpleBlistNode to the selected list. | |
1213 * | |
1214 * @param field The request field. | |
1215 * @param node The buddylist node to add to the list. | |
1216 * | |
1217 * @return @c TRUE if the node is added to the list, @c FALSE if it was already in the list. | |
1218 */ | |
1219 gboolean purple_request_field_blist_add(PurpleRequestField *field, PurpleBlistNode *node); | |
1220 | |
1221 /** | |
1222 * Remove a PurpleBlistNode from the selected list. | |
1223 * | |
1224 * @param field The request field. | |
1225 * @param node The buddylist node to remove from the list. | |
1226 * | |
1227 * @return @c TRUE if the node is removed from the list, @c FALSE if the node is not in the list. | |
1228 */ | |
1229 gboolean purple_request_field_blist_remove(PurpleRequestField *field, PurpleBlistNode *node); | |
1230 | |
1231 /** | |
1232 * Set the list of selected nodes in the request field. | |
1233 * | |
1234 * @param field The request field. | |
1235 * @param selecteds The list of selected PurpleBlistNode's. Note that the request field | |
1236 * becomes the owner of the list, and so the caller should not modify it. | |
1237 */ | |
1238 void purple_request_field_blist_set_selection_list(PurpleRequestField *field, GList *selecteds); | |
1239 | |
1240 /** | |
1241 * Get a list of the selected buddylist nodes. | |
1242 * | |
1243 * @param field The request field. | |
1244 * | |
1245 * @return A GList of PurpleBlistNode's. | |
1246 */ | |
1247 GList *purple_request_field_blist_get_selection_list(const PurpleRequestField *field); | |
1248 | |
1249 /*@}*/ | |
1250 | |
1251 /**************************************************************************/ | |
1154 /** @name Request API */ | 1252 /** @name Request API */ |
1155 /**************************************************************************/ | 1253 /**************************************************************************/ |
1156 /*@{*/ | 1254 /*@{*/ |
1157 | 1255 |
1158 /** | 1256 /** |