More fixes to account.pyx and buddy.pyx.
[python-purple] / request_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     ctypedef int size_t
25     ctypedef void* va_list
26
27 request_cbs = {}
28
29 cdef void *request_input (const_char *title, const_char *primary,
30                           const_char *secondary, const_char *default_value,
31                           glib.gboolean multiline, glib.gboolean masked,
32                           glib.gchar *hint, const_char *ok_text,
33                           glib.GCallback ok_cb, const_char *cancel_text,
34                           glib.GCallback cancel_cb,
35                           account.PurpleAccount *account, const_char *who,
36                           conversation.PurpleConversation *conv,
37                           void *user_data):
38     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "request", "request_input\n")
39     try:
40         (<object>request_cbs["request_input"])("request_input")
41     except KeyError:
42         pass
43
44 cdef void *request_choice (const_char *title, const_char *primary,
45                            const_char *secondary, int default_value,
46                            const_char *ok_text, glib.GCallback ok_cb,
47                            const_char *cancel_text,
48                            glib.GCallback cancel_cb,
49                            account.PurpleAccount *account, const_char *who,
50                            conversation.PurpleConversation *conv,
51                            void *user_data, va_list choices):
52     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "request",
53                          "request_choice\n")
54     try:
55         (<object>request_cbs["request_choice"])("request_choice")
56     except KeyError:
57         pass
58
59 cdef void *request_action (const_char *title, const_char *primary,
60                            const_char *secondary, int default_action,
61                            account.PurpleAccount *account, const_char *who,
62                            conversation.PurpleConversation *conv,
63                            void *user_data, size_t action_count,
64                            va_list actions):
65     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "request",
66                          "request_action\n")
67     try:
68         (<object>request_cbs["request_action"])("request_action")
69     except KeyError:
70         pass
71
72 cdef void *request_fields (const_char *title, const_char *primary,
73                            const_char *secondary,
74                            request.PurpleRequestFields *fields,
75                            const_char *ok_text, glib.GCallback ok_cb,
76                            const_char *cancel_text, glib.GCallback cancel_cb,
77                            account.PurpleAccount *account, const_char *who,
78                            conversation.PurpleConversation *conv,
79                            void *user_data):
80     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "request",
81                          "request_fields\n")
82     try:
83         (<object>request_cbs["request_fields"])("request_fields")
84     except KeyError:
85         pass
86
87 cdef void *request_file (const_char *title, const_char *filename,
88                          glib.gboolean savedialog, glib.GCallback ok_cb,
89                          glib.GCallback cancel_cb,
90                          account.PurpleAccount *account, const_char *who,
91                          conversation.PurpleConversation *conv,
92                          void *user_data):
93     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "request", "request_file\n")
94     try:
95         (<object>request_cbs["request_file"])("request_file")
96     except KeyError:
97         pass
98
99 cdef void close_request (request.PurpleRequestType type, void *ui_handle):
100     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "request", "close_request\n")
101     try:
102         (<object>request_cbs["close_request"])("close_request")
103     except KeyError:
104         pass
105
106 cdef void *request_folder (const_char *title, const_char *dirname,
107                            glib.GCallback ok_cb,
108                            glib.GCallback cancel_cb,
109                            account.PurpleAccount *account,
110                            const_char *who,
111                            conversation.PurpleConversation *conv,
112                            void *user_data):
113     debug.c_purple_debug(debug.PURPLE_DEBUG_INFO, "request",
114                          "request_folder\n")
115     try:
116         (<object>request_cbs["request_folder"])("request_folder")
117     except KeyError:
118         pass