Mercurial > pidgin.yaz
comparison libpurple/request.h @ 21227:059d6deebee7
propagate from branch 'org.maemo.garage.pidgin.pidgin.dialog-transience' (head 49d0219884ede2c6c571f2df73e29dffa86f54ad)
to branch 'im.pidgin.pidgin.next.minor' (head 6f090c623ea4e9357e5b4238348a888b4c869ab7)
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sat, 13 Oct 2007 23:32:54 +0000 |
parents | e98c08afb706 |
children | 0b67d509a305 ad718740aa71 |
comparison
equal
deleted
inserted
replaced
21093:5e46cdf9ef2b | 21227:059d6deebee7 |
---|---|
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 * @since 2.3.0 | |
1190 */ | |
1191 PurpleRequestField *purple_request_field_blist_nodes_new(const char *id, const char *text, | |
1192 PurpleRequestBlistFlags flag, GList *selected); | |
1193 | |
1194 /** | |
1195 * Set a filter for the request field. | |
1196 * | |
1197 * @param field The request field. | |
1198 * @param filter The filter function. | |
1199 * | |
1200 * @return The old filter function, or @c NULL if there was none. | |
1201 * | |
1202 * @since 2.3.0 | |
1203 */ | |
1204 PurpleFilterBlistFunc purple_request_field_blist_set_filter(PurpleRequestField *field, PurpleFilterBlistFunc filter); | |
1205 | |
1206 /** | |
1207 * Get the filter function for the request field. | |
1208 * | |
1209 * @param field The request field. | |
1210 * | |
1211 * @return The filter function, or @c NULL if there isn't any. | |
1212 * | |
1213 * @since 2.3.0 | |
1214 */ | |
1215 PurpleFilterBlistFunc purple_request_field_blist_get_filter(const PurpleRequestField *field); | |
1216 | |
1217 /** | |
1218 * Add a PurpleBlistNode to the selected list. | |
1219 * | |
1220 * @param field The request field. | |
1221 * @param node The buddylist node to add to the list. | |
1222 * | |
1223 * @return @c TRUE if the node is added to the list, @c FALSE if it was already in the list. | |
1224 * | |
1225 * @since 2.3.0 | |
1226 */ | |
1227 gboolean purple_request_field_blist_add(PurpleRequestField *field, PurpleBlistNode *node); | |
1228 | |
1229 /** | |
1230 * Remove a PurpleBlistNode from the selected list. | |
1231 * | |
1232 * @param field The request field. | |
1233 * @param node The buddylist node to remove from the list. | |
1234 * | |
1235 * @return @c TRUE if the node is removed from the list, @c FALSE if the node is not in the list. | |
1236 * | |
1237 * @since 2.3.0 | |
1238 */ | |
1239 gboolean purple_request_field_blist_remove(PurpleRequestField *field, PurpleBlistNode *node); | |
1240 | |
1241 /** | |
1242 * Set the list of selected nodes in the request field. | |
1243 * | |
1244 * @param field The request field. | |
1245 * @param selecteds The list of selected PurpleBlistNode's. Note that the request field | |
1246 * becomes the owner of the list, and so the caller should not modify it. | |
1247 * | |
1248 * @since 2.3.0 | |
1249 */ | |
1250 void purple_request_field_blist_set_selection_list(PurpleRequestField *field, GList *selecteds); | |
1251 | |
1252 /** | |
1253 * Get a list of the selected buddylist nodes. | |
1254 * | |
1255 * @param field The request field. | |
1256 * | |
1257 * @return A GList of PurpleBlistNode's. | |
1258 * | |
1259 * @since 2.3.0 | |
1260 */ | |
1261 GList *purple_request_field_blist_get_selection_list(const PurpleRequestField *field); | |
1262 | |
1263 /*@}*/ | |
1264 | |
1265 /**************************************************************************/ | |
1154 /** @name Request API */ | 1266 /** @name Request API */ |
1155 /**************************************************************************/ | 1267 /**************************************************************************/ |
1156 /*@{*/ | 1268 /*@{*/ |
1157 | 1269 |
1158 /** | 1270 /** |