2 # Copyright (c) 2008 INdT - Instituto Nokia de Tecnologia
4 # This file is part of python-purple.
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.
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.
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/>.
26 ctypedef char const_char "const char"
28 cdef extern from "libpurple/account.h":
29 ctypedef void (*PurpleAccountRequestAuthorizationCb) (void *)
31 ctypedef struct PurpleAccount:
37 glib.gboolean remember_pass
40 ctypedef struct PurpleAccountUiOps:
41 void (*notify_added) (PurpleAccount *account, const_char *remote_user, \
42 const_char *id, const_char *alias, const_char *message)
43 void (*status_changed) (PurpleAccount *account, \
44 status.PurpleStatus *status)
45 void (*request_add) (PurpleAccount *account, const_char *remote_user, \
46 const_char *id, const_char *alias, const_char *message)
47 void *(*request_authorize) (PurpleAccount *account, \
48 const_char *remote_user, const_char *id, const_char *alias, \
49 const_char *message, glib.gboolean on_list, \
50 PurpleAccountRequestAuthorizationCb authorize_cb, \
51 PurpleAccountRequestAuthorizationCb deny_cb, void *user_data)
52 void (*close_account_request) (void *ui_handle)
54 PurpleAccount *c_purple_account_new "purple_account_new" \
55 (char *username, char *protocol_id)
56 void c_purple_account_set_password "purple_account_set_password" \
57 (PurpleAccount *account, char *password)
58 char *c_purple_account_get_password "purple_account_get_password" \
59 (PurpleAccount *account)
60 void c_purple_account_set_enabled "purple_account_set_enabled" \
61 (PurpleAccount *account, char *ui, glib.gboolean value)
62 char *c_purple_account_get_username "purple_account_get_username" \
63 (PurpleAccount *account)
64 glib.GList *c_purple_accounts_get_all_active \
65 "purple_accounts_get_all_active" ()
66 void c_purple_accounts_set_ui_ops "purple_accounts_set_ui_ops" \
67 (PurpleAccountUiOps *ops)
68 glib.gboolean c_purple_account_is_connected "purple_account_is_connected" \
69 (PurpleAccount *account)
70 proxy.PurpleProxyInfo *c_purple_account_get_proxy_info \
71 "purple_account_get_proxy_info" (PurpleAccount *account)
72 void c_purple_account_set_proxy_info "purple_account_set_proxy_info" \
73 (PurpleAccount *account, proxy.PurpleProxyInfo *info)