Updated notify_cbs.pxd.
[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, const_char *alias, \
29         const_char *message):
30     """
31     A buddy who is already on this account's buddy list added this account to
32     their buddy list.
33     """
34     debug.c_purple_debug_info("account", "%s", "notify-added\n")
35     if account_cbs.has_key("notify-added"):
36         (<object> account_cbs["notify-added"])("notify-added: TODO")
37
38 cdef void status_changed(account.PurpleAccount *account, \
39         status.PurpleStatus *status):
40     """
41     This account's status changed.
42     """
43     debug.c_purple_debug_info("account", "%s", "status-changed\n")
44     if account_cbs.has_key("status-changed"):
45         (<object> account_cbs["status-changed"])("status-changed: TODO")
46
47 cdef void request_add(account.PurpleAccount *account, \
48         const_char *remote_user, const_char *id, const_char *alias, \
49         const_char *message):
50     """
51     Someone we don't have on our list added us; prompt to add them.
52     """
53     debug.c_purple_debug_info("account", "%s", "request-add\n")
54     if account_cbs.has_key("request-add"):
55         (<object> account_cbs["request-add"])("request-add: TODO")
56
57 cdef void *request_authorize(account.PurpleAccount *account, \
58         const_char *remote_user, const_char *id, const_char *alias, \
59         const_char *message, glib.gboolean on_list, \
60         account.PurpleAccountRequestAuthorizationCb authorize_cb, \
61         account.PurpleAccountRequestAuthorizationCb deny_cb, \
62         void *user_data):
63     """
64     Prompt for authorization when someone adds this account to their buddy
65     list. To authorize them to see this account's presence, call
66     authorize_cb(user_data) otherwise call deny_cb(user_data).
67     @return a UI-specific handle, as passed to #close_account_request.
68     """
69     debug.c_purple_debug_info("account", "%s", "request-authorize\n")
70     if account_cbs.has_key("request-authorize"):
71         (<object> account_cbs["request-authorize"])("request-authorize: TODO")
72
73 cdef void close_account_request (void *ui_handle):
74     """
75     Close a pending request for authorization. ui_handle is a handle as
76     returned by request_authorize.
77     """
78     debug.c_purple_debug_info("account", "%s", "close-account-request\n")
79     if account_cbs.has_key("close-account-request"):
80         (<object> account_cbs["close-account-request"])("close-account-request: TODO")