pidgin: request.h Source File

pidgin 2.14.4

Loading...
Searching...
No Matches
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,
51 PURPLE_REQUEST_SCREENSHARE
53} PurpleRequestType;
54
58 typedef enum
59{
60 PURPLE_REQUEST_FIELD_NONE,
61 PURPLE_REQUEST_FIELD_STRING,
62 PURPLE_REQUEST_FIELD_INTEGER,
63 PURPLE_REQUEST_FIELD_BOOLEAN,
64 PURPLE_REQUEST_FIELD_CHOICE,
65 PURPLE_REQUEST_FIELD_LIST,
66 PURPLE_REQUEST_FIELD_LABEL,
67 PURPLE_REQUEST_FIELD_IMAGE,
68 PURPLE_REQUEST_FIELD_ACCOUNT
69
70} PurpleRequestFieldType;
71
75 typedef struct
76{
77 GList *groups;
78
79 GHashTable *fields;
80
81 GList *required_fields;
82
83 void *ui_data;
84
85} PurpleRequestFields;
86
90 typedef struct
91{
92 PurpleRequestFields *fields_list;
93
94 char *title;
95
96 GList *fields;
97
98} PurpleRequestFieldGroup;
99
100#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_REQUEST_C_)
104 struct _PurpleRequestField
105{
106 PurpleRequestFieldType type;
107 PurpleRequestFieldGroup *group;
108
109 char *id;
110 char *label;
111 char *type_hint;
112
113 gboolean visible;
114 gboolean required;
115
116 union
117 {
118 struct
119 {
120 gboolean multiline;
121 gboolean masked;
122 gboolean editable;
123 char *default_value;
124 char *value;
125
126 } string;
127
128 struct
129 {
130 int default_value;
131 int value;
132
133 } integer;
134
135 struct
136 {
137 gboolean default_value;
138 gboolean value;
139
140 } boolean;
141
142 struct
143 {
144 int default_value;
145 int value;
146
147 GList *labels;
148
149 } choice;
150
151 struct
152 {
153 GList *items;
154 GList *icons;
155 GHashTable *item_data;
156 GList *selected;
157 GHashTable *selected_table;
158
159 gboolean multiple_selection;
160
161 } list;
162
163 struct
164 {
165 PurpleAccount *default_account;
166 PurpleAccount *account;
167 gboolean show_all;
168
169 PurpleFilterAccountFunc filter_func;
170
171 } account;
172
173 struct
174 {
175 unsigned int scale_x;
176 unsigned int scale_y;
177 const char *buffer;
178 gsize size;
179 } image;
180
181 } u;
182
183 void *ui_data;
184
185};
186#endif
187
191 typedef struct
192{
194 void *(*request_input)(const char *title, const char *primary,
195 const char *secondary, const char *default_value,
196 gboolean multiline, gboolean masked, gchar *hint,
197 const char *ok_text, GCallback ok_cb,
198 const char *cancel_text, GCallback cancel_cb,
199 PurpleAccount *account, const char *who,
200 PurpleConversation *conv, void *user_data);
201
203 void *(*request_choice)(const char *title, const char *primary,
204 const char *secondary, int default_value,
205 const char *ok_text, GCallback ok_cb,
206 const char *cancel_text, GCallback cancel_cb,
207 PurpleAccount *account, const char *who,
208 PurpleConversation *conv, void *user_data,
209 va_list choices);
210
212 void *(*request_action)(const char *title, const char *primary,
213 const char *secondary, int default_action,
214 PurpleAccount *account, const char *who,
215 PurpleConversation *conv, void *user_data,
216 size_t action_count, va_list actions);
217
219 void *(*request_fields)(const char *title, const char *primary,
220 const char *secondary, PurpleRequestFields *fields,
221 const char *ok_text, GCallback ok_cb,
222 const char *cancel_text, GCallback cancel_cb,
223 PurpleAccount *account, const char *who,
224 PurpleConversation *conv, void *user_data);
225
227 void *(*request_file)(const char *title, const char *filename,
228 gboolean savedialog, GCallback ok_cb,
229 GCallback cancel_cb, PurpleAccount *account,
230 const char *who, PurpleConversation *conv,
231 void *user_data);
232
233 void (*close_request)(PurpleRequestType type, void *ui_handle);
234
236 void *(*request_folder)(const char *title, const char *dirname,
237 GCallback ok_cb, GCallback cancel_cb,
238 PurpleAccount *account, const char *who,
239 PurpleConversation *conv, void *user_data);
240
242 void *(*request_action_with_icon)(const char *title, const char *primary,
243 const char *secondary, int default_action,
244 PurpleAccount *account, const char *who,
245 PurpleConversation *conv,
246 gconstpointer icon_data, gsize icon_size,
247 void *user_data,
248 size_t action_count, va_list actions);
249
250 void *(*request_screenshare_media)(const char *title, const char *primary,
251 const char *secondary, PurpleAccount *account,
252 GCallback cb, void *user_data);
253
254 void (*_purple_reserved1)(void);
255 void (*_purple_reserved2)(void);
256} PurpleRequestUiOps;
257
258typedef void (*PurpleRequestInputCb)(void *, const char *);
259
264 typedef void (*PurpleRequestActionCb)(void *, int);
265typedef void (*PurpleRequestChoiceCb)(void *, int);
266typedef void (*PurpleRequestFieldsCb)(void *, PurpleRequestFields *fields);
267typedef void (*PurpleRequestFileCb)(void *, const char *filename);
268typedef void (*PurpleRequestScreenshareCb)(void *, GObject *info);
269
270#ifdef __cplusplus
271extern "C" {
272#endif
273
274/**************************************************************************/
276/**************************************************************************/
284 PurpleRequestFields *purple_request_fields_new(void);
285
291 void purple_request_fields_destroy(PurpleRequestFields *fields);
292
299 void purple_request_fields_add_group(PurpleRequestFields *fields,
300 PurpleRequestFieldGroup *group);
301
309GList *purple_request_fields_get_groups(const PurpleRequestFields *fields);
310
319gboolean purple_request_fields_exists(const PurpleRequestFields *fields,
320 const char *id);
321
329GList *purple_request_fields_get_required(const PurpleRequestFields *fields);
330
339gboolean purple_request_fields_is_field_required(const PurpleRequestFields *fields,
340 const char *id);
341
349gboolean purple_request_fields_all_required_filled(
350 const PurpleRequestFields *fields);
351
360 PurpleRequestField *purple_request_fields_get_field(
361 const PurpleRequestFields *fields, const char *id);
362
371 const char *purple_request_fields_get_string(const PurpleRequestFields *fields,
372 const char *id);
373
382 int purple_request_fields_get_integer(const PurpleRequestFields *fields,
383 const char *id);
384
393gboolean purple_request_fields_get_bool(const PurpleRequestFields *fields,
394 const char *id);
395
404 int purple_request_fields_get_choice(const PurpleRequestFields *fields,
405 const char *id);
406
415 PurpleAccount *purple_request_fields_get_account(const PurpleRequestFields *fields,
416 const char *id);
417
420/**************************************************************************/
422/**************************************************************************/
432 PurpleRequestFieldGroup *purple_request_field_group_new(const char *title);
433
439 void purple_request_field_group_destroy(PurpleRequestFieldGroup *group);
440
447 void purple_request_field_group_add_field(PurpleRequestFieldGroup *group,
448 PurpleRequestField *field);
449
457 const char *purple_request_field_group_get_title(
458 const PurpleRequestFieldGroup *group);
459
467GList *purple_request_field_group_get_fields(
468 const PurpleRequestFieldGroup *group);
469
472/**************************************************************************/
474/**************************************************************************/
486 PurpleRequestField *purple_request_field_new(const char *id, const char *text,
487 PurpleRequestFieldType type);
488
494 void purple_request_field_destroy(PurpleRequestField *field);
495
502 void purple_request_field_set_label(PurpleRequestField *field, const char *label);
503
510 void purple_request_field_set_visible(PurpleRequestField *field, gboolean visible);
511
521 void purple_request_field_set_type_hint(PurpleRequestField *field,
522 const char *type_hint);
523
530 void purple_request_field_set_required(PurpleRequestField *field,
531 gboolean required);
532
540 PurpleRequestFieldType purple_request_field_get_type(const PurpleRequestField *field);
541
551 PurpleRequestFieldGroup *purple_request_field_get_group(const PurpleRequestField *field);
552
560 const char *purple_request_field_get_id(const PurpleRequestField *field);
561
569 const char *purple_request_field_get_label(const PurpleRequestField *field);
570
578gboolean purple_request_field_is_visible(const PurpleRequestField *field);
579
587 const char *purple_request_field_get_type_hint(const PurpleRequestField *field);
588
596gboolean purple_request_field_is_required(const PurpleRequestField *field);
597
607gpointer purple_request_field_get_ui_data(const PurpleRequestField *field);
608
619 void purple_request_field_set_ui_data(PurpleRequestField *field,
620 gpointer ui_data);
621
624/**************************************************************************/
626/**************************************************************************/
639 PurpleRequestField *purple_request_field_string_new(const char *id,
640 const char *text,
641 const char *default_value,
642 gboolean multiline);
643
650 void purple_request_field_string_set_default_value(PurpleRequestField *field,
651 const char *default_value);
652
659 void purple_request_field_string_set_value(PurpleRequestField *field,
660 const char *value);
661
669 void purple_request_field_string_set_masked(PurpleRequestField *field,
670 gboolean masked);
671
678 void purple_request_field_string_set_editable(PurpleRequestField *field,
679 gboolean editable);
680
688 const char *purple_request_field_string_get_default_value(
689 const PurpleRequestField *field);
690
698 const char *purple_request_field_string_get_value(const PurpleRequestField *field);
699
707gboolean purple_request_field_string_is_multiline(const PurpleRequestField *field);
708
716gboolean purple_request_field_string_is_masked(const PurpleRequestField *field);
717
725gboolean purple_request_field_string_is_editable(const PurpleRequestField *field);
726
729/**************************************************************************/
731/**************************************************************************/
743 PurpleRequestField *purple_request_field_int_new(const char *id,
744 const char *text,
745 int default_value);
746
753 void purple_request_field_int_set_default_value(PurpleRequestField *field,
754 int default_value);
755
762 void purple_request_field_int_set_value(PurpleRequestField *field, int value);
763
771 int purple_request_field_int_get_default_value(const PurpleRequestField *field);
772
780 int purple_request_field_int_get_value(const PurpleRequestField *field);
781
784/**************************************************************************/
786/**************************************************************************/
800 PurpleRequestField *purple_request_field_bool_new(const char *id,
801 const char *text,
802 gboolean default_value);
803
810 void purple_request_field_bool_set_default_value(PurpleRequestField *field,
811 gboolean default_value);
812
819 void purple_request_field_bool_set_value(PurpleRequestField *field,
820 gboolean value);
821
829gboolean purple_request_field_bool_get_default_value(
830 const PurpleRequestField *field);
831
839gboolean purple_request_field_bool_get_value(const PurpleRequestField *field);
840
843/**************************************************************************/
845/**************************************************************************/
859 PurpleRequestField *purple_request_field_choice_new(const char *id,
860 const char *text,
861 int default_value);
862
869 void purple_request_field_choice_add(PurpleRequestField *field,
870 const char *label);
871
878 void purple_request_field_choice_set_default_value(PurpleRequestField *field,
879 int default_value);
880
887 void purple_request_field_choice_set_value(PurpleRequestField *field, int value);
888
896 int purple_request_field_choice_get_default_value(const PurpleRequestField *field);
897
905 int purple_request_field_choice_get_value(const PurpleRequestField *field);
906
914GList *purple_request_field_choice_get_labels(const PurpleRequestField *field);
915
918/**************************************************************************/
920/**************************************************************************/
931 PurpleRequestField *purple_request_field_list_new(const char *id, const char *text);
932
940 void purple_request_field_list_set_multi_select(PurpleRequestField *field,
941 gboolean multi_select);
942
950gboolean purple_request_field_list_get_multi_select(
951 const PurpleRequestField *field);
952
961 void *purple_request_field_list_get_data(const PurpleRequestField *field,
962 const char *text);
963
973 void purple_request_field_list_add(PurpleRequestField *field,
974 const char *item, void *data);
975
984 void purple_request_field_list_add_icon(PurpleRequestField *field,
985 const char *item, const char* icon_path, void* data);
986
993 void purple_request_field_list_add_selected(PurpleRequestField *field,
994 const char *item);
995
1001 void purple_request_field_list_clear_selected(PurpleRequestField *field);
1002
1009 void purple_request_field_list_set_selected(PurpleRequestField *field,
1010 GList *items);
1011
1020gboolean purple_request_field_list_is_selected(const PurpleRequestField *field,
1021 const char *item);
1022
1033GList *purple_request_field_list_get_selected(
1034 const PurpleRequestField *field);
1035
1043GList *purple_request_field_list_get_items(const PurpleRequestField *field);
1044
1055GList *purple_request_field_list_get_icons(const PurpleRequestField *field);
1056
1059/**************************************************************************/
1061/**************************************************************************/
1072 PurpleRequestField *purple_request_field_label_new(const char *id,
1073 const char *text);
1074
1077/**************************************************************************/
1079/**************************************************************************/
1092 PurpleRequestField *purple_request_field_image_new(const char *id, const char *text,
1093 const char *buf, gsize size);
1094
1102 void purple_request_field_image_set_scale(PurpleRequestField *field, unsigned int x, unsigned int y);
1103
1111 const char *purple_request_field_image_get_buffer(PurpleRequestField *field);
1112
1120gsize purple_request_field_image_get_size(PurpleRequestField *field);
1121
1129 unsigned int purple_request_field_image_get_scale_x(PurpleRequestField *field);
1130
1138 unsigned int purple_request_field_image_get_scale_y(PurpleRequestField *field);
1139
1142/**************************************************************************/
1144/**************************************************************************/
1158 PurpleRequestField *purple_request_field_account_new(const char *id,
1159 const char *text,
1160 PurpleAccount *account);
1161
1168 void purple_request_field_account_set_default_value(PurpleRequestField *field,
1169 PurpleAccount *default_value);
1170
1177 void purple_request_field_account_set_value(PurpleRequestField *field,
1178 PurpleAccount *value);
1179
1189 void purple_request_field_account_set_show_all(PurpleRequestField *field,
1190 gboolean show_all);
1191
1201 void purple_request_field_account_set_filter(PurpleRequestField *field,
1202 PurpleFilterAccountFunc filter_func);
1203
1211 PurpleAccount *purple_request_field_account_get_default_value(
1212 const PurpleRequestField *field);
1213
1221 PurpleAccount *purple_request_field_account_get_value(
1222 const PurpleRequestField *field);
1223
1233gboolean purple_request_field_account_get_show_all(
1234 const PurpleRequestField *field);
1235
1246PurpleFilterAccountFunc purple_request_field_account_get_filter(
1247 const PurpleRequestField *field);
1248
1251/**************************************************************************/
1253/**************************************************************************/
1302 void *purple_request_input(void *handle, const char *title, const char *primary,
1303 const char *secondary, const char *default_value, gboolean multiline,
1304 gboolean masked, gchar *hint,
1305 const char *ok_text, GCallback ok_cb,
1306 const char *cancel_text, GCallback cancel_cb,
1307 PurpleAccount *account, const char *who, PurpleConversation *conv,
1308 void *user_data);
1309
1343 void *purple_request_choice(void *handle, const char *title, const char *primary,
1344 const char *secondary, int default_value,
1345 const char *ok_text, GCallback ok_cb,
1346 const char *cancel_text, GCallback cancel_cb,
1347 PurpleAccount *account, const char *who, PurpleConversation *conv,
1348 void *user_data, ...) G_GNUC_NULL_TERMINATED;
1349
1353 void *purple_request_choice_varg(void *handle, const char *title,
1354 const char *primary, const char *secondary, int default_value,
1355 const char *ok_text, GCallback ok_cb,
1356 const char *cancel_text, GCallback cancel_cb,
1357 PurpleAccount *account, const char *who, PurpleConversation *conv,
1358 void *user_data, va_list choices);
1359
1395 void *purple_request_action(void *handle, const char *title, const char *primary,
1396 const char *secondary, int default_action, PurpleAccount *account,
1397 const char *who, PurpleConversation *conv, void *user_data,
1398 size_t action_count, ...);
1399
1403 void *purple_request_action_varg(void *handle, const char *title,
1404 const char *primary, const char *secondary, int default_action,
1405 PurpleAccount *account, const char *who, PurpleConversation *conv,
1406 void *user_data, size_t action_count, va_list actions);
1407
1413 void *purple_request_action_with_icon(void *handle, const char *title,
1414 const char *primary, const char *secondary, int default_action,
1415 PurpleAccount *account, const char *who, PurpleConversation *conv,
1416 gconstpointer icon_data, gsize icon_size, void *user_data,
1417 size_t action_count, ...);
1418
1424 void *purple_request_action_with_icon_varg(void *handle, const char *title,
1425 const char *primary, const char *secondary, int default_action,
1426 PurpleAccount *account, const char *who, PurpleConversation *conv,
1427 gconstpointer icon_data, gsize icon_size,
1428 void *user_data, size_t action_count, va_list actions);
1429
1430
1460 void *purple_request_fields(void *handle, const char *title, const char *primary,
1461 const char *secondary, PurpleRequestFields *fields,
1462 const char *ok_text, GCallback ok_cb,
1463 const char *cancel_text, GCallback cancel_cb,
1464 PurpleAccount *account, const char *who, PurpleConversation *conv,
1465 void *user_data);
1466
1473 void purple_request_close(PurpleRequestType type, void *uihandle);
1474
1483 void purple_request_close_with_handle(void *handle);
1484
1488#define purple_request_yes_no(handle, title, primary, secondary, \
1489 default_action, account, who, conv, \
1490 user_data, yes_cb, no_cb) \
1491 purple_request_action((handle), (title), (primary), (secondary), \
1492 (default_action), account, who, conv, (user_data), 2, \
1493 _("_Yes"), (yes_cb), _("_No"), (no_cb))
1494
1498#define purple_request_ok_cancel(handle, title, primary, secondary, \
1499 default_action, account, who, conv, \
1500 user_data, ok_cb, cancel_cb) \
1501 purple_request_action((handle), (title), (primary), (secondary), \
1502 (default_action), account, who, conv, (user_data), 2, \
1503 _("_OK"), (ok_cb), _("_Cancel"), (cancel_cb))
1504
1508#define purple_request_accept_cancel(handle, title, primary, secondary, \
1509 default_action, account, who, conv, \
1510 user_data, accept_cb, cancel_cb) \
1511 purple_request_action((handle), (title), (primary), (secondary), \
1512 (default_action), account, who, conv, (user_data), 2, \
1513 _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb))
1514
1519#define purple_request_accept_cancel_with_icon(handle, title, primary, secondary, \
1520 default_action, account, who, conv, \
1521 icon_data, icon_size, \
1522 user_data, accept_cb, cancel_cb) \
1523 purple_request_action_with_icon((handle), (title), (primary), (secondary), \
1524 (default_action), account, who, conv, icon_data, icon_size, \
1525 (user_data), 2, \
1526 _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb))
1527
1552 void *purple_request_file(void *handle, const char *title, const char *filename,
1553 gboolean savedialog, GCallback ok_cb, GCallback cancel_cb,
1554 PurpleAccount *account, const char *who, PurpleConversation *conv,
1555 void *user_data);
1556
1579 void *purple_request_folder(void *handle, const char *title, const char *dirname,
1580 GCallback ok_cb, GCallback cancel_cb,
1581 PurpleAccount *account, const char *who, PurpleConversation *conv,
1582 void *user_data);
1583
1584
1603 void *purple_request_screenshare_media(void *handle, const char *title,
1604 const char *primary, const char *secondary,
1605 PurpleAccount *account, GCallback cb,
1606 void *user_data);
1607
1610/**************************************************************************/
1612/**************************************************************************/
1621 void purple_request_set_ui_ops(PurpleRequestUiOps *ops);
1622
1629 PurpleRequestUiOps *purple_request_get_ui_ops(void);
1630
1633#ifdef __cplusplus
1634}
1635#endif
1636
1637#endif /* _PURPLE_REQUEST_H_ */
account.h
Account API.
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_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_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_close
void purple_request_close(PurpleRequestType type, void *uihandle)
Closes a request.
purple_request_field_get_type_hint
const char * purple_request_field_get_type_hint(const PurpleRequestField *field)
Returns the field's type hint.
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_bool
gboolean purple_request_fields_get_bool(const PurpleRequestFields *fields, const char *id)
Returns the boolean value of a field with the specified ID.
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_field_get_type
PurpleRequestFieldType purple_request_field_get_type(const PurpleRequestField *field)
Returns the type of a field.
purple_request_field_get_id
const char * purple_request_field_get_id(const PurpleRequestField *field)
Returns the ID of a field.
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_int_new
PurpleRequestField * purple_request_field_int_new(const char *id, const char *text, int default_value)
Creates an integer field.
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_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_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_is_required
gboolean purple_request_field_is_required(const PurpleRequestField *field)
Returns whether or not a field is required.
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.
purple_request_close_with_handle
void purple_request_close_with_handle(void *handle)
Closes all requests registered with the specified handle.
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.
PurpleRequestType
PurpleRequestType
Request types.
Definition: request.h:44
PURPLE_REQUEST_SCREENSHARE
@ PURPLE_REQUEST_SCREENSHARE
Screenshare media request.
Definition: request.h:51
PURPLE_REQUEST_INPUT
@ PURPLE_REQUEST_INPUT
Text input request.
Definition: request.h:45
PURPLE_REQUEST_FIELDS
@ PURPLE_REQUEST_FIELDS
Multiple fields request.
Definition: request.h:48
PURPLE_REQUEST_CHOICE
@ PURPLE_REQUEST_CHOICE
Multiple-choice request.
Definition: request.h:46
PURPLE_REQUEST_FILE
@ PURPLE_REQUEST_FILE
File open or save request.
Definition: request.h:49
PURPLE_REQUEST_ACTION
@ PURPLE_REQUEST_ACTION
Action request.
Definition: request.h:47
PURPLE_REQUEST_FOLDER
@ PURPLE_REQUEST_FOLDER
Folder selection request.
Definition: request.h:50
purple_request_field_int_set_value
void purple_request_field_int_set_value(PurpleRequestField *field, int value)
Sets the value in an integer field.
purple_request_fields_new
PurpleRequestFields * purple_request_fields_new(void)
Creates a list of fields to pass to purple_request_fields().
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_image_get_size
gsize purple_request_field_image_get_size(PurpleRequestField *field)
Returns size (in bytes) of the image.
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_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_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_label_new
PurpleRequestField * purple_request_field_label_new(const char *id, const char *text)
Creates a label field.
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_get_ui_data
gpointer purple_request_field_get_ui_data(const PurpleRequestField *field)
Returns the ui_data for a field.
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_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_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_int_get_value
int purple_request_field_int_get_value(const PurpleRequestField *field)
Returns the user-entered value in an integer 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_account_new
PurpleRequestField * purple_request_field_account_new(const char *id, const char *text, PurpleAccount *account)
Creates an account field.
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_new
PurpleRequestField * purple_request_field_bool_new(const char *id, const char *text, gboolean default_value)
Creates a boolean field.
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_get_label
const char * purple_request_field_get_label(const PurpleRequestField *field)
Returns the label text of 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_choice_set_value
void purple_request_field_choice_set_value(PurpleRequestField *field, int value)
Sets the value in an choice field.
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.
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_choice_get_value
int purple_request_field_choice_get_value(const PurpleRequestField *field)
Returns the user-entered value in an choice 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_new
PurpleRequestField * purple_request_field_new(const char *id, const char *text, PurpleRequestFieldType type)
Creates a field of the specified type.
purple_request_field_get_group
PurpleRequestFieldGroup * purple_request_field_get_group(const PurpleRequestField *field)
Returns the group for the field.
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_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_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_list_get_items
GList * purple_request_field_list_get_items(const PurpleRequestField *field)
Returns a list of items in a list field.
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_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_string_set_value
void purple_request_field_string_set_value(PurpleRequestField *field, const char *value)
Sets the value in a string 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_field_destroy
void purple_request_field_destroy(PurpleRequestField *field)
Destroys a 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_fields_get_groups
GList * purple_request_fields_get_groups(const PurpleRequestFields *fields)
Returns a list of all groups in a field list.
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_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_set_label
void purple_request_field_set_label(PurpleRequestField *field, const char *label)
Sets the label text of a field.
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_set_required
void purple_request_field_set_required(PurpleRequestField *field, gboolean required)
Sets whether or not a field is required.
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_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_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_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_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_list_add
void purple_request_field_list_add(PurpleRequestField *field, const char *item, void *data)
Adds an item to a list field.
purple_request_fields_destroy
void purple_request_fields_destroy(PurpleRequestFields *fields)
Destroys a list of fields.
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_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_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_field_image_get_buffer
const char * purple_request_field_image_get_buffer(PurpleRequestField *field)
Returns pointer to the image.
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_list_clear_selected
void purple_request_field_list_clear_selected(PurpleRequestField *field)
Clears the list of selected items in a list 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_add_group
void purple_request_fields_add_group(PurpleRequestFields *fields, PurpleRequestFieldGroup *group)
Adds a group of fields to the list.
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_field_list_new
PurpleRequestField * purple_request_field_list_new(const char *id, const char *text)
Creates a multiple list item 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_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_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_fields_exists
gboolean purple_request_fields_exists(const PurpleRequestFields *fields, const char *id)
Returns whether or not the field with the specified ID exists.
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_screenshare_media
void * purple_request_screenshare_media(void *handle, const char *title, const char *primary, const char *secondary, PurpleAccount *account, GCallback cb, void *user_data)
Displays a dialog allowing the user to select a window/monitor etc.
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_group_destroy
void purple_request_field_group_destroy(PurpleRequestFieldGroup *group)
Destroys a fields group.
purple_request_field_set_visible
void purple_request_field_set_visible(PurpleRequestField *field, gboolean visible)
Sets whether or not a field is visible.
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_choice_new
PurpleRequestField * purple_request_field_choice_new(const char *id, const char *text, int default_value)
Creates a multiple choice field.
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_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_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_fields_get_required
GList * purple_request_fields_get_required(const PurpleRequestFields *fields)
Returns a list of all required fields.
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_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_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_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_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.
PurpleRequestActionCb
void(* PurpleRequestActionCb)(void *, int)
The type of callbacks passed to purple_request_action().
Definition: request.h:264
PurpleRequestFieldType
PurpleRequestFieldType
A type of field.
Definition: request.h:59
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_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_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_group_new
PurpleRequestFieldGroup * purple_request_field_group_new(const char *title)
Creates a fields group with an optional title.
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.
PurpleRequestFieldGroup
A group of fields with a title.
Definition: request.h:91
PurpleRequestFields
Multiple fields request data.
Definition: request.h:76
PurpleRequestUiOps
Request UI operations.
Definition: request.h:192
_PurpleAccount
Structure representing an account.
Definition: account.h:170
_PurpleConversation
A core representation of a conversation between two or more people.
Definition: conversation.h:339
_PurpleRequestField
A request field.
Definition: request.h:105