Loading...
Searching...
No Matches
request.h
Go to the documentation of this file.
/* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PURPLE_REQUEST_H_
#define _PURPLE_REQUEST_H_
#include <stdlib.h>
#include <glib-object.h>
#include <glib.h>
typedef struct _PurpleRequestField PurpleRequestField;
#include "account.h"
#define PURPLE_DEFAULT_ACTION_NONE -1
typedef enum
{
PURPLE_REQUEST_INPUT = 0,
PURPLE_REQUEST_CHOICE,
PURPLE_REQUEST_ACTION,
PURPLE_REQUEST_FIELDS,
PURPLE_REQUEST_FILE,
PURPLE_REQUEST_FOLDER,
PURPLE_REQUEST_SCREENSHARE
} PurpleRequestType;
typedef enum
{
PURPLE_REQUEST_FIELD_NONE,
PURPLE_REQUEST_FIELD_STRING,
PURPLE_REQUEST_FIELD_INTEGER,
PURPLE_REQUEST_FIELD_BOOLEAN,
PURPLE_REQUEST_FIELD_CHOICE,
PURPLE_REQUEST_FIELD_LIST,
PURPLE_REQUEST_FIELD_LABEL,
PURPLE_REQUEST_FIELD_IMAGE,
PURPLE_REQUEST_FIELD_ACCOUNT
} PurpleRequestFieldType;
typedef struct
{
GList *groups;
GHashTable *fields;
GList *required_fields;
void *ui_data;
} PurpleRequestFields;
typedef struct
{
PurpleRequestFields *fields_list;
char *title;
GList *fields;
} PurpleRequestFieldGroup;
#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_REQUEST_C_)
struct _PurpleRequestField
{
PurpleRequestFieldType type;
PurpleRequestFieldGroup *group;
char *id;
char *label;
char *type_hint;
gboolean visible;
gboolean required;
union
{
struct
{
gboolean multiline;
gboolean masked;
gboolean editable;
char *default_value;
char *value;
} string;
struct
{
int default_value;
int value;
} integer;
struct
{
gboolean default_value;
gboolean value;
} boolean;
struct
{
int default_value;
int value;
GList *labels;
} choice;
struct
{
GList *items;
GList *icons;
GHashTable *item_data;
GList *selected;
GHashTable *selected_table;
gboolean multiple_selection;
} list;
struct
{
PurpleAccount *default_account;
PurpleAccount *account;
gboolean show_all;
PurpleFilterAccountFunc filter_func;
} account;
struct
{
unsigned int scale_x;
unsigned int scale_y;
const char *buffer;
gsize size;
} image;
} u;
void *ui_data;
};
#endif
typedef struct
{
void *(*request_input)(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);
void *(*request_choice)(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);
void *(*request_action)(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);
void *(*request_fields)(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);
void *(*request_file)(const char *title, const char *filename,
gboolean savedialog, GCallback ok_cb,
GCallback cancel_cb, PurpleAccount *account,
const char *who, PurpleConversation *conv,
void *user_data);
void (*close_request)(PurpleRequestType type, void *ui_handle);
void *(*request_folder)(const char *title, const char *dirname,
GCallback ok_cb, GCallback cancel_cb,
PurpleAccount *account, const char *who,
PurpleConversation *conv, void *user_data);
void *(*request_action_with_icon)(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);
void *(*request_screenshare_media)(const char *title, const char *primary,
const char *secondary, PurpleAccount *account,
GCallback cb, void *user_data);
void (*_purple_reserved1)(void);
void (*_purple_reserved2)(void);
} PurpleRequestUiOps;
typedef void (*PurpleRequestInputCb)(void *, const char *);
typedef void (*PurpleRequestActionCb)(void *, int);
typedef void (*PurpleRequestChoiceCb)(void *, int);
typedef void (*PurpleRequestFieldsCb)(void *, PurpleRequestFields *fields);
typedef void (*PurpleRequestFileCb)(void *, const char *filename);
typedef void (*PurpleRequestScreenshareCb)(void *, GObject *info);
#ifdef __cplusplus
extern "C" {
#endif
/**************************************************************************/
/**************************************************************************/
PurpleRequestFields *purple_request_fields_new(void);
void purple_request_fields_destroy(PurpleRequestFields *fields);
void purple_request_fields_add_group(PurpleRequestFields *fields,
PurpleRequestFieldGroup *group);
GList *purple_request_fields_get_groups(const PurpleRequestFields *fields);
gboolean purple_request_fields_exists(const PurpleRequestFields *fields,
const char *id);
GList *purple_request_fields_get_required(const PurpleRequestFields *fields);
gboolean purple_request_fields_is_field_required(const PurpleRequestFields *fields,
const char *id);
gboolean purple_request_fields_all_required_filled(
const PurpleRequestFields *fields);
PurpleRequestField *purple_request_fields_get_field(
const PurpleRequestFields *fields, const char *id);
const char *purple_request_fields_get_string(const PurpleRequestFields *fields,
const char *id);
int purple_request_fields_get_integer(const PurpleRequestFields *fields,
const char *id);
gboolean purple_request_fields_get_bool(const PurpleRequestFields *fields,
const char *id);
int purple_request_fields_get_choice(const PurpleRequestFields *fields,
const char *id);
PurpleAccount *purple_request_fields_get_account(const PurpleRequestFields *fields,
const char *id);
/**************************************************************************/
/**************************************************************************/
PurpleRequestFieldGroup *purple_request_field_group_new(const char *title);
void purple_request_field_group_destroy(PurpleRequestFieldGroup *group);
void purple_request_field_group_add_field(PurpleRequestFieldGroup *group,
PurpleRequestField *field);
const char *purple_request_field_group_get_title(
const PurpleRequestFieldGroup *group);
GList *purple_request_field_group_get_fields(
const PurpleRequestFieldGroup *group);
/**************************************************************************/
/**************************************************************************/
PurpleRequestField *purple_request_field_new(const char *id, const char *text,
PurpleRequestFieldType type);
void purple_request_field_destroy(PurpleRequestField *field);
void purple_request_field_set_label(PurpleRequestField *field, const char *label);
void purple_request_field_set_visible(PurpleRequestField *field, gboolean visible);
void purple_request_field_set_type_hint(PurpleRequestField *field,
const char *type_hint);
void purple_request_field_set_required(PurpleRequestField *field,
gboolean required);
PurpleRequestFieldType purple_request_field_get_type(const PurpleRequestField *field);
PurpleRequestFieldGroup *purple_request_field_get_group(const PurpleRequestField *field);
const char *purple_request_field_get_id(const PurpleRequestField *field);
const char *purple_request_field_get_label(const PurpleRequestField *field);
gboolean purple_request_field_is_visible(const PurpleRequestField *field);
const char *purple_request_field_get_type_hint(const PurpleRequestField *field);
gboolean purple_request_field_is_required(const PurpleRequestField *field);
gpointer purple_request_field_get_ui_data(const PurpleRequestField *field);
void purple_request_field_set_ui_data(PurpleRequestField *field,
gpointer ui_data);
/**************************************************************************/
/**************************************************************************/
PurpleRequestField *purple_request_field_string_new(const char *id,
const char *text,
const char *default_value,
gboolean multiline);
void purple_request_field_string_set_default_value(PurpleRequestField *field,
const char *default_value);
void purple_request_field_string_set_value(PurpleRequestField *field,
const char *value);
void purple_request_field_string_set_masked(PurpleRequestField *field,
gboolean masked);
void purple_request_field_string_set_editable(PurpleRequestField *field,
gboolean editable);
const char *purple_request_field_string_get_default_value(
const PurpleRequestField *field);
const char *purple_request_field_string_get_value(const PurpleRequestField *field);
gboolean purple_request_field_string_is_multiline(const PurpleRequestField *field);
gboolean purple_request_field_string_is_masked(const PurpleRequestField *field);
gboolean purple_request_field_string_is_editable(const PurpleRequestField *field);
/**************************************************************************/
/**************************************************************************/
PurpleRequestField *purple_request_field_int_new(const char *id,
const char *text,
int default_value);
void purple_request_field_int_set_default_value(PurpleRequestField *field,
int default_value);
void purple_request_field_int_set_value(PurpleRequestField *field, int value);
int purple_request_field_int_get_default_value(const PurpleRequestField *field);
int purple_request_field_int_get_value(const PurpleRequestField *field);
/**************************************************************************/
/**************************************************************************/
PurpleRequestField *purple_request_field_bool_new(const char *id,
const char *text,
gboolean default_value);
void purple_request_field_bool_set_default_value(PurpleRequestField *field,
gboolean default_value);
void purple_request_field_bool_set_value(PurpleRequestField *field,
gboolean value);
gboolean purple_request_field_bool_get_default_value(
const PurpleRequestField *field);
gboolean purple_request_field_bool_get_value(const PurpleRequestField *field);
/**************************************************************************/
/**************************************************************************/
PurpleRequestField *purple_request_field_choice_new(const char *id,
const char *text,
int default_value);
void purple_request_field_choice_add(PurpleRequestField *field,
const char *label);
void purple_request_field_choice_set_default_value(PurpleRequestField *field,
int default_value);
void purple_request_field_choice_set_value(PurpleRequestField *field, int value);
int purple_request_field_choice_get_default_value(const PurpleRequestField *field);
int purple_request_field_choice_get_value(const PurpleRequestField *field);
GList *purple_request_field_choice_get_labels(const PurpleRequestField *field);
/**************************************************************************/
/**************************************************************************/
PurpleRequestField *purple_request_field_list_new(const char *id, const char *text);
void purple_request_field_list_set_multi_select(PurpleRequestField *field,
gboolean multi_select);
gboolean purple_request_field_list_get_multi_select(
const PurpleRequestField *field);
void *purple_request_field_list_get_data(const PurpleRequestField *field,
const char *text);
void purple_request_field_list_add(PurpleRequestField *field,
const char *item, void *data);
void purple_request_field_list_add_icon(PurpleRequestField *field,
const char *item, const char* icon_path, void* data);
void purple_request_field_list_add_selected(PurpleRequestField *field,
const char *item);
void purple_request_field_list_clear_selected(PurpleRequestField *field);
void purple_request_field_list_set_selected(PurpleRequestField *field,
GList *items);
gboolean purple_request_field_list_is_selected(const PurpleRequestField *field,
const char *item);
GList *purple_request_field_list_get_selected(
const PurpleRequestField *field);
GList *purple_request_field_list_get_items(const PurpleRequestField *field);
GList *purple_request_field_list_get_icons(const PurpleRequestField *field);
/**************************************************************************/
/**************************************************************************/
PurpleRequestField *purple_request_field_label_new(const char *id,
const char *text);
/**************************************************************************/
/**************************************************************************/
PurpleRequestField *purple_request_field_image_new(const char *id, const char *text,
const char *buf, gsize size);
void purple_request_field_image_set_scale(PurpleRequestField *field, unsigned int x, unsigned int y);
const char *purple_request_field_image_get_buffer(PurpleRequestField *field);
gsize purple_request_field_image_get_size(PurpleRequestField *field);
unsigned int purple_request_field_image_get_scale_x(PurpleRequestField *field);
unsigned int purple_request_field_image_get_scale_y(PurpleRequestField *field);
/**************************************************************************/
/**************************************************************************/
PurpleRequestField *purple_request_field_account_new(const char *id,
const char *text,
PurpleAccount *account);
void purple_request_field_account_set_default_value(PurpleRequestField *field,
PurpleAccount *default_value);
void purple_request_field_account_set_value(PurpleRequestField *field,
PurpleAccount *value);
void purple_request_field_account_set_show_all(PurpleRequestField *field,
gboolean show_all);
void purple_request_field_account_set_filter(PurpleRequestField *field,
PurpleFilterAccountFunc filter_func);
PurpleAccount *purple_request_field_account_get_default_value(
const PurpleRequestField *field);
PurpleAccount *purple_request_field_account_get_value(
const PurpleRequestField *field);
gboolean purple_request_field_account_get_show_all(
const PurpleRequestField *field);
PurpleFilterAccountFunc purple_request_field_account_get_filter(
const PurpleRequestField *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);
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;
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);
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, ...);
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);
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, ...);
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);
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);
void purple_request_close(PurpleRequestType type, void *uihandle);
void purple_request_close_with_handle(void *handle);
#define purple_request_yes_no(handle, title, primary, secondary, \
default_action, account, who, conv, \
user_data, yes_cb, no_cb) \
purple_request_action((handle), (title), (primary), (secondary), \
(default_action), account, who, conv, (user_data), 2, \
_("_Yes"), (yes_cb), _("_No"), (no_cb))
#define purple_request_ok_cancel(handle, title, primary, secondary, \
default_action, account, who, conv, \
user_data, ok_cb, cancel_cb) \
purple_request_action((handle), (title), (primary), (secondary), \
(default_action), account, who, conv, (user_data), 2, \
_("_OK"), (ok_cb), _("_Cancel"), (cancel_cb))
#define purple_request_accept_cancel(handle, title, primary, secondary, \
default_action, account, who, conv, \
user_data, accept_cb, cancel_cb) \
purple_request_action((handle), (title), (primary), (secondary), \
(default_action), account, who, conv, (user_data), 2, \
_("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb))
#define purple_request_accept_cancel_with_icon(handle, title, primary, secondary, \
default_action, account, who, conv, \
icon_data, icon_size, \
user_data, accept_cb, cancel_cb) \
purple_request_action_with_icon((handle), (title), (primary), (secondary), \
(default_action), account, who, conv, icon_data, icon_size, \
(user_data), 2, \
_("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb))
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);
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);
void *purple_request_screenshare_media(void *handle, const char *title,
const char *primary, const char *secondary,
PurpleAccount *account, GCallback cb,
void *user_data);
/**************************************************************************/
/**************************************************************************/
void purple_request_set_ui_ops(PurpleRequestUiOps *ops);
PurpleRequestUiOps *purple_request_get_ui_ops(void);
#ifdef __cplusplus
}
#endif
#endif /* _PURPLE_REQUEST_H_ */
account.h
Account API.
PurpleAccount
struct _PurpleAccount PurpleAccount
Structure representing an account.
Definition account.h:38
PurpleConversation
struct _PurpleConversation PurpleConversation
A core representation of a conversation between two or more people.
Definition conversation.h:38
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.
PurpleRequestField
struct _PurpleRequestField PurpleRequestField
A request field.
Definition request.h:34
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
_PurpleRequestField
A request field.
Definition request.h:105