Added various account parameters.
[python-purple] / libpurple / account.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 # hack to avoid recursive loops by cython
23 cdef extern from "libpurple/blist.h":
24     ctypedef struct PurpleBuddy:
25         pass
26
27     ctypedef struct PurpleGroup:
28         pass
29
30 cdef extern from "libpurple/connection.h":
31     ctypedef struct PurpleConnection:
32         pass
33
34     ctypedef struct PurpleConnectionErrorInfo:
35         pass
36
37 cdef extern from "libpurple/log.h":
38     ctypedef struct PurpleLog:
39         pass
40
41 cdef extern from "libpurple/proxy.h":
42     ctypedef struct PurpleProxyInfo:
43         pass
44
45 cdef extern from "libpurple/status.h":
46     ctypedef struct PurpleStatus:
47         pass
48
49     ctypedef struct PurpleStatusType:
50         pass
51
52     ctypedef struct PurpleStatusPrimitive:
53         pass
54
55     ctypedef struct PurplePresence:
56         pass
57
58 cdef extern from "libpurple/account.h":
59     ctypedef struct PurpleAccountUiOps
60     ctypedef struct PurpleAccount
61
62     ctypedef glib.gboolean (*PurpleFilterAccountFunc) (PurpleAccount *account)
63     ctypedef void (*PurpleAccountRequestAuthorizationCb) (void *)
64     ctypedef void (*PurpleAccountRegistrationCb) (PurpleAccount *account, \
65             glib.gboolean succeeded, void *user_data)
66     ctypedef void (*PurpleAccountUnregistrationCb) (PurpleAccount *account, \
67             glib.gboolean succeeded, void *user_data)
68
69     ctypedef enum PurpleAccountRequestType:
70         PURPLE_ACCOUNT_REQUEST_AUTHORIZATION = 0
71
72     ctypedef struct PurpleAccountUiOps:
73         void (*notify_added) (PurpleAccount *account, char *remote_user, \
74                 char *id, char *alias, char *message)
75         void (*status_changed) (PurpleAccount *account, PurpleStatus *status)
76         void (*request_add) (PurpleAccount *account, char *remote_user, \
77                 char *id, char *alias, char *message)
78         void *(*request_authorize) (PurpleAccount *account, \
79                 char *remote_user, char *id, char *alias, \
80                 char *message, glib.gboolean on_list, \
81                 PurpleAccountRequestAuthorizationCb authorize_cb, \
82                 PurpleAccountRequestAuthorizationCb deny_cb, void *user_data)
83         void (*close_account_request) (void *ui_handle)
84
85     ctypedef struct PurpleAccount:
86         char *username
87         char *alias
88         char *password
89         char *user_info
90         char *buddy_icon_path
91         glib.gboolean remember_pass
92         char *protocol_id
93         PurpleConnection *gc
94         glib.gboolean disconnecting
95         glib.GHashTable *settings
96         glib.GHashTable *ui_settings
97         PurpleProxyInfo *proxy_info
98         glib.GSList *permit
99         glib.GSList *deny
100         int perm_deny
101         PurplePresence *presence
102         PurpleLog *system_log
103         void *ui_data
104         PurpleAccountRegistrationCb registration_cb
105         void *registration_cb_user_data
106         glib.gpointer priv
107
108     # Account API
109     PurpleAccount *purple_account_new(char *username, char *protocol_id)
110     void purple_account_destroy(PurpleAccount *account)
111     void purple_account_connect(PurpleAccount *account)
112     void purple_account_set_register_callback(PurpleAccount *account, PurpleAccountRegistrationCb cb, void *user_data)
113     void purple_account_register(PurpleAccount *account)
114     void purple_account_unregister(PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data)
115     void purple_account_disconnect(PurpleAccount *account)
116     void purple_account_notify_added(PurpleAccount *account, \
117             char *remote_user, char *id, char *alias, \
118             char *message)
119     void purple_account_request_add(PurpleAccount *account, \
120             char *remote_user, char *id, char *alias, \
121             char *message)
122     void *purple_account_request_authorization(PurpleAccount *account, \
123             char *remote_user, char *id, char *alias, \
124             char *message, glib.gboolean on_list, \
125             PurpleAccountRequestAuthorizationCb auth_cb, \
126             PurpleAccountRequestAuthorizationCb deny_cb, void *user_data)
127     void purple_account_request_close_with_account(PurpleAccount *account)
128     void purple_account_request_close(void *ui_handle)
129     void purple_account_request_password(PurpleAccount *account, \
130             glib.GCallback ok_cb, glib.GCallback cancel_cb, void *user_data)
131     void purple_account_request_change_password(PurpleAccount *account)
132     void purple_account_request_change_user_info(PurpleAccount *account)
133     void purple_account_set_username(PurpleAccount *account, char *username)
134     void purple_account_set_password(PurpleAccount *account, char *password)
135     void purple_account_set_alias(PurpleAccount *account, char *alias)
136     void purple_account_set_user_info(PurpleAccount *account, char *user_info)
137     void purple_account_set_buddy_icon_path(PurpleAccount *account, char *path)
138     void purple_account_set_protocol_id(PurpleAccount *account, \
139             char *protocol_id)
140     void purple_account_set_connection(PurpleAccount *account, \
141             PurpleConnection *gc)
142     void purple_account_set_remember_password(PurpleAccount *account, \
143             glib.gboolean value)
144     void purple_account_set_check_mail(PurpleAccount *account, \
145             glib.gboolean value)
146     void purple_account_set_enabled(PurpleAccount *account, \
147             char *ui, glib.gboolean value)
148     void purple_account_set_proxy_info(PurpleAccount *account, \
149             PurpleProxyInfo *info)
150     void purple_account_set_status_types(PurpleAccount *account, \
151             glib.GList *status_types)
152     void purple_account_set_status_list(PurpleAccount *account, \
153             char *status_id, glib.gboolean active, glib.GList *attrs)
154     void purple_account_set_status(PurpleAccount *account, \
155             char *status_id, glib.gboolean active, NULL) # FIXME
156     void purple_account_set_status_list(PurpleAccount *account, \
157             char *status_id, glib.gboolean active, glib.GList *attrs)
158     void purple_account_clear_settings(PurpleAccount *account)
159     void purple_account_set_int(PurpleAccount *account, char *name, \
160             int value)
161     void purple_account_set_string(PurpleAccount *account, char *name, \
162             char *value)
163     void purple_account_set_bool(PurpleAccount *account, char *name, \
164             glib.gboolean value)
165     void purple_account_set_ui_int(PurpleAccount *account, char *ui, \
166             char *name, int value)
167     void purple_account_set_ui_string(PurpleAccount *account, char *ui, \
168             char *name, char *value)
169     void purple_account_set_ui_bool(PurpleAccount *account, char *ui, \
170             char *name, glib.gboolean value)
171     glib.gboolean purple_account_is_connected(PurpleAccount *account)
172     glib.gboolean purple_account_is_connecting(PurpleAccount *account)
173     glib.gboolean purple_account_is_disconnected(PurpleAccount *account)
174     char *purple_account_get_username(PurpleAccount *account)
175     char *purple_account_get_password(PurpleAccount *account)
176     char *purple_account_get_alias(PurpleAccount *account)
177     char *purple_account_get_user_info(PurpleAccount *account)
178     char *purple_account_get_buddy_icon_path(PurpleAccount *account)
179     char *purple_account_get_protocol_id(PurpleAccount *account)
180     char *purple_account_get_protocol_name(PurpleAccount *account)
181     PurpleConnection *purple_account_get_connection(PurpleAccount *account)
182     glib.gboolean purple_account_get_remember_password(PurpleAccount *account)
183     glib.gboolean purple_account_get_check_mail(PurpleAccount *account)
184     glib.gboolean purple_account_get_enabled(PurpleAccount *account, char *ui)
185     PurpleProxyInfo *purple_account_get_proxy_info(PurpleAccount *account)
186     PurpleStatus *purple_account_get_active_status(PurpleAccount *account)
187     PurpleStatus *purple_account_get_status(PurpleAccount *account, \
188             char *status_id)
189     PurpleStatusType *purple_account_get_status_type(PurpleAccount *account, \
190             char *id)
191     PurpleStatusType *purple_account_get_status_type_with_primitive( \
192             PurpleAccount *account, PurpleStatusPrimitive primitive)
193     PurplePresence *purple_account_get_presence(PurpleAccount *account)
194     glib.gboolean purple_account_is_status_active(PurpleAccount *account, \
195             char *status_id)
196     glib.GList *purple_account_get_status_types(PurpleAccount *account)
197     int purple_account_get_int(PurpleAccount *account, char *name, \
198             int default_value)
199     char *purple_account_get_string(PurpleAccount *account, \
200             char *name, char *default_value)
201     glib.gboolean purple_account_get_bool(PurpleAccount *account, \
202             char *name, glib.gboolean default_value)
203     int purple_account_get_ui_int(PurpleAccount *account, \
204             char *ui, char *name, int default_value)
205     char *purple_account_get_ui_string(PurpleAccount *account, \
206             char *ui, char *name, char *default_value)
207     glib.gboolean purple_account_get_ui_bool(PurpleAccount *account, \
208             char *ui, char *name, glib.gboolean default_value)
209     PurpleLog *purple_account_get_log(PurpleAccount *account, \
210             glib.gboolean create)
211     void purple_account_destroy_log(PurpleAccount *account)
212     void purple_account_add_buddy(PurpleAccount *account, PurpleBuddy *buddy)
213     void purple_account_add_buddies(PurpleAccount *account, \
214             glib.GList *buddies)
215     void purple_account_remove_buddy(PurpleAccount *account, \
216             PurpleBuddy *buddy, PurpleGroup *group)
217     void purple_account_remove_buddies(PurpleAccount *account, \
218             glib.GList *buddies, glib.GList *groups)
219     void purple_account_remove_group(PurpleAccount *account, \
220             PurpleGroup *group)
221     void purple_account_change_password(PurpleAccount *account, \
222             char *orig_pw, char *new_pw)
223     glib.gboolean purple_account_supports_offline_message( \
224             PurpleAccount *account, PurpleBuddy *buddy)
225     PurpleConnectionErrorInfo *purple_account_get_current_error( \
226             PurpleAccount *account)
227     void purple_account_clear_current_error(PurpleAccount *account)
228
229     # Accounts API
230     void purple_accounts_add(PurpleAccount *account)
231     void purple_accounts_remove(PurpleAccount *account)
232     void purple_accounts_delete(PurpleAccount *account)
233     void purple_accounts_reorder(PurpleAccount *account, glib.gint new_index)
234     glib.GList *purple_accounts_get_all()
235     glib.GList *purple_accounts_get_all_active()
236     PurpleAccount *purple_accounts_find(char *name, char *protocol)
237     void purple_accounts_restore_current_statuses()
238
239     # UI Registration Functions
240     void purple_accounts_set_ui_ops(PurpleAccountUiOps *ops)
241     PurpleAccountUiOps *purple_accounts_get_ui_ops()
242
243     # Accounts Subsystem
244     void *purple_accounts_get_handle()
245     void purple_accounts_init()
246     void purple_accounts_uninit()