pidgin 2.14.14dev
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
35
36#include "account.h"
37
38#define PURPLE_DEFAULT_ACTION_NONE -1
39
54
58typedef 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
71
75typedef struct
76{
77 GList *groups;
78
79 GHashTable *fields;
80
81 GList *required_fields;
82
83 void *ui_data;
84
86
90typedef struct
91{
92 PurpleRequestFields *fields_list;
93
94 char *title;
95
96 GList *fields;
97
99
100#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_REQUEST_C_)
105{
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
191typedef 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);
257
258typedef void (*PurpleRequestInputCb)(void *, const char *);
259
264typedef 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/**************************************************************************/
285
292
301
310
320 const char *id);
321
330
340 const char *id);
341
350 const PurpleRequestFields *fields);
351
361 const PurpleRequestFields *fields, const char *id);
362
372 const char *id);
373
383 const char *id);
384
394 const char *id);
395
405 const char *id);
406
416 const char *id);
417
420/**************************************************************************/
422/**************************************************************************/
433
440
448 PurpleRequestField *field);
449
458 const PurpleRequestFieldGroup *group);
459
468 const PurpleRequestFieldGroup *group);
469
472/**************************************************************************/
474/**************************************************************************/
486PurpleRequestField *purple_request_field_new(const char *id, const char *text,
488
495
503
511
522 const char *type_hint);
523
531 gboolean required);
532
541
552
561
570
579
588
597
608
620 gpointer ui_data);
621
624/**************************************************************************/
626/**************************************************************************/
640 const char *text,
641 const char *default_value,
642 gboolean multiline);
643
651 const char *default_value);
652
660 const char *value);
661
670 gboolean masked);
671
679 gboolean editable);
680
689 const PurpleRequestField *field);
690
699
708
717
726
729/**************************************************************************/
731/**************************************************************************/
744 const char *text,
745 int default_value);
746
754 int default_value);
755
763
772
781
784/**************************************************************************/
786/**************************************************************************/
801 const char *text,
802 gboolean default_value);
803
811 gboolean default_value);
812
820 gboolean value);
821
830 const PurpleRequestField *field);
831
840
843/**************************************************************************/
845/**************************************************************************/
860 const char *text,
861 int default_value);
862
870 const char *label);
871
879 int default_value);
880
888
897
906
915
918/**************************************************************************/
920/**************************************************************************/
931PurpleRequestField *purple_request_field_list_new(const char *id, const char *text);
932
941 gboolean multi_select);
942
951 const PurpleRequestField *field);
952
962 const char *text);
963
974 const char *item, void *data);
975
985 const char *item, const char* icon_path, void* data);
986
994 const char *item);
995
1002
1010 GList *items);
1011
1021 const char *item);
1022
1034 const PurpleRequestField *field);
1035
1044
1056
1059/**************************************************************************/
1061/**************************************************************************/
1073 const char *text);
1074
1077/**************************************************************************/
1079/**************************************************************************/
1092PurpleRequestField *purple_request_field_image_new(const char *id, const char *text,
1093 const char *buf, gsize size);
1094
1102void purple_request_field_image_set_scale(PurpleRequestField *field, unsigned int x, unsigned int y);
1103
1112
1121
1130
1139
1142/**************************************************************************/
1144/**************************************************************************/
1159 const char *text,
1160 PurpleAccount *account);
1161
1169 PurpleAccount *default_value);
1170
1178 PurpleAccount *value);
1179
1190 gboolean show_all);
1191
1202 PurpleFilterAccountFunc filter_func);
1203
1212 const PurpleRequestField *field);
1213
1222 const PurpleRequestField *field);
1223
1234 const PurpleRequestField *field);
1235
1247 const PurpleRequestField *field);
1248
1251/**************************************************************************/
1253/**************************************************************************/
1302void *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
1343void *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
1353void *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
1395void *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
1403void *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
1413void *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
1424void *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
1460void *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
1473void purple_request_close(PurpleRequestType type, void *uihandle);
1474
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
1552void *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
1579void *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
1603void *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/**************************************************************************/
1622
1630
1633#ifdef __cplusplus
1634}
1635#endif
1636
1637#endif /* _PURPLE_REQUEST_H_ */
Account API.
void purple_request_field_group_add_field(PurpleRequestFieldGroup *group, PurpleRequestField *field)
Adds a field to the group.
void purple_request_field_string_set_editable(PurpleRequestField *field, gboolean editable)
Sets whether or not a string field is editable.
void purple_request_field_string_set_default_value(PurpleRequestField *field, const char *default_value)
Sets the default value in a string field.
void purple_request_close(PurpleRequestType type, void *uihandle)
Closes a request.
const char * purple_request_field_get_type_hint(const PurpleRequestField *field)
Returns the field's type hint.
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.
gboolean purple_request_fields_get_bool(const PurpleRequestFields *fields, const char *id)
Returns the boolean value of a field with the specified ID.
void purple_request_field_set_type_hint(PurpleRequestField *field, const char *type_hint)
Sets the type hint for the field.
PurpleRequestFieldType purple_request_field_get_type(const PurpleRequestField *field)
Returns the type of a field.
const char * purple_request_field_get_id(const PurpleRequestField *field)
Returns the ID of a field.
void purple_request_field_account_set_filter(PurpleRequestField *field, PurpleFilterAccountFunc filter_func)
Sets the account filter function in an account field.
PurpleRequestField * purple_request_field_int_new(const char *id, const char *text, int default_value)
Creates an integer field.
void * purple_request_field_list_get_data(const PurpleRequestField *field, const char *text)
Returns the data for a particular item.
gboolean purple_request_field_string_is_multiline(const PurpleRequestField *field)
Returns whether or not a string field is multi-line.
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.
gboolean purple_request_field_is_required(const PurpleRequestField *field)
Returns whether or not a field is required.
int purple_request_field_choice_get_default_value(const PurpleRequestField *field)
Returns the default value in an choice field.
void purple_request_close_with_handle(void *handle)
Closes all requests registered with the specified handle.
gboolean purple_request_field_string_is_masked(const PurpleRequestField *field)
Returns whether or not a string field is masked.
PurpleRequestType
Request types.
Definition request.h:44
@ PURPLE_REQUEST_SCREENSHARE
Screenshare media request.
Definition request.h:51
@ PURPLE_REQUEST_INPUT
Text input request.
Definition request.h:45
@ PURPLE_REQUEST_FIELDS
Multiple fields request.
Definition request.h:48
@ PURPLE_REQUEST_CHOICE
Multiple-choice request.
Definition request.h:46
@ PURPLE_REQUEST_FILE
File open or save request.
Definition request.h:49
@ PURPLE_REQUEST_ACTION
Action request.
Definition request.h:47
@ PURPLE_REQUEST_FOLDER
Folder selection request.
Definition request.h:50
void purple_request_field_int_set_value(PurpleRequestField *field, int value)
Sets the value in an integer field.
PurpleRequestFields * purple_request_fields_new(void)
Creates a list of fields to pass to purple_request_fields().
gboolean purple_request_field_bool_get_value(const PurpleRequestField *field)
Returns the user-entered value in an boolean field.
gsize purple_request_field_image_get_size(PurpleRequestField *field)
Returns size (in bytes) of the image.
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.
int purple_request_field_int_get_default_value(const PurpleRequestField *field)
Returns the default value in an integer field.
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.
PurpleRequestField * purple_request_field_label_new(const char *id, const char *text)
Creates a label field.
void purple_request_field_image_set_scale(PurpleRequestField *field, unsigned int x, unsigned int y)
Sets the scale factors of an image field.
gpointer purple_request_field_get_ui_data(const PurpleRequestField *field)
Returns the ui_data for a field.
void purple_request_field_account_set_value(PurpleRequestField *field, PurpleAccount *value)
Sets the account in an account field.
unsigned int purple_request_field_image_get_scale_x(PurpleRequestField *field)
Returns X scale coefficient of the image.
const char * purple_request_field_string_get_default_value(const PurpleRequestField *field)
Returns the default value in a string field.
int purple_request_field_int_get_value(const PurpleRequestField *field)
Returns the user-entered value in an integer field.
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 ...
PurpleRequestField * purple_request_field_account_new(const char *id, const char *text, PurpleAccount *account)
Creates an account field.
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.
PurpleRequestField * purple_request_field_bool_new(const char *id, const char *text, gboolean default_value)
Creates a boolean field.
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.
const char * purple_request_field_get_label(const PurpleRequestField *field)
Returns the label text of a field.
gboolean purple_request_field_is_visible(const PurpleRequestField *field)
Returns whether or not a field is visible.
void purple_request_field_choice_set_value(PurpleRequestField *field, int value)
Sets the value in an choice field.
void purple_request_field_bool_set_default_value(PurpleRequestField *field, gboolean default_value)
Sets the default value in an boolean field.
GList * purple_request_field_list_get_selected(const PurpleRequestField *field)
Returns a list of selected items in a list field.
int purple_request_field_choice_get_value(const PurpleRequestField *field)
Returns the user-entered value in an choice field.
void purple_request_field_list_add_selected(PurpleRequestField *field, const char *item)
Adds a selected item to the list field.
PurpleRequestField * purple_request_field_new(const char *id, const char *text, PurpleRequestFieldType type)
Creates a field of the specified type.
PurpleRequestFieldGroup * purple_request_field_get_group(const PurpleRequestField *field)
Returns the group for the field.
void purple_request_field_choice_add(PurpleRequestField *field, const char *label)
Adds a choice to a multiple choice field.
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).
int purple_request_fields_get_choice(const PurpleRequestFields *fields, const char *id)
Returns the choice index of a field with the specified ID.
GList * purple_request_field_list_get_items(const PurpleRequestField *field)
Returns a list of items in a list field.
gboolean purple_request_field_string_is_editable(const PurpleRequestField *field)
Returns whether or not a string field is editable.
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.
void purple_request_field_string_set_value(PurpleRequestField *field, const char *value)
Sets the value in a string field.
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.
void purple_request_field_destroy(PurpleRequestField *field)
Destroys a field.
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.
GList * purple_request_fields_get_groups(const PurpleRequestFields *fields)
Returns a list of all groups in a field list.
PurpleAccount * purple_request_fields_get_account(const PurpleRequestFields *fields, const char *id)
Returns the account of a field with the specified ID.
void purple_request_field_bool_set_value(PurpleRequestField *field, gboolean value)
Sets the value in an boolean field.
void purple_request_field_set_label(PurpleRequestField *field, const char *label)
Sets the label text of a field.
PurpleRequestField * purple_request_fields_get_field(const PurpleRequestFields *fields, const char *id)
Return the field with the specified ID.
void purple_request_field_set_required(PurpleRequestField *field, gboolean required)
Sets whether or not a field is required.
const char * purple_request_field_group_get_title(const PurpleRequestFieldGroup *group)
Returns the title of a fields group.
gboolean purple_request_field_bool_get_default_value(const PurpleRequestField *field)
Returns the default value in an boolean field.
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.
const char * purple_request_field_string_get_value(const PurpleRequestField *field)
Returns the user-entered value in a string field.
PurpleAccount * purple_request_field_account_get_value(const PurpleRequestField *field)
Returns the user-entered account in an account field.
void purple_request_field_list_add(PurpleRequestField *field, const char *item, void *data)
Adds an item to a list field.
void purple_request_fields_destroy(PurpleRequestFields *fields)
Destroys a list of fields.
PurpleRequestField * purple_request_field_image_new(const char *id, const char *text, const char *buf, gsize size)
Creates an image field.
void purple_request_field_int_set_default_value(PurpleRequestField *field, int default_value)
Sets the default value in an integer field.
void purple_request_field_account_set_default_value(PurpleRequestField *field, PurpleAccount *default_value)
Sets the default account on an account field.
const char * purple_request_field_image_get_buffer(PurpleRequestField *field)
Returns pointer to the image.
void purple_request_field_set_ui_data(PurpleRequestField *field, gpointer ui_data)
Sets the ui_data for a field.
void purple_request_field_list_clear_selected(PurpleRequestField *field)
Clears the list of selected items in a list field.
GList * purple_request_field_list_get_icons(const PurpleRequestField *field)
Returns a list of icons in a list field.
void purple_request_fields_add_group(PurpleRequestFields *fields, PurpleRequestFieldGroup *group)
Adds a group of fields to the list.
PurpleFilterAccountFunc purple_request_field_account_get_filter(const PurpleRequestField *field)
Returns the account filter function in an account field.
PurpleRequestField * purple_request_field_list_new(const char *id, const char *text)
Creates a multiple list item field.
PurpleRequestUiOps * purple_request_get_ui_ops(void)
Returns the UI operations structure to be used when displaying a request.
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.
PurpleRequestField * purple_request_field_string_new(const char *id, const char *text, const char *default_value, gboolean multiline)
Creates a string request field.
gboolean purple_request_fields_exists(const PurpleRequestFields *fields, const char *id)
Returns whether or not the field with the specified ID exists.
const char * purple_request_fields_get_string(const PurpleRequestFields *fields, const char *id)
Returns the string value of a field with the specified ID.
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.
int purple_request_fields_get_integer(const PurpleRequestFields *fields, const char *id)
Returns the integer value of a field with the specified ID.
void purple_request_field_group_destroy(PurpleRequestFieldGroup *group)
Destroys a fields group.
void purple_request_field_set_visible(PurpleRequestField *field, gboolean visible)
Sets whether or not a field is visible.
gboolean purple_request_field_account_get_show_all(const PurpleRequestField *field)
Returns whether or not to show all accounts in an account field.
PurpleRequestField * purple_request_field_choice_new(const char *id, const char *text, int default_value)
Creates a multiple choice field.
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.
gboolean purple_request_fields_all_required_filled(const PurpleRequestFields *fields)
Returns whether or not all required fields have values.
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.
GList * purple_request_fields_get_required(const PurpleRequestFields *fields)
Returns a list of all required fields.
unsigned int purple_request_field_image_get_scale_y(PurpleRequestField *field)
Returns Y scale coefficient of the image.
GList * purple_request_field_choice_get_labels(const PurpleRequestField *field)
Returns a list of labels in a choice field.
void purple_request_field_list_set_selected(PurpleRequestField *field, GList *items)
Sets a list of selected items in a list field.
void purple_request_field_list_set_multi_select(PurpleRequestField *field, gboolean multi_select)
Sets whether or not a list field allows multiple selection.
void purple_request_field_choice_set_default_value(PurpleRequestField *field, int default_value)
Sets the default value in an choice field.
void(* PurpleRequestActionCb)(void *, int)
The type of callbacks passed to purple_request_action().
Definition request.h:264
PurpleRequestFieldType
A type of field.
Definition request.h:59
gboolean purple_request_field_list_get_multi_select(const PurpleRequestField *field)
Returns whether or not a list field allows multiple selection.
PurpleAccount * purple_request_field_account_get_default_value(const PurpleRequestField *field)
Returns the default account in an account field.
void purple_request_set_ui_ops(PurpleRequestUiOps *ops)
Sets the UI operations structure to be used when displaying a request.
PurpleRequestFieldGroup * purple_request_field_group_new(const char *title)
Creates a fields group with an optional title.
GList * purple_request_field_group_get_fields(const PurpleRequestFieldGroup *group)
Returns a list of all fields in a group.
A group of fields with a title.
Definition request.h:91
Multiple fields request data.
Definition request.h:76
Request UI operations.
Definition request.h:192
Structure representing an account.
Definition account.h:170
A core representation of a conversation between two or more people.
A request field.
Definition request.h:105