comparison libpurple/request.h @ 21566:593d119b7980

disapproval of revision 'c52c996c95bec84928db81dc592640366ff5a432'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 14 Nov 2007 02:40:56 +0000
parents 9faacf8aa044
children d98b612d3f75
comparison
equal deleted inserted replaced
21218:9faacf8aa044 21566:593d119b7980
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,
66 65
67 } PurpleRequestFieldType; 66 } PurpleRequestFieldType;
68 67
69 /** 68 /**
70 * Multiple fields request data. 69 * Multiple fields request data.
91 char *title; 90 char *title;
92 91
93 GList *fields; 92 GList *fields;
94 93
95 } PurpleRequestFieldGroup; 94 } 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;
107 95
108 /** 96 /**
109 * A request field. 97 * A request field.
110 */ 98 */
111 typedef struct 99 typedef struct
181 unsigned int scale_x; 169 unsigned int scale_x;
182 unsigned int scale_y; 170 unsigned int scale_y;
183 const char *buffer; 171 const char *buffer;
184 gsize size; 172 gsize size;
185 } image; 173 } image;
186
187 struct
188 {
189 GList *default_nodes;
190 PurpleRequestBlistFlags flags;
191 GList *selecteds;
192 PurpleFilterBlistFunc filter;
193 } blist;
194 174
195 } u; 175 } u;
196 176
197 void *ui_data; 177 void *ui_data;
198 178
1169 const PurpleRequestField *field); 1149 const PurpleRequestField *field);
1170 1150
1171 /*@}*/ 1151 /*@}*/
1172 1152
1173 /**************************************************************************/ 1153 /**************************************************************************/
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 /**************************************************************************/
1252 /** @name Request API */ 1154 /** @name Request API */
1253 /**************************************************************************/ 1155 /**************************************************************************/
1254 /*@{*/ 1156 /*@{*/
1255 1157
1256 /** 1158 /**