Added initial support for new_node, update and remove callbacks from PurpleBlistUiOps.
[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,
28                         const_char *remote_user, const_char *id,
29                         const_char *alias, const_char *message):
30     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "account",
31                          "notify_added\n")
32     try:
33         (<object>account_cbs["notify_added"])("notify_added")
34     except KeyError:
35         pass
36
37 cdef void status_changed (account.PurpleAccount *account,
38                           status.PurpleStatus *status):
39     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "account",
40                          "status_changed\n")
41     try:
42         (<object>account_cbs["status_changed"])("status_changed")
43     except KeyError:
44         pass
45
46 cdef void request_add (account.PurpleAccount *account,
47                        const_char *remote_user, const_char *id,
48                        const_char *alias, const_char *message):
49     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "account",
50                          "request_add\n")
51     try:
52         (<object>account_cbs["request_add"])("request_add")
53     except KeyError:
54         pass
55
56 cdef void *request_authorize (account.PurpleAccount *account,
57                               const_char *remote_user, const_char *id,
58                               const_char *alias, const_char *message,
59                               glib.gboolean on_list,
60                               account.PurpleAccountRequestAuthorizationCb authorize_cb,
61                               account.PurpleAccountRequestAuthorizationCb deny_cb,
62                               void *user_data):
63     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "account",
64                          "request_authorize\n")
65     try:
66         (<object>account_cbs["request_authorize"])("request_authorize")
67         return NULL
68     except KeyError:
69         pass
70
71 cdef void close_account_request (void *ui_handle):
72     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "account",
73                          "close_account_request\n")
74     try:
75         (<object>account_cbs["close_account_request"])("close_account_request")
76     except KeyError:
77         pass