request.h
Go to the documentation of this file.
1
6 /* purple
7 *
8 * Purple is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 */
26 #ifndef _PURPLE_REQUEST_H_
27 #define _PURPLE_REQUEST_H_
28
29 #include <stdlib.h>
30 #include <glib-object.h>
31 #include <glib.h>
32
34 typedef struct _PurpleRequestField PurpleRequestField;
35
36 #include "account.h"
37
38 #define PURPLE_DEFAULT_ACTION_NONE -1
39
43 typedef enum
44 {
45 PURPLE_REQUEST_INPUT = 0,
46 PURPLE_REQUEST_CHOICE,
47 PURPLE_REQUEST_ACTION,
48 PURPLE_REQUEST_FIELDS,
49 PURPLE_REQUEST_FILE,
50 PURPLE_REQUEST_FOLDER
52 } PurpleRequestType;
53
57 typedef enum
58 {
59 PURPLE_REQUEST_FIELD_NONE,
60 PURPLE_REQUEST_FIELD_STRING,
61 PURPLE_REQUEST_FIELD_INTEGER,
62 PURPLE_REQUEST_FIELD_BOOLEAN,
63 PURPLE_REQUEST_FIELD_CHOICE,
64 PURPLE_REQUEST_FIELD_LIST,
65 PURPLE_REQUEST_FIELD_LABEL,
66 PURPLE_REQUEST_FIELD_IMAGE,
67 PURPLE_REQUEST_FIELD_ACCOUNT
68
69 } PurpleRequestFieldType;
70
74 typedef struct
75 {
76 GList *groups;
77
78 GHashTable *fields;
79
80 GList *required_fields;
81
82 void *ui_data;
83
84 } PurpleRequestFields;
85
89 typedef struct
90 {
91 PurpleRequestFields *fields_list;
92
93 char *title;
94
95 GList *fields;
96
97 } PurpleRequestFieldGroup;
98
99 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_REQUEST_C_)
100
103 struct _PurpleRequestField
104 {
105 PurpleRequestFieldType type;
106 PurpleRequestFieldGroup *group;
107
108 char *id;
109 char *label;
110 char *type_hint;
111
112 gboolean visible;
113 gboolean required;
114
115 union
116 {
117 struct
118 {
119 gboolean multiline;
120 gboolean masked;
121 gboolean editable;
122 char *default_value;
123 char *value;
124
125 } string;
126
127 struct
128 {
129 int default_value;
130 int value;
131
132 } integer;
133
134 struct
135 {
136 gboolean default_value;
137 gboolean value;
138
139 } boolean;
140
141 struct
142 {
143 int default_value;
144 int value;
145
146 GList *labels;
147
148 } choice;
149
150 struct
151 {
152 GList *items;
153 GList *icons;
154 GHashTable *item_data;
155 GList *selected;
156 GHashTable *selected_table;
157
158 gboolean multiple_selection;
159
160 } list;
161
162 struct
163 {
164 PurpleAccount *default_account;
165 PurpleAccount *account;
166 gboolean show_all;
167
168 PurpleFilterAccountFunc filter_func;
169
170 } account;
171
172 struct
173 {
174 unsigned int scale_x;
175 unsigned int scale_y;
176 const char *buffer;
177 gsize size;
178 } image;
179
180 } u;
181
182 void *ui_data;
183
184 };
185 #endif
186
190 typedef struct
191 {
193 void *(*request_input)(const char *title, const char *primary,
194 const char *secondary, const char *default_value,
195 gboolean multiline, gboolean masked, gchar *hint,
196 const char *ok_text, GCallback ok_cb,
197 const char *cancel_text, GCallback cancel_cb,
198 PurpleAccount *account, const char *who,
199 PurpleConversation *conv, void *user_data);
200
202 void *(*request_choice)(const char *title, const char *primary,
203 const char *secondary, int default_value,
204 const char *ok_text, GCallback ok_cb,
205 const char *cancel_text, GCallback cancel_cb,
206 PurpleAccount *account, const char *who,
207 PurpleConversation *conv, void *user_data,
208 va_list choices);
209
211 void *(*request_action)(const char *title, const char *primary,
212 const char *secondary, int default_action,
213 PurpleAccount *account, const char *who,
214 PurpleConversation *conv, void *user_data,
215 size_t action_count, va_list actions);
216
218 void *(*request_fields)(const char *title, const char *primary,
219 const char *secondary, PurpleRequestFields *fields,
220 const char *ok_text, GCallback ok_cb,
221 const char *cancel_text, GCallback cancel_cb,
222 PurpleAccount *account, const char *who,
223 PurpleConversation *conv, void *user_data);
224
226 void *(*request_file)(const char *title, const char *filename,
227 gboolean savedialog, GCallback ok_cb,
228 GCallback cancel_cb, PurpleAccount *account,
229 const char *who, PurpleConversation *conv,
230 void *user_data);
231
232 void (*close_request)(PurpleRequestType type, void *ui_handle);
233
235 void *(*request_folder)(const char *title, const char *dirname,
236 GCallback ok_cb, GCallback cancel_cb,
237 PurpleAccount *account, const char *who,
238 PurpleConversation *conv, void *user_data);
239
241 void *(*request_action_with_icon)(const char *title, const char *primary,
242 const char *secondary, int default_action,
243 PurpleAccount *account, const char *who,
244 PurpleConversation *conv,
245 gconstpointer icon_data, gsize icon_size,
246 void *user_data,
247 size_t action_count, va_list actions);
248
249 void (*_purple_reserved1)(void);
250 void (*_purple_reserved2)(void);
251 void (*_purple_reserved3)(void);
252 } PurpleRequestUiOps;
253
254 typedef void (*PurpleRequestInputCb)(void *, const char *);
255
260 typedef void (*PurpleRequestActionCb)(void *, int);
261 typedef void (*PurpleRequestChoiceCb)(void *, int);
262 typedef void (*PurpleRequestFieldsCb)(void *, PurpleRequestFields *fields);
263 typedef void (*PurpleRequestFileCb)(void *, const char *filename);
264
265 #ifdef __cplusplus
266 extern "C" {
267 #endif
268
269 /**************************************************************************/
271 /**************************************************************************/
279 PurpleRequestFields *purple_request_fields_new(void);
280
286 void purple_request_fields_destroy(PurpleRequestFields *fields);
287
294 void purple_request_fields_add_group(PurpleRequestFields *fields,
295 PurpleRequestFieldGroup *group);
296
304 GList *purple_request_fields_get_groups(const PurpleRequestFields *fields);
305
314 gboolean purple_request_fields_exists(const PurpleRequestFields *fields,
315 const char *id);
316
324 GList *purple_request_fields_get_required(const PurpleRequestFields *fields);
325
334 gboolean purple_request_fields_is_field_required(const PurpleRequestFields *fields,
335 const char *id);
336
344 gboolean purple_request_fields_all_required_filled(
345 const PurpleRequestFields *fields);
346
355 PurpleRequestField *purple_request_fields_get_field(
356 const PurpleRequestFields *fields, const char *id);
357
366 const char *purple_request_fields_get_string(const PurpleRequestFields *fields,
367 const char *id);
368
377 int purple_request_fields_get_integer(const PurpleRequestFields *fields,
378 const char *id);
379
388 gboolean purple_request_fields_get_bool(const PurpleRequestFields *fields,
389 const char *id);
390
399 int purple_request_fields_get_choice(const PurpleRequestFields *fields,
400 const char *id);
401
410 PurpleAccount *purple_request_fields_get_account(const PurpleRequestFields *fields,
411 const char *id);
412
415 /**************************************************************************/
417 /**************************************************************************/
427 PurpleRequestFieldGroup *purple_request_field_group_new(const char *title);
428
434 void purple_request_field_group_destroy(PurpleRequestFieldGroup *group);
435
442 void purple_request_field_group_add_field(PurpleRequestFieldGroup *group,
443 PurpleRequestField *field);
444
452 const char *purple_request_field_group_get_title(
453 const PurpleRequestFieldGroup *group);
454
462 GList *purple_request_field_group_get_fields(
463 const PurpleRequestFieldGroup *group);
464
467 /**************************************************************************/
469 /**************************************************************************/
481 PurpleRequestField *purple_request_field_new(const char *id, const char *text,
482 PurpleRequestFieldType type);
483
489 void purple_request_field_destroy(PurpleRequestField *field);
490
497 void purple_request_field_set_label(PurpleRequestField *field, const char *label);
498
505 void purple_request_field_set_visible(PurpleRequestField *field, gboolean visible);
506
516 void purple_request_field_set_type_hint(PurpleRequestField *field,
517 const char *type_hint);
518
525 void purple_request_field_set_required(PurpleRequestField *field,
526 gboolean required);
527
535 PurpleRequestFieldType purple_request_field_get_type(const PurpleRequestField *field);
536
546 PurpleRequestFieldGroup *purple_request_field_get_group(const PurpleRequestField *field);
547
555 const char *purple_request_field_get_id(const PurpleRequestField *field);
556
564 const char *purple_request_field_get_label(const PurpleRequestField *field);
565
573 gboolean purple_request_field_is_visible(const PurpleRequestField *field);
574
582 const char *purple_request_field_get_type_hint(const PurpleRequestField *field);
583
591 gboolean purple_request_field_is_required(const PurpleRequestField *field);
592
602 gpointer purple_request_field_get_ui_data(const PurpleRequestField *field);
603
614 void purple_request_field_set_ui_data(PurpleRequestField *field,
615 gpointer ui_data);
616
619 /**************************************************************************/
621 /**************************************************************************/
634 PurpleRequestField *purple_request_field_string_new(const char *id,
635 const char *text,
636 const char *default_value,
637 gboolean multiline);
638
645 void purple_request_field_string_set_default_value(PurpleRequestField *field,
646 const char *default_value);
647
654 void purple_request_field_string_set_value(PurpleRequestField *field,
655 const char *value);
656
664 void purple_request_field_string_set_masked(PurpleRequestField *field,
665 gboolean masked);
666
673 void purple_request_field_string_set_editable(PurpleRequestField *field,
674 gboolean editable);
675
683 const char *purple_request_field_string_get_default_value(
684 const PurpleRequestField *field);
685
693 const char *purple_request_field_string_get_value(const PurpleRequestField *field);
694
702 gboolean purple_request_field_string_is_multiline(const PurpleRequestField *field);
703
711 gboolean purple_request_field_string_is_masked(const PurpleRequestField *field);
712
720 gboolean purple_request_field_string_is_editable(const PurpleRequestField *field);
721
724 /**************************************************************************/
726 /**************************************************************************/
738 PurpleRequestField *purple_request_field_int_new(const char *id,
739 const char *text,
740 int default_value);
741
748 void purple_request_field_int_set_default_value(PurpleRequestField *field,
749 int default_value);
750
757 void purple_request_field_int_set_value(PurpleRequestField *field, int value);
758
766 int purple_request_field_int_get_default_value(const PurpleRequestField *field);
767
775 int purple_request_field_int_get_value(const PurpleRequestField *field);
776
779 /**************************************************************************/
781 /**************************************************************************/
795 PurpleRequestField *purple_request_field_bool_new(const char *id,
796 const char *text,
797 gboolean default_value);
798
805 void purple_request_field_bool_set_default_value(PurpleRequestField *field,
806 gboolean default_value);
807
814 void purple_request_field_bool_set_value(PurpleRequestField *field,
815 gboolean value);
816
824 gboolean purple_request_field_bool_get_default_value(
825 const PurpleRequestField *field);
826
834 gboolean purple_request_field_bool_get_value(const PurpleRequestField *field);
835
838 /**************************************************************************/
840 /**************************************************************************/
854 PurpleRequestField *purple_request_field_choice_new(const char *id,
855 const char *text,
856 int default_value);
857
864 void purple_request_field_choice_add(PurpleRequestField *field,
865 const char *label);
866
873 void purple_request_field_choice_set_default_value(PurpleRequestField *field,
874 int default_value);
875
882 void purple_request_field_choice_set_value(PurpleRequestField *field, int value);
883
891 int purple_request_field_choice_get_default_value(const PurpleRequestField *field);
892
900 int purple_request_field_choice_get_value(const PurpleRequestField *field);
901
909 GList *purple_request_field_choice_get_labels(const PurpleRequestField *field);
910
913 /**************************************************************************/
915 /**************************************************************************/
926 PurpleRequestField *purple_request_field_list_new(const char *id, const char *text);
927
935 void purple_request_field_list_set_multi_select(PurpleRequestField *field,
936 gboolean multi_select);
937
945 gboolean purple_request_field_list_get_multi_select(
946 const PurpleRequestField *field);
947
956 void *purple_request_field_list_get_data(const PurpleRequestField *field,
957 const char *text);
958
968 void purple_request_field_list_add(PurpleRequestField *field,
969 const char *item, void *data);
970
979 void purple_request_field_list_add_icon(PurpleRequestField *field,
980 const char *item, const char* icon_path, void* data);
981
988 void purple_request_field_list_add_selected(PurpleRequestField *field,
989 const char *item);
990
996 void purple_request_field_list_clear_selected(PurpleRequestField *field);
997
1004 void purple_request_field_list_set_selected(PurpleRequestField *field,
1005 GList *items);
1006
1015 gboolean purple_request_field_list_is_selected(const PurpleRequestField *field,
1016 const char *item);
1017
1028 GList *purple_request_field_list_get_selected(
1029 const PurpleRequestField *field);
1030
1038 GList *purple_request_field_list_get_items(const PurpleRequestField *field);
1039
1050 GList *purple_request_field_list_get_icons(const PurpleRequestField *field);
1051
1054 /**************************************************************************/
1056 /**************************************************************************/
1067 PurpleRequestField *purple_request_field_label_new(const char *id,
1068 const char *text);
1069
1072 /**************************************************************************/
1074 /**************************************************************************/
1087 PurpleRequestField *purple_request_field_image_new(const char *id, const char *text,
1088 const char *buf, gsize size);
1089
1097 void purple_request_field_image_set_scale(PurpleRequestField *field, unsigned int x, unsigned int y);
1098
1106 const char *purple_request_field_image_get_buffer(PurpleRequestField *field);
1107
1115 gsize purple_request_field_image_get_size(PurpleRequestField *field);
1116
1124 unsigned int purple_request_field_image_get_scale_x(PurpleRequestField *field);
1125
1133 unsigned int purple_request_field_image_get_scale_y(PurpleRequestField *field);
1134
1137 /**************************************************************************/
1139 /**************************************************************************/
1153 PurpleRequestField *purple_request_field_account_new(const char *id,
1154 const char *text,
1155 PurpleAccount *account);
1156
1163 void purple_request_field_account_set_default_value(PurpleRequestField *field,
1164 PurpleAccount *default_value);
1165
1172 void purple_request_field_account_set_value(PurpleRequestField *field,
1173 PurpleAccount *value);
1174
1184 void purple_request_field_account_set_show_all(PurpleRequestField *field,
1185 gboolean show_all);
1186
1196 void purple_request_field_account_set_filter(PurpleRequestField *field,
1197 PurpleFilterAccountFunc filter_func);
1198
1206 PurpleAccount *purple_request_field_account_get_default_value(
1207 const PurpleRequestField *field);
1208
1216 PurpleAccount *purple_request_field_account_get_value(
1217 const PurpleRequestField *field);
1218
1228 gboolean purple_request_field_account_get_show_all(
1229 const PurpleRequestField *field);
1230
1241 PurpleFilterAccountFunc purple_request_field_account_get_filter(
1242 const PurpleRequestField *field);
1243
1246 /**************************************************************************/
1248 /**************************************************************************/
1297 void *purple_request_input(void *handle, const char *title, const char *primary,
1298 const char *secondary, const char *default_value, gboolean multiline,
1299 gboolean masked, gchar *hint,
1300 const char *ok_text, GCallback ok_cb,
1301 const char *cancel_text, GCallback cancel_cb,
1302 PurpleAccount *account, const char *who, PurpleConversation *conv,
1303 void *user_data);
1304
1338 void *purple_request_choice(void *handle, const char *title, const char *primary,
1339 const char *secondary, int default_value,
1340 const char *ok_text, GCallback ok_cb,
1341 const char *cancel_text, GCallback cancel_cb,
1342 PurpleAccount *account, const char *who, PurpleConversation *conv,
1343 void *user_data, ...) G_GNUC_NULL_TERMINATED;
1344
1348 void *purple_request_choice_varg(void *handle, const char *title,
1349 const char *primary, const char *secondary, int default_value,
1350 const char *ok_text, GCallback ok_cb,
1351 const char *cancel_text, GCallback cancel_cb,
1352 PurpleAccount *account, const char *who, PurpleConversation *conv,
1353 void *user_data, va_list choices);
1354
1390 void *purple_request_action(void *handle, const char *title, const char *primary,
1391 const char *secondary, int default_action, PurpleAccount *account,
1392 const char *who, PurpleConversation *conv, void *user_data,
1393 size_t action_count, ...);
1394
1398 void *purple_request_action_varg(void *handle, const char *title,
1399 const char *primary, const char *secondary, int default_action,
1400 PurpleAccount *account, const char *who, PurpleConversation *conv,
1401 void *user_data, size_t action_count, va_list actions);
1402
1408 void *purple_request_action_with_icon(void *handle, const char *title,
1409 const char *primary, const char *secondary, int default_action,
1410 PurpleAccount *account, const char *who, PurpleConversation *conv,
1411 gconstpointer icon_data, gsize icon_size, void *user_data,
1412 size_t action_count, ...);
1413
1419 void *purple_request_action_with_icon_varg(void *handle, const char *title,
1420 const char *primary, const char *secondary, int default_action,
1421 PurpleAccount *account, const char *who, PurpleConversation *conv,
1422 gconstpointer icon_data, gsize icon_size,
1423 void *user_data, size_t action_count, va_list actions);
1424
1425
1455 void *purple_request_fields(void *handle, const char *title, const char *primary,
1456 const char *secondary, PurpleRequestFields *fields,
1457 const char *ok_text, GCallback ok_cb,
1458 const char *cancel_text, GCallback cancel_cb,
1459 PurpleAccount *account, const char *who, PurpleConversation *conv,
1460 void *user_data);
1461
1468 void purple_request_close(PurpleRequestType type, void *uihandle);
1469
1478 void purple_request_close_with_handle(void *handle);
1479
1483 #define purple_request_yes_no(handle, title, primary, secondary, \
1484 default_action, account, who, conv, \
1485 user_data, yes_cb, no_cb) \
1486 purple_request_action((handle), (title), (primary), (secondary), \
1487 (default_action), account, who, conv, (user_data), 2, \
1488 _("_Yes"), (yes_cb), _("_No"), (no_cb))
1489
1493 #define purple_request_ok_cancel(handle, title, primary, secondary, \
1494 default_action, account, who, conv, \
1495 user_data, ok_cb, cancel_cb) \
1496 purple_request_action((handle), (title), (primary), (secondary), \
1497 (default_action), account, who, conv, (user_data), 2, \
1498 _("_OK"), (ok_cb), _("_Cancel"), (cancel_cb))
1499
1503 #define purple_request_accept_cancel(handle, title, primary, secondary, \
1504 default_action, account, who, conv, \
1505 user_data, accept_cb, cancel_cb) \
1506 purple_request_action((handle), (title), (primary), (secondary), \
1507 (default_action), account, who, conv, (user_data), 2, \
1508 _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb))
1509
1514 #define purple_request_accept_cancel_with_icon(handle, title, primary, secondary, \
1515 default_action, account, who, conv, \
1516 icon_data, icon_size, \
1517 user_data, accept_cb, cancel_cb) \
1518 purple_request_action_with_icon((handle), (title), (primary), (secondary), \
1519 (default_action), account, who, conv, icon_data, icon_size, \
1520 (user_data), 2, \
1521 _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb))
1522
1547 void *purple_request_file(void *handle, const char *title, const char *filename,
1548 gboolean savedialog, GCallback ok_cb, GCallback cancel_cb,
1549 PurpleAccount *account, const char *who, PurpleConversation *conv,
1550 void *user_data);
1551
1574 void *purple_request_folder(void *handle, const char *title, const char *dirname,
1575 GCallback ok_cb, GCallback cancel_cb,
1576 PurpleAccount *account, const char *who, PurpleConversation *conv,
1577 void *user_data);
1578
1581 /**************************************************************************/
1583 /**************************************************************************/
1592 void purple_request_set_ui_ops(PurpleRequestUiOps *ops);
1593
1600 PurpleRequestUiOps *purple_request_get_ui_ops(void);
1601
1604 #ifdef __cplusplus
1605 }
1606 #endif
1607
1608 #endif /* _PURPLE_REQUEST_H_ */
purple_request_field_string_get_value
const char * purple_request_field_string_get_value(const PurpleRequestField *field)
Returns the user-entered value in a string field.
purple_request_field_choice_new
PurpleRequestField * purple_request_field_choice_new(const char *id, const char *text, int default_value)
Creates a multiple choice field.
purple_request_action_with_icon
void * purple_request_action_with_icon(void *handle, const char *title, const char *primary, const char *secondary, int default_action, PurpleAccount *account, const char *who, PurpleConversation *conv, gconstpointer icon_data, gsize icon_size, void *user_data, size_t action_count,...)
Version of purple_request_action() supplying an image for the UI to optionally display as an icon in ...
purple_request_field_string_is_multiline
gboolean purple_request_field_string_is_multiline(const PurpleRequestField *field)
Returns whether or not a string field is multi-line.
purple_request_action_varg
void * purple_request_action_varg(void *handle, const char *title, const char *primary, const char *secondary, int default_action, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data, size_t action_count, va_list actions)
va_list version of purple_request_action(); see its documentation.
purple_request_field_int_set_default_value
void purple_request_field_int_set_default_value(PurpleRequestField *field, int default_value)
Sets the default value in an integer field.
purple_request_field_set_type_hint
void purple_request_field_set_type_hint(PurpleRequestField *field, const char *type_hint)
Sets the type hint for the field.
purple_request_fields_destroy
void purple_request_fields_destroy(PurpleRequestFields *fields)
Destroys a list of fields.
purple_request_field_list_get_items
GList * purple_request_field_list_get_items(const PurpleRequestField *field)
Returns a list of items in a list field.
purple_request_fields_get_integer
int purple_request_fields_get_integer(const PurpleRequestFields *fields, const char *id)
Returns the integer value of a field with the specified ID.
purple_request_field_list_get_data
void * purple_request_field_list_get_data(const PurpleRequestField *field, const char *text)
Returns the data for a particular item.
purple_request_field_bool_set_value
void purple_request_field_bool_set_value(PurpleRequestField *field, gboolean value)
Sets the value in an boolean field.
purple_request_field_account_get_show_all
gboolean purple_request_field_account_get_show_all(const PurpleRequestField *field)
Returns whether or not to show all accounts in an account field.
purple_request_field_string_set_default_value
void purple_request_field_string_set_default_value(PurpleRequestField *field, const char *default_value)
Sets the default value in a string field.
purple_request_get_ui_ops
PurpleRequestUiOps * purple_request_get_ui_ops(void)
Returns the UI operations structure to be used when displaying a request.
purple_request_action_with_icon_varg
void * purple_request_action_with_icon_varg(void *handle, const char *title, const char *primary, const char *secondary, int default_action, PurpleAccount *account, const char *who, PurpleConversation *conv, gconstpointer icon_data, gsize icon_size, void *user_data, size_t action_count, va_list actions)
va_list version of purple_request_action_with_icon(); see its documentation.
purple_request_field_group_new
PurpleRequestFieldGroup * purple_request_field_group_new(const char *title)
Creates a fields group with an optional title.
purple_request_field_image_get_buffer
const char * purple_request_field_image_get_buffer(PurpleRequestField *field)
Returns pointer to the image.
purple_request_input
void * purple_request_input(void *handle, const char *title, const char *primary, const char *secondary, const char *default_value, gboolean multiline, gboolean masked, gchar *hint, const char *ok_text, GCallback ok_cb, const char *cancel_text, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
Prompts the user for text input.
purple_request_field_bool_get_default_value
gboolean purple_request_field_bool_get_default_value(const PurpleRequestField *field)
Returns the default value in an boolean field.
purple_request_field_account_new
PurpleRequestField * purple_request_field_account_new(const char *id, const char *text, PurpleAccount *account)
Creates an account field.
purple_request_field_int_set_value
void purple_request_field_int_set_value(PurpleRequestField *field, int value)
Sets the value in an integer field.
PurpleRequestFieldGroup
A group of fields with a title.
Definition: request.h:89
PURPLE_REQUEST_INPUT
Text input request.
Definition: request.h:45
purple_request_field_set_ui_data
void purple_request_field_set_ui_data(PurpleRequestField *field, gpointer ui_data)
Sets the ui_data for a field.
purple_request_field_is_visible
gboolean purple_request_field_is_visible(const PurpleRequestField *field)
Returns whether or not a field is visible.
purple_request_field_account_get_filter
PurpleFilterAccountFunc purple_request_field_account_get_filter(const PurpleRequestField *field)
Returns the account filter function in an account field.
purple_request_set_ui_ops
void purple_request_set_ui_ops(PurpleRequestUiOps *ops)
Sets the UI operations structure to be used when displaying a request.
purple_request_field_int_new
PurpleRequestField * purple_request_field_int_new(const char *id, const char *text, int default_value)
Creates an integer field.
purple_request_fields_add_group
void purple_request_fields_add_group(PurpleRequestFields *fields, PurpleRequestFieldGroup *group)
Adds a group of fields to the list.
purple_request_fields_get_field
PurpleRequestField * purple_request_fields_get_field(const PurpleRequestFields *fields, const char *id)
Return the field with the specified ID.
purple_request_field_list_get_multi_select
gboolean purple_request_field_list_get_multi_select(const PurpleRequestField *field)
Returns whether or not a list field allows multiple selection.
purple_request_field_choice_set_value
void purple_request_field_choice_set_value(PurpleRequestField *field, int value)
Sets the value in an choice field.
_PurpleAccount
Structure representing an account.
Definition: account.h:169
purple_request_fields_all_required_filled
gboolean purple_request_fields_all_required_filled(const PurpleRequestFields *fields)
Returns whether or not all required fields have values.
purple_request_field_account_set_default_value
void purple_request_field_account_set_default_value(PurpleRequestField *field, PurpleAccount *default_value)
Sets the default account on an account field.
purple_request_action
void * purple_request_action(void *handle, const char *title, const char *primary, const char *secondary, int default_action, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data, size_t action_count,...)
Prompts the user for an action.
purple_request_field_account_set_show_all
void purple_request_field_account_set_show_all(PurpleRequestField *field, gboolean show_all)
Sets whether or not to show all accounts in an account field.
purple_request_field_list_get_icons
GList * purple_request_field_list_get_icons(const PurpleRequestField *field)
Returns a list of icons in a list field.
purple_request_fields_get_choice
int purple_request_fields_get_choice(const PurpleRequestFields *fields, const char *id)
Returns the choice index of a field with the specified ID.
purple_request_field_get_type
PurpleRequestFieldType purple_request_field_get_type(const PurpleRequestField *field)
Returns the type of a field.
PurpleRequestActionCb
void(* PurpleRequestActionCb)(void *, int)
The type of callbacks passed to purple_request_action().
Definition: request.h:260
purple_request_field_int_get_value
int purple_request_field_int_get_value(const PurpleRequestField *field)
Returns the user-entered value in an integer field.
purple_request_field_list_add
void purple_request_field_list_add(PurpleRequestField *field, const char *item, void *data)
Adds an item to a list field.
PURPLE_REQUEST_FOLDER
Folder selection request.
Definition: request.h:50
purple_request_field_group_get_title
const char * purple_request_field_group_get_title(const PurpleRequestFieldGroup *group)
Returns the title of a fields group.
purple_request_choice_varg
void * purple_request_choice_varg(void *handle, const char *title, const char *primary, const char *secondary, int default_value, const char *ok_text, GCallback ok_cb, const char *cancel_text, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data, va_list choices)
va_list version of purple_request_choice(); see its documentation.
purple_request_field_group_add_field
void purple_request_field_group_add_field(PurpleRequestFieldGroup *group, PurpleRequestField *field)
Adds a field to the group.
purple_request_field_get_label
const char * purple_request_field_get_label(const PurpleRequestField *field)
Returns the label text of a field.
PURPLE_REQUEST_ACTION
Action request.
Definition: request.h:47
purple_request_field_list_set_multi_select
void purple_request_field_list_set_multi_select(PurpleRequestField *field, gboolean multi_select)
Sets whether or not a list field allows multiple selection.
purple_request_field_set_label
void purple_request_field_set_label(PurpleRequestField *field, const char *label)
Sets the label text of a field.
purple_request_choice
void * purple_request_choice(void *handle, const char *title, const char *primary, const char *secondary, int default_value, const char *ok_text, GCallback ok_cb, const char *cancel_text, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data,...) G_GNUC_NULL_TERMINATED
Prompts the user for multiple-choice input.
purple_request_fields_get_account
PurpleAccount * purple_request_fields_get_account(const PurpleRequestFields *fields, const char *id)
Returns the account of a field with the specified ID.
purple_request_folder
void * purple_request_folder(void *handle, const char *title, const char *dirname, GCallback ok_cb, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
Displays a folder select dialog.
purple_request_field_account_get_default_value
PurpleAccount * purple_request_field_account_get_default_value(const PurpleRequestField *field)
Returns the default account in an account field.
PURPLE_REQUEST_FIELDS
Multiple fields request.
Definition: request.h:48
purple_request_field_get_type_hint
const char * purple_request_field_get_type_hint(const PurpleRequestField *field)
Returns the field&#39;s type hint.
purple_request_field_choice_get_labels
GList * purple_request_field_choice_get_labels(const PurpleRequestField *field)
Returns a list of labels in a choice field.
purple_request_field_image_get_size
gsize purple_request_field_image_get_size(PurpleRequestField *field)
Returns size (in bytes) of the image.
purple_request_fields_get_required
GList * purple_request_fields_get_required(const PurpleRequestFields *fields)
Returns a list of all required fields.
PurpleRequestUiOps
Request UI operations.
Definition: request.h:190
purple_request_field_destroy
void purple_request_field_destroy(PurpleRequestField *field)
Destroys a field.
purple_request_field_list_get_selected
GList * purple_request_field_list_get_selected(const PurpleRequestField *field)
Returns a list of selected items in a list field.
purple_request_field_set_visible
void purple_request_field_set_visible(PurpleRequestField *field, gboolean visible)
Sets whether or not a field is visible.
account.h
Account API.
purple_request_field_string_set_value
void purple_request_field_string_set_value(PurpleRequestField *field, const char *value)
Sets the value in a string field.
PurpleRequestFieldType
PurpleRequestFieldType
A type of field.
Definition: request.h:57
purple_request_field_string_new
PurpleRequestField * purple_request_field_string_new(const char *id, const char *text, const char *default_value, gboolean multiline)
Creates a string request field.
purple_request_field_string_is_masked
gboolean purple_request_field_string_is_masked(const PurpleRequestField *field)
Returns whether or not a string field is masked.
purple_request_field_list_is_selected
gboolean purple_request_field_list_is_selected(const PurpleRequestField *field, const char *item)
Returns whether or not a particular item is selected in a list field.
purple_request_file
void * purple_request_file(void *handle, const char *title, const char *filename, gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
Displays a file selector request dialog.
purple_request_field_string_get_default_value
const char * purple_request_field_string_get_default_value(const PurpleRequestField *field)
Returns the default value in a string field.
purple_request_field_new
PurpleRequestField * purple_request_field_new(const char *id, const char *text, PurpleRequestFieldType type)
Creates a field of the specified type.
purple_request_field_image_set_scale
void purple_request_field_image_set_scale(PurpleRequestField *field, unsigned int x, unsigned int y)
Sets the scale factors of an image field.
purple_request_field_bool_new
PurpleRequestField * purple_request_field_bool_new(const char *id, const char *text, gboolean default_value)
Creates a boolean field.
purple_request_field_image_get_scale_y
unsigned int purple_request_field_image_get_scale_y(PurpleRequestField *field)
Returns Y scale coefficient of the image.
purple_request_field_list_set_selected
void purple_request_field_list_set_selected(PurpleRequestField *field, GList *items)
Sets a list of selected items in a list field.
purple_request_close_with_handle
void purple_request_close_with_handle(void *handle)
Closes all requests registered with the specified handle.
purple_request_field_bool_get_value
gboolean purple_request_field_bool_get_value(const PurpleRequestField *field)
Returns the user-entered value in an boolean field.
purple_request_field_string_set_masked
void purple_request_field_string_set_masked(PurpleRequestField *field, gboolean masked)
Sets whether or not a string field is masked (commonly used for password fields). ...
purple_request_field_label_new
PurpleRequestField * purple_request_field_label_new(const char *id, const char *text)
Creates a label field.
purple_request_field_image_get_scale_x
unsigned int purple_request_field_image_get_scale_x(PurpleRequestField *field)
Returns X scale coefficient of the image.
purple_request_field_is_required
gboolean purple_request_field_is_required(const PurpleRequestField *field)
Returns whether or not a field is required.
purple_request_fields_new
PurpleRequestFields * purple_request_fields_new(void)
Creates a list of fields to pass to purple_request_fields().
purple_request_field_account_set_filter
void purple_request_field_account_set_filter(PurpleRequestField *field, PurpleFilterAccountFunc filter_func)
Sets the account filter function in an account field.
purple_request_field_group_destroy
void purple_request_field_group_destroy(PurpleRequestFieldGroup *group)
Destroys a fields group.
purple_request_fields_get_groups
GList * purple_request_fields_get_groups(const PurpleRequestFields *fields)
Returns a list of all groups in a field list.
PurpleRequestType
PurpleRequestType
Request types.
Definition: request.h:43
purple_request_field_get_group
PurpleRequestFieldGroup * purple_request_field_get_group(const PurpleRequestField *field)
Returns the group for the field.
purple_request_field_list_add_icon
void purple_request_field_list_add_icon(PurpleRequestField *field, const char *item, const char *icon_path, void *data)
Adds an item to a list field.
purple_request_close
void purple_request_close(PurpleRequestType type, void *uihandle)
Closes a request.
purple_request_field_choice_add
void purple_request_field_choice_add(PurpleRequestField *field, const char *label)
Adds a choice to a multiple choice field.
purple_request_field_choice_get_value
int purple_request_field_choice_get_value(const PurpleRequestField *field)
Returns the user-entered value in an choice field.
purple_request_fields_get_bool
gboolean purple_request_fields_get_bool(const PurpleRequestFields *fields, const char *id)
Returns the boolean value of a field with the specified ID.
_PurpleRequestField
A request field.
Definition: request.h:103
purple_request_field_account_set_value
void purple_request_field_account_set_value(PurpleRequestField *field, PurpleAccount *value)
Sets the account in an account field.
purple_request_field_list_new
PurpleRequestField * purple_request_field_list_new(const char *id, const char *text)
Creates a multiple list item field.
purple_request_field_account_get_value
PurpleAccount * purple_request_field_account_get_value(const PurpleRequestField *field)
Returns the user-entered account in an account field.
purple_request_field_int_get_default_value
int purple_request_field_int_get_default_value(const PurpleRequestField *field)
Returns the default value in an integer field.
purple_request_field_set_required
void purple_request_field_set_required(PurpleRequestField *field, gboolean required)
Sets whether or not a field is required.
purple_request_field_get_ui_data
gpointer purple_request_field_get_ui_data(const PurpleRequestField *field)
Returns the ui_data for a field.
PURPLE_REQUEST_CHOICE
Multiple-choice request.
Definition: request.h:46
purple_request_field_string_is_editable
gboolean purple_request_field_string_is_editable(const PurpleRequestField *field)
Returns whether or not a string field is editable.
purple_request_fields_is_field_required
gboolean purple_request_fields_is_field_required(const PurpleRequestFields *fields, const char *id)
Returns whether or not a field with the specified ID is required.
purple_request_field_string_set_editable
void purple_request_field_string_set_editable(PurpleRequestField *field, gboolean editable)
Sets whether or not a string field is editable.
purple_request_field_get_id
const char * purple_request_field_get_id(const PurpleRequestField *field)
Returns the ID of a field.
purple_request_field_list_add_selected
void purple_request_field_list_add_selected(PurpleRequestField *field, const char *item)
Adds a selected item to the list field.
purple_request_field_image_new
PurpleRequestField * purple_request_field_image_new(const char *id, const char *text, const char *buf, gsize size)
Creates an image field.
purple_request_field_list_clear_selected
void purple_request_field_list_clear_selected(PurpleRequestField *field)
Clears the list of selected items in a list field.
PURPLE_REQUEST_FILE
File open or save request.
Definition: request.h:49
purple_request_field_choice_get_default_value
int purple_request_field_choice_get_default_value(const PurpleRequestField *field)
Returns the default value in an choice field.
_PurpleConversation
A core representation of a conversation between two or more people.
Definition: conversation.h:338
purple_request_field_choice_set_default_value
void purple_request_field_choice_set_default_value(PurpleRequestField *field, int default_value)
Sets the default value in an choice field.
purple_request_fields_get_string
const char * purple_request_fields_get_string(const PurpleRequestFields *fields, const char *id)
Returns the string value of a field with the specified ID.
purple_request_fields
void * purple_request_fields(void *handle, const char *title, const char *primary, const char *secondary, PurpleRequestFields *fields, const char *ok_text, GCallback ok_cb, const char *cancel_text, GCallback cancel_cb, PurpleAccount *account, const char *who, PurpleConversation *conv, void *user_data)
Displays groups of fields for the user to fill in.
purple_request_field_bool_set_default_value
void purple_request_field_bool_set_default_value(PurpleRequestField *field, gboolean default_value)
Sets the default value in an boolean field.
PurpleRequestFields
Multiple fields request data.
Definition: request.h:74
purple_request_field_group_get_fields
GList * purple_request_field_group_get_fields(const PurpleRequestFieldGroup *group)
Returns a list of all fields in a group.
purple_request_fields_exists
gboolean purple_request_fields_exists(const PurpleRequestFields *fields, const char *id)
Returns whether or not the field with the specified ID exists.