1 #include "module.h"
2 
3 MODULE = Purple::Account::Option  PACKAGE = Purple::Account::Option  PREFIX = purple_account_option_
4 PROTOTYPES: ENABLE
5 
6 void
7 purple_account_option_destroy(option)
8 	Purple::Account::Option option
9 
10 const char *
11 purple_account_option_get_default_string(option)
12 	Purple::Account::Option option
13 
14 void
15 purple_account_option_add_list_item(option, key, value)
16 	Purple::Account::Option option
17 	const char * key
18 	const char * value
19 
20 void
21 purple_account_option_set_default_string(option, value);
22 	Purple::Account::Option option
23 	const char * value
24 
25 void
26 purple_account_option_set_default_int(option, value);
27 	Purple::Account::Option option
28 	int value
29 
30 void
31 purple_account_option_set_default_bool(option, value);
32 	Purple::Account::Option option
33 	gboolean value
34 
35 Purple::Account::Option
36 purple_account_option_list_new(class, text, pref_name, values)
37 	const char * text
38 	const char * pref_name
39 	SV * values
40 PREINIT:
41 	GList *t_GL;
42 	int i, t_len;
43 CODE:
44 	t_GL = NULL;
45 	t_len = av_len((AV *)SvRV(values));
46 
47 	for (i = 0; i <= t_len; i++)
48 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(values), i, 0)));
49 
50 	RETVAL  = purple_account_option_list_new(text, pref_name, t_GL);
51 OUTPUT:
52 	RETVAL
53 
54 Purple::Account::Option
55 purple_account_option_string_new(class, text, pref_name, default_value)
56 	const char * text
57 	const char * pref_name
58 	const char * default_value
59     C_ARGS:
60 	text, pref_name, default_value
61 
62 Purple::Account::Option
63 purple_account_option_int_new(class, text, pref_name, default_value)
64 	const char * text
65 	const char * pref_name
66 	gboolean default_value
67     C_ARGS:
68 	text, pref_name, default_value
69 
70 Purple::Account::Option
71 purple_account_option_bool_new(class, text, pref_name, default_value)
72 	const char * text
73 	const char * pref_name
74 	gboolean default_value
75     C_ARGS:
76 	text, pref_name, default_value
77 
78 Purple::Account::Option
79 purple_account_option_new(class, type, text, pref_name)
80 	Purple::PrefType type
81 	const char * text
82 	const char * pref_name
83     C_ARGS:
84 	type, text, pref_name
85 
86 void
87 purple_account_option_get_list(option)
88 	Purple::Account::Option option
89 PREINIT:
90 	GList *l;
91 PPCODE:
92 	for (l = purple_account_option_get_list(option); l != NULL; l = l->next) {
93 		/* XXX These are actually PurpleKeyValuePairs but we don't have a
94 		 * type for that and even if we did I don't think there's
95 		 * anything perl could do with them, so I'm just going to
96 		 * leave this as a Purple::ListEntry for now. */
97 		XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::ListEntry")));
98 	}
99 
100 Purple::PrefType
101 purple_account_option_get_type(option)
102 	Purple::Account::Option option
103 
104 gboolean
105 purple_account_option_get_masked(option)
106 	Purple::Account::Option option
107 
108 int
109 purple_account_option_get_default_int(option)
110 	Purple::Account::Option option;
111 
112 gboolean
113 purple_account_option_get_default_bool(option)
114 	Purple::Account::Option option;
115 
116 const char *
117 purple_account_option_get_setting(option)
118 	Purple::Account::Option option
119 
120 const char *
121 purple_account_option_get_text(option)
122 	Purple::Account::Option option
123 
124 void
125 purple_account_option_set_list(option, values)
126 	Purple::Account::Option option
127 	SV * values
128 PREINIT:
129 	GList *t_GL;
130 	int i, t_len;
131 PPCODE:
132 	t_GL = NULL;
133 	t_len = av_len((AV *)SvRV(values));
134 
135 	for (i = 0; i <= t_len; i++)
136 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(values), i, 0)));
137 
138 	purple_account_option_set_list(option, t_GL);
139 
140 void
141 purple_account_option_set_masked(option, masked)
142 	Purple::Account::Option option
143 	gboolean masked
144 
145 MODULE = Purple::Account::Option  PACKAGE = Purple::Account::UserSplit  PREFIX = purple_account_user_split_
146 PROTOTYPES: ENABLE
147 
148 Purple::Account::UserSplit
149 purple_account_user_split_new(class, text, default_value, sep)
150 	const char * text
151 	const char * default_value
152 	char sep
153     C_ARGS:
154 	text, default_value, sep
155 
156 char
157 purple_account_user_split_get_separator(split)
158 	Purple::Account::UserSplit split
159 
160 const char *
161 purple_account_user_split_get_text(split)
162 	Purple::Account::UserSplit split
163 
164 void
165 purple_account_user_split_destroy(split)
166 	Purple::Account::UserSplit split
167