Loading...
Searching...
No Matches
accountopt.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_ACCOUNTOPT_H_
#define _PURPLE_ACCOUNTOPT_H_
#include "prefs.h"
typedef struct
{
PurplePrefType type;
char *text;
char *pref_name;
union
{
gboolean boolean;
int integer;
char *string;
GList *list;
} default_value;
gboolean masked;
} PurpleAccountOption;
typedef struct
{
char *text;
char *default_value;
char field_sep;
gboolean reverse;
} PurpleAccountUserSplit;
#ifdef __cplusplus
extern "C" {
#endif
/**************************************************************************/
/**************************************************************************/
PurpleAccountOption *purple_account_option_new(PurplePrefType type,
const char *text, const char *pref_name);
PurpleAccountOption *purple_account_option_bool_new(const char *text,
const char *pref_name, gboolean default_value);
PurpleAccountOption *purple_account_option_int_new(const char *text,
const char *pref_name, int default_value);
PurpleAccountOption *purple_account_option_string_new(const char *text,
const char *pref_name, const char *default_value);
PurpleAccountOption *purple_account_option_list_new(const char *text,
const char *pref_name, GList *list);
void purple_account_option_destroy(PurpleAccountOption *option);
void purple_account_option_set_default_bool(PurpleAccountOption *option,
gboolean value);
void purple_account_option_set_default_int(PurpleAccountOption *option,
int value);
void purple_account_option_set_default_string(PurpleAccountOption *option,
const char *value);
void
purple_account_option_set_masked(PurpleAccountOption *option, gboolean masked);
void purple_account_option_set_list(PurpleAccountOption *option, GList *values);
void purple_account_option_add_list_item(PurpleAccountOption *option,
const char *key, const char *value);
PurplePrefType purple_account_option_get_type(const PurpleAccountOption *option);
const char *purple_account_option_get_text(const PurpleAccountOption *option);
const char *purple_account_option_get_setting(const PurpleAccountOption *option);
gboolean purple_account_option_get_default_bool(const PurpleAccountOption *option);
int purple_account_option_get_default_int(const PurpleAccountOption *option);
const char *purple_account_option_get_default_string(
const PurpleAccountOption *option);
const char *purple_account_option_get_default_list_value(
const PurpleAccountOption *option);
gboolean
purple_account_option_get_masked(const PurpleAccountOption *option);
GList *purple_account_option_get_list(const PurpleAccountOption *option);
/**************************************************************************/
/**************************************************************************/
PurpleAccountUserSplit *purple_account_user_split_new(const char *text,
const char *default_value,
char sep);
void purple_account_user_split_destroy(PurpleAccountUserSplit *split);
const char *purple_account_user_split_get_text(const PurpleAccountUserSplit *split);
const char *purple_account_user_split_get_default_value(
const PurpleAccountUserSplit *split);
char purple_account_user_split_get_separator(const PurpleAccountUserSplit *split);
gboolean purple_account_user_split_get_reverse(const PurpleAccountUserSplit *split);
void purple_account_user_split_set_reverse(PurpleAccountUserSplit *split, gboolean reverse);
#ifdef __cplusplus
}
#endif
#endif /* _PURPLE_ACCOUNTOPT_H_ */
purple_account_option_get_list
GList * purple_account_option_get_list(const PurpleAccountOption *option)
Returns the list values for an account option.
purple_account_option_set_default_string
void purple_account_option_set_default_string(PurpleAccountOption *option, const char *value)
Sets the default string value for an account option.
purple_account_option_get_setting
const char * purple_account_option_get_setting(const PurpleAccountOption *option)
Returns the name of an account option.
purple_account_option_list_new
PurpleAccountOption * purple_account_option_list_new(const char *text, const char *pref_name, GList *list)
Creates a new list account option.
purple_account_option_destroy
void purple_account_option_destroy(PurpleAccountOption *option)
Destroys an account option.
purple_account_user_split_get_separator
char purple_account_user_split_get_separator(const PurpleAccountUserSplit *split)
Returns the field separator for an account split.
purple_account_option_get_default_list_value
const char * purple_account_option_get_default_list_value(const PurpleAccountOption *option)
Returns the default string value for a list account option.
purple_account_user_split_destroy
void purple_account_user_split_destroy(PurpleAccountUserSplit *split)
Destroys an account username split.
purple_account_option_string_new
PurpleAccountOption * purple_account_option_string_new(const char *text, const char *pref_name, const char *default_value)
Creates a new string account option.
purple_account_option_bool_new
PurpleAccountOption * purple_account_option_bool_new(const char *text, const char *pref_name, gboolean default_value)
Creates a new boolean account option.
purple_account_user_split_get_text
const char * purple_account_user_split_get_text(const PurpleAccountUserSplit *split)
Returns the text for an account username split.
purple_account_option_set_default_int
void purple_account_option_set_default_int(PurpleAccountOption *option, int value)
Sets the default integer value for an account option.
purple_account_user_split_set_reverse
void purple_account_user_split_set_reverse(PurpleAccountUserSplit *split, gboolean reverse)
Sets the 'reverse' value for an account split.
purple_account_option_get_type
PurplePrefType purple_account_option_get_type(const PurpleAccountOption *option)
Returns the specified account option's type.
purple_account_option_new
PurpleAccountOption * purple_account_option_new(PurplePrefType type, const char *text, const char *pref_name)
Creates a new account option.
purple_account_option_get_default_string
const char * purple_account_option_get_default_string(const PurpleAccountOption *option)
Returns the default string value for an account option.
purple_account_option_int_new
PurpleAccountOption * purple_account_option_int_new(const char *text, const char *pref_name, int default_value)
Creates a new integer account option.
purple_account_option_set_list
void purple_account_option_set_list(PurpleAccountOption *option, GList *values)
Sets the list values for an account option.
purple_account_option_get_text
const char * purple_account_option_get_text(const PurpleAccountOption *option)
Returns the text for an account option.
purple_account_option_set_masked
void purple_account_option_set_masked(PurpleAccountOption *option, gboolean masked)
Sets the masking for an account option.
purple_account_option_set_default_bool
void purple_account_option_set_default_bool(PurpleAccountOption *option, gboolean value)
Sets the default boolean value for an account option.
purple_account_option_get_default_int
int purple_account_option_get_default_int(const PurpleAccountOption *option)
Returns the default integer value for an account option.
purple_account_option_add_list_item
void purple_account_option_add_list_item(PurpleAccountOption *option, const char *key, const char *value)
Adds an item to a list account option.
purple_account_user_split_new
PurpleAccountUserSplit * purple_account_user_split_new(const char *text, const char *default_value, char sep)
Creates a new account username split.
purple_account_user_split_get_default_value
const char * purple_account_user_split_get_default_value(const PurpleAccountUserSplit *split)
Returns the default string value for an account split.
purple_account_option_get_masked
gboolean purple_account_option_get_masked(const PurpleAccountOption *option)
Returns whether an option's value should be masked from view, like a password.
purple_account_option_get_default_bool
gboolean purple_account_option_get_default_bool(const PurpleAccountOption *option)
Returns the default boolean value for an account option.
purple_account_user_split_get_reverse
gboolean purple_account_user_split_get_reverse(const PurpleAccountUserSplit *split)
Returns the 'reverse' value for an account split.
prefs.h
Prefs API.
PurplePrefType
enum _PurplePrefType PurplePrefType
Preference data types.
PurpleAccountOption
An option for an account.
Definition accountopt.h:38
PurpleAccountOption::list
GList * list
The default list value.
Definition accountopt.h:49
PurpleAccountOption::string
char * string
The default string value.
Definition accountopt.h:48
PurpleAccountOption::text
char * text
The text that will appear to the user.
Definition accountopt.h:41
PurpleAccountOption::type
PurplePrefType type
The type of value.
Definition accountopt.h:39
PurpleAccountOption::boolean
gboolean boolean
The default boolean value.
Definition accountopt.h:46
PurpleAccountOption::pref_name
char * pref_name
The name of the associated preference.
Definition accountopt.h:42
PurpleAccountOption::masked
gboolean masked
Whether the value entered should be obscured from view (for passwords and similar options).
Definition accountopt.h:53
PurpleAccountOption::integer
int integer
The default integer value.
Definition accountopt.h:47
PurpleAccountUserSplit
A username split.
Definition accountopt.h:66
PurpleAccountUserSplit::field_sep
char field_sep
The field separator.
Definition accountopt.h:69
PurpleAccountUserSplit::text
char * text
The text that will appear to the user.
Definition accountopt.h:67
PurpleAccountUserSplit::reverse
gboolean reverse
TRUE if the separator should be found starting a the end of the string, FALSE otherwise.
Definition accountopt.h:70
PurpleAccountUserSplit::default_value
char * default_value
The default value.
Definition accountopt.h:68
option
Definition finch/getopt.h:85