Added delete accounts function
[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 cdef extern from *:
23     ctypedef char const_char "const char"
24
25 # hack to avoid recursive loops by cython
26 cdef extern from "libpurple/connection.h":
27     ctypedef struct PurpleConnection:
28         pass
29
30 cdef extern from "libpurple/log.h":
31     ctypedef struct PurpleLog:
32         pass
33
34 cdef extern from "libpurple/proxy.h":
35     ctypedef struct PurpleProxyInfo:
36         pass
37
38 cdef extern from "libpurple/status.h":
39     ctypedef struct PurpleStatus:
40         pass
41
42     ctypedef struct PurplePresence:
43         pass
44
45 cdef extern from "libpurple/account.h":
46     ctypedef struct PurpleAccountUiOps
47     ctypedef struct PurpleAccount
48
49     ctypedef glib.gboolean (*PurpleFilterAccountFunc) (PurpleAccount *account)
50     ctypedef void (*PurpleAccountRequestAuthorizationCb) (void *)
51     ctypedef void (*PurpleAccountRegistrationCb) (PurpleAccount *account, \
52             glib.gboolean succeeded, void *user_data)
53     ctypedef void (*PurpleAccountUnregistrationCb) (PurpleAccount *account, \
54             glib.gboolean succeeded, void *user_data)
55
56     ctypedef enum PurpleAccountRequestType:
57         PURPLE_ACCOUNT_REQUEST_AUTHORIZATION = 0
58
59     ctypedef struct PurpleAccountUiOps:
60         void (*notify_added) (PurpleAccount *account, const_char *remote_user, \
61                 const_char *id, const_char *alias, const_char *message)
62         void (*status_changed) (PurpleAccount *account, PurpleStatus *status)
63         void (*request_add) (PurpleAccount *account, const_char *remote_user, \
64                 const_char *id, const_char *alias, const_char *message)
65         void *(*request_authorize) (PurpleAccount *account, \
66                 const_char *remote_user, const_char *id, const_char *alias, \
67                 const_char *message, glib.gboolean on_list, \
68                 PurpleAccountRequestAuthorizationCb authorize_cb, \
69                 PurpleAccountRequestAuthorizationCb deny_cb, void *user_data)
70         void (*close_account_request) (void *ui_handle)
71
72     ctypedef struct PurpleAccount:
73         char *username
74         char *alias
75         char *password
76         char *user_info
77         char *buddy_icon_path
78         glib.gboolean remember_pass
79         char *protocol_id
80         PurpleConnection *gc
81         glib.gboolean disconnecting
82         glib.GHashTable *settings
83         glib.GHashTable *ui_settings
84         PurpleProxyInfo *proxy_info
85         glib.GSList *permit
86         glib.GSList *deny
87         int perm_deny
88         PurplePresence *presence
89         PurpleLog *system_log
90         void *ui_data
91         PurpleAccountRegistrationCb registration_cb
92         void *registration_cb_user_data
93         glib.gpointer priv
94
95     PurpleAccount *c_purple_account_new "purple_account_new" \
96             (char *username, char *protocol_id)
97
98     glib.gboolean c_purple_account_get_enabled "purple_account_get_enabled" \
99             (PurpleAccount *account, char *ui)
100     char *c_purple_account_get_username "purple_account_get_username" \
101             (PurpleAccount *account)
102     char *c_purple_account_get_password "purple_account_get_password" \
103             (PurpleAccount *account)
104     char *c_purple_account_get_alias "purple_account_get_alias" \
105             (PurpleAccount *account)
106     char *c_purple_account_get_user_info "purple_account_get_user_info" \
107             (PurpleAccount *account)
108     char *c_purple_account_get_protocol_id "purple_account_get_protocol_id" \
109             (PurpleAccount *account)
110     char *c_purple_account_get_protocol_name \
111             "purple_account_get_protocol_name" (PurpleAccount *account)
112     glib.gboolean c_purple_account_get_remember_password \
113             "purple_account_get_remember_password" (PurpleAccount *account)
114
115     void c_purple_account_set_enabled "purple_account_set_enabled" \
116             (PurpleAccount *account, char *ui, glib.gboolean value)
117     void c_purple_account_set_username "purple_account_set_username" \
118             (PurpleAccount *account, char *username)
119     void c_purple_account_set_password "purple_account_set_password" \
120             (PurpleAccount *account, char *password)
121     void c_purple_account_set_alias "purple_account_set_alias" \
122             (PurpleAccount *account, char *alias)
123     void c_purple_account_set_user_info "purple_account_set_user_info" \
124             (PurpleAccount *account, char *user_info)
125     void c_purple_account_set_protocol_id "purple_account_set_protocol_id" \
126             (PurpleAccount *account, char *protocol_id)
127     void c_purple_account_set_remember_password \
128             "purple_account_set_remember_password" (PurpleAccount *account, \
129                                                     glib.gboolean value)
130
131     glib.GList *c_purple_accounts_get_all_active \
132             "purple_accounts_get_all_active" ()
133     void c_purple_accounts_set_ui_ops "purple_accounts_set_ui_ops" \
134             (PurpleAccountUiOps *ops)
135     void c_purple_account_connect "purple_account_connect" \
136             (PurpleAccount *account)
137     void c_purple_account_disconnect "purple_account_disconnect" \
138             (PurpleAccount *account)
139     glib.gboolean c_purple_account_is_connected "purple_account_is_connected" \
140             (PurpleAccount *account)
141     PurpleProxyInfo *c_purple_account_get_proxy_info \
142             "purple_account_get_proxy_info" (PurpleAccount *account)
143     void c_purple_account_set_proxy_info "purple_account_set_proxy_info" \
144             (PurpleAccount *account, PurpleProxyInfo *info)
145     char *c_purple_account_get_string "purple_account_get_string" \
146             (PurpleAccount *account, char *name, char *default_value)
147     int c_purple_account_get_int "purple_account_get_int" \
148             (PurpleAccount *account, char *name, int default_value)
149     glib.gboolean c_purple_account_get_bool "purple_account_get_bool" \
150             (PurpleAccount *account, char *name, glib.gboolean default_value)
151     void c_purple_account_clear_settings "purple_account_clear_settings" \
152             (PurpleAccount *account)
153     void c_purple_account_set_int "purple_account_set_int" \
154             (PurpleAccount *account, char *name, int value)
155     void c_purple_account_set_string "purple_account_set_string" \
156             (PurpleAccount *account, char *name, char *value)
157     void c_purple_account_set_bool "purple_account_set_bool" \
158             (PurpleAccount *account, char *name, glib.gboolean value)
159     PurpleAccount *c_purple_accounts_find "purple_accounts_find" \
160             (char *name, char *protocol)
161     glib.GList *c_purple_accounts_get_all "purple_accounts_get_all" ()
162     void c_purple_accounts_add "purple_accounts_add" (PurpleAccount *account)
163     void c_purple_accounts_delete "purple_accounts_delete" (PurpleAccount
164             *account)