Adding enum PurplePrefType
[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     void c_purple_account_set_password "purple_account_set_password" \
98             (PurpleAccount *account, char *password)
99     char *c_purple_account_get_password "purple_account_get_password" \
100             (PurpleAccount *account)
101     void c_purple_account_set_enabled "purple_account_set_enabled" \
102             (PurpleAccount *account, char *ui, glib.gboolean value)
103     char *c_purple_account_get_username "purple_account_get_username" \
104             (PurpleAccount *account)
105     glib.GList *c_purple_accounts_get_all_active \
106             "purple_accounts_get_all_active" ()
107     void c_purple_accounts_set_ui_ops "purple_accounts_set_ui_ops" \
108             (PurpleAccountUiOps *ops)
109     glib.gboolean c_purple_account_is_connected "purple_account_is_connected" \
110             (PurpleAccount *account)
111     PurpleProxyInfo *c_purple_account_get_proxy_info \
112             "purple_account_get_proxy_info" (PurpleAccount *account)
113     void c_purple_account_set_proxy_info "purple_account_set_proxy_info" \
114             (PurpleAccount *account, PurpleProxyInfo *info)