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/>.
24 ctypedef char const_char "const char"
26 # hack to avoid recursive loops by cython
27 cdef extern from "libpurple/connection.h":
28 ctypedef struct PurpleConnection:
31 cdef extern from "libpurple/log.h":
32 ctypedef struct PurpleLog:
35 cdef extern from "libpurple/proxy.h":
36 ctypedef struct PurpleProxyInfo:
39 cdef extern from "libpurple/status.h":
40 ctypedef struct PurpleStatus:
43 ctypedef struct PurplePresence:
46 cdef extern from "libpurple/accountopt.h":
47 ctypedef struct PurpleAccountOption:
48 prefs.PurplePrefType type
60 prefs.PurplePrefType c_purple_account_option_get_type "purple_account_option_get_type" (PurpleAccountOption *option)
61 char *c_purple_account_option_get_setting "purple_account_option_get_setting" (PurpleAccountOption *option)
62 char *c_purple_account_option_get_default_string "purple_account_option_get_default_string" (PurpleAccountOption *option)
63 int c_purple_account_option_get_default_int "purple_account_option_get_default_int" (PurpleAccountOption *option)
64 glib.gboolean c_purple_account_option_get_default_bool "purple_account_option_get_default_bool" (PurpleAccountOption *option)
65 const_char *c_purple_account_option_get_default_list_value "purple_account_option_get_default_list_value" (PurpleAccountOption *option)
66 const_char *c_purple_account_option_get_text "purple_account_option_get_text" (PurpleAccountOption *option)
68 cdef extern from "libpurple/account.h":
69 ctypedef struct PurpleAccountUiOps
70 ctypedef struct PurpleAccount
72 ctypedef glib.gboolean (*PurpleFilterAccountFunc) (PurpleAccount *account)
73 ctypedef void (*PurpleAccountRequestAuthorizationCb) (void *)
74 ctypedef void (*PurpleAccountRegistrationCb) (PurpleAccount *account,\
75 glib.gboolean succeeded, void *user_data)
76 ctypedef void (*PurpleAccountUnregistrationCb) (PurpleAccount *account,\
77 glib.gboolean succeeded, void *user_data)
79 ctypedef enum PurpleAccountRequestType:
80 PURPLE_ACCOUNT_REQUEST_AUTHORIZATION = 0
82 ctypedef struct PurpleAccountUiOps:
83 void (*notify_added) (PurpleAccount *account, const_char *remote_user,\
84 const_char *id, const_char *alias, const_char *message)
85 void (*status_changed) (PurpleAccount *account, PurpleStatus *status)
86 void (*request_add) (PurpleAccount *account, const_char *remote_user,\
87 const_char *id, const_char *alias, const_char *message)
88 void *(*request_authorize) (PurpleAccount *account,\
89 const_char *remote_user, const_char *id, const_char *alias,\
90 const_char *message, glib.gboolean on_list,\
91 PurpleAccountRequestAuthorizationCb authorize_cb,\
92 PurpleAccountRequestAuthorizationCb deny_cb, void *user_data)
93 void (*close_account_request) (void *ui_handle)
95 ctypedef struct PurpleAccount:
100 char *buddy_icon_path
101 glib.gboolean remember_pass
104 glib.gboolean disconnecting
105 glib.GHashTable *settings
106 glib.GHashTable *ui_settings
107 PurpleProxyInfo *proxy_info
111 PurplePresence *presence
112 PurpleLog *system_log
114 PurpleAccountRegistrationCb registration_cb
115 void *registration_cb_user_data
118 PurpleAccount *c_purple_account_new "purple_account_new"\
119 (char *username, char *protocol_id)
120 void c_purple_account_set_password "purple_account_set_password"\
121 (PurpleAccount *account, char *password)
122 char *c_purple_account_get_password "purple_account_get_password"\
123 (PurpleAccount *account)
124 void c_purple_account_set_enabled "purple_account_set_enabled"\
125 (PurpleAccount *account, char *ui, glib.gboolean value)
126 char *c_purple_account_get_username "purple_account_get_username"\
127 (PurpleAccount *account)
128 glib.GList *c_purple_accounts_get_all_active\
129 "purple_accounts_get_all_active" ()
130 void c_purple_accounts_set_ui_ops "purple_accounts_set_ui_ops"\
131 (PurpleAccountUiOps *ops)
132 glib.gboolean c_purple_account_is_connected "purple_account_is_connected"\
133 (PurpleAccount *account)
134 PurpleProxyInfo *c_purple_account_get_proxy_info\
135 "purple_account_get_proxy_info" (PurpleAccount *account)
136 void c_purple_account_set_proxy_info "purple_account_set_proxy_info"\
137 (PurpleAccount *account, PurpleProxyInfo *info)
138 char *c_purple_account_get_string "purple_account_get_string"\
139 (PurpleAccount *account, char *name, char *default_value)
140 int c_purple_account_get_int "purple_account_get_int"\
141 (PurpleAccount *account, char *name, int default_value)
142 glib.gboolean c_purple_account_get_bool "purple_account_get_bool"\
143 (PurpleAccount *account, char *name, glib.gboolean default_value)
144 void c_purple_account_clear_settings "purple_account_clear_settings"\
145 (PurpleAccount *account)
146 void c_purple_account_set_int "purple_account_set_int"\
147 (PurpleAccount *account, char *name, int value)
148 void c_purple_account_set_string "purple_account_set_string"\
149 (PurpleAccount *account, char *name, char *value)
150 void c_purple_account_set_bool "purple_account_set_bool"\
151 (PurpleAccount *account, char *name, glib.gboolean value)