Initial 'dev' branch commit.
[python-purple] / libpurple / accountopt.pxd
1 #
2 #  Copyright (c) 2008 INdT - Instituto Nokia de Tecnologia
3 #
4 #  This file is part of python-purple.
5 #
6 #  python-purple is free software: you can redistribute it and/or modify
7 #  it under the terms of the GNU General Public License as published by
8 #  the Free Software Foundation, either version 3 of the License, or
9 #  (at your option) any later version.
10 #
11 #  python-purple is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #  GNU General Public License for more details.
15 #
16 #  You should have received a copy of the GNU General Public License
17 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 cimport glib
21
22 cimport prefs
23
24 cdef extern from "libpurple/accountopt.h":
25
26     ctypedef struct UnionType:
27         glib.gboolean boolean
28         int integer
29         char *string
30         glib.GList *list
31
32     ctypedef struct PurpleAccountOption:
33         prefs.PurplePrefType type
34         char *text
35         char *pref_name
36         UnionType default_value
37         glib.gboolean masked
38
39     ctypedef struct PurpleAccountUserSplit:
40         char *text
41         char *default_value
42         char field_sep
43         glib.gboolean reverse
44
45     # Account Option API
46     PurpleAccountOption *purple_account_option_new(prefs.PurplePrefType type, \
47             char *text, char *pref_name)
48     PurpleAccountOption *purple_account_option_bool_new(char *text, \
49             char *pref_name, glib.gboolean default_value)
50     PurpleAccountOption *purple_account_option_int_new(char *text, \
51             char *pref_name, int default_value)
52     PurpleAccountOption *purple_account_option_string_new(char *text, \
53             char *pref_name,  char *default_value)
54     PurpleAccountOption *purple_account_option_list_new(char *text, \
55             char *pref_name, glib.GList *list)
56     void purple_account_option_destroy(PurpleAccountOption *option)
57     void purple_account_option_set_default_bool(PurpleAccountOption *option, \
58             glib.gboolean value)
59     void purple_account_option_set_default_int(PurpleAccountOption *option, \
60             int value)
61     void purple_account_option_set_default_string( \
62             PurpleAccountOption *option, char *value)
63     void purple_account_option_set_masked(PurpleAccountOption *option, \
64             glib.gboolean masked)
65     void purple_account_option_set_list(PurpleAccountOption *option, \
66             glib.GList *values)
67     void purple_account_option_add_list_item(PurpleAccountOption *option, \
68             char *key,  char *value)
69     prefs.PurplePrefType purple_account_option_get_type( \
70             PurpleAccountOption *option)
71     char *purple_account_option_get_text( PurpleAccountOption *option)
72     char *purple_account_option_get_setting( PurpleAccountOption *option)
73     glib.gboolean purple_account_option_get_default_bool( \
74             PurpleAccountOption *option)
75     int purple_account_option_get_default_int(PurpleAccountOption *option)
76     char *purple_account_option_get_default_string(PurpleAccountOption *option)
77     char *purple_account_option_get_default_list_value( \
78             PurpleAccountOption *option)
79     glib.gboolean purple_account_option_get_masked( \
80             PurpleAccountOption *option)
81     glib.GList *purple_account_option_get_list( \
82             PurpleAccountOption *option)
83     PurpleAccountUserSplit *purple_account_user_split_new(char *text, \
84             char *default_value, char sep)
85     void purple_account_user_split_destroy(PurpleAccountUserSplit *split)
86     char *purple_account_user_split_get_text( PurpleAccountUserSplit *split)
87     char *purple_account_user_split_get_default_value( \
88             PurpleAccountUserSplit *split)
89     char purple_account_user_split_get_separator(PurpleAccountUserSplit *split)
90     glib.gboolean purple_account_user_split_get_reverse( \
91             PurpleAccountUserSplit *split)
92     void purple_account_user_split_set_reverse(PurpleAccountUserSplit *split, \
93             glib.gboolean reverse)