Added PurpleConnectionUiOps callbacks.
[python-purple] / account_cbs.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 purple
21
22 cdef extern from *:
23     ctypedef char const_char "const char"
24
25 account_cbs = {}
26
27 cdef void notify_added (account.PurpleAccount *account, const_char *remote_user, const_char *id, const_char *alias, const_char *message):
28     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "account", "notify_added\n")
29     global account_cbs
30     try:
31         (<object>account_cbs["notify_added"])("notify_added")
32     except KeyError:
33         pass
34
35 cdef void status_changed (account.PurpleAccount *account, status.PurpleStatus *status):
36     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "account", "status_changed\n")
37     global account_cbs
38     try:
39         (<object>account_cbs["status_changed"])("status_changed")
40     except KeyError:
41         pass
42
43 cdef void request_add (account.PurpleAccount *account, const_char *remote_user, const_char *id, const_char *alias, const_char *message):
44     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "account", "request_add\n")
45     global account_cbs
46     try:
47         (<object>account_cbs["request_add"])("request_add")
48     except KeyError:
49         pass
50
51 cdef void *request_authorize (account.PurpleAccount *account, const_char *remote_user, const_char *id, const_char *alias, const_char *message, glib.gboolean on_list, account.PurpleAccountRequestAuthorizationCb authorize_cb, account.PurpleAccountRequestAuthorizationCb deny_cb, void *user_data):
52     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "account", "request_authorize\n")
53     global account_cbs
54     try:
55         (<object>account_cbs["request_authorize"])("request_authorize")
56         return NULL
57     except KeyError:
58         pass
59
60 cdef void close_account_request (void *ui_handle):
61     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "account", "close_account_request\n")
62     global account_cbs
63     try:
64         (<object>account_cbs["close_account_request"])("close_account_request")
65     except KeyError:
66         pass