Fix compilation error using python2.7
[python-purple] / libpurple / request.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 glib
21
22 cimport account
23 cimport conversation
24
25 cdef extern from *:
26     ctypedef char const_char "const char"
27     ctypedef int size_t
28     ctypedef void* va_list
29
30 cdef extern from "libpurple/request.h":
31     ctypedef enum PurpleRequestType:
32         PURPLE_REQUEST_INPUT = 0
33         PURPLE_REQUEST_CHOICE
34         PURPLE_REQUEST_ACTION
35         PURPLE_REQUEST_FIELDS
36         PURPLE_REQUEST_FILE
37         PURPLE_REQUEST_FOLDER
38
39     ctypedef enum PurpleRequestFieldType:
40         PURPLE_REQUEST_FIELD_NONE
41         PURPLE_REQUEST_FIELD_STRING
42         PURPLE_REQUEST_FIELD_INTEGER
43         PURPLE_REQUEST_FIELD_BOOLEAN
44         PURPLE_REQUEST_FIELD_CHOICE
45         PURPLE_REQUEST_FIELD_LIST
46         PURPLE_REQUEST_FIELD_LABEL
47         PURPLE_REQUEST_FIELD_IMAGE
48         PURPLE_REQUEST_FIELD_ACCOUNT
49
50     ctypedef struct PurpleRequestFields:
51         glib.GList *groups
52         glib.GHashTable *fields
53         glib.GList required_fields
54         void *ui_data
55
56     ctypedef struct PurpleRequestFieldGroup:
57         PurpleRequestFields *fields_list
58         char *title
59         glib.GList *fields
60
61     ctypedef struct PurpleRequestField:
62         pass
63
64     ctypedef void (*PurpleRequestActionCb)(void *, int)
65     ctypedef void (*PurpleRequestChoiceCb)(void *, int)
66     ctypedef void (*PurpleRequestFieldsCb)(void *, PurpleRequestFields *fields)
67     ctypedef void (*PurpleRequestFileCb)(void *, char *filename)
68
69     ctypedef struct PurpleRequestUiOps:
70         void *(*request_input) (const_char *title, const_char *primary,
71                                 const_char *secondary,
72                                 const_char *default_value,
73                                 glib.gboolean multiline, glib.gboolean masked,
74                                 glib.gchar *hint, const_char *ok_text,
75                                 glib.GCallback ok_cb, const_char *cancel_text,
76                                 glib.GCallback cancel_cb,
77                                 account.PurpleAccount *account,
78                                 const_char *who,
79                                 conversation.PurpleConversation *conv,
80                                 void *user_data)
81         void *(*request_choice) (const_char *title, const_char *primary,
82                                  const_char *secondary, int default_value,
83                                  const_char *ok_text, glib.GCallback ok_cb,
84                                  const_char *cancel_text,
85                                  glib.GCallback cancel_cb,
86                                  account.PurpleAccount *account,
87                                  const_char *who,
88                                  conversation.PurpleConversation *conv,
89                                  void *user_data, va_list choices)
90         void *(*request_action) (const_char *title, const_char *primary,
91                                  const_char *secondary, int default_action,
92                                  account.PurpleAccount *account,
93                                  const_char *who,
94                                  conversation.PurpleConversation *conv,
95                                  void *user_data, size_t action_count,
96                                  va_list actions)
97         void *(*request_fields) (const_char *title, const_char *primary,
98                                  const_char *secondary,
99                                  PurpleRequestFields *fields,
100                                  const_char *ok_text, glib.GCallback ok_cb,
101                                  const_char *cancel_text,
102                                  glib.GCallback cancel_cb,
103                                  account.PurpleAccount *account,
104                                  const_char *who,
105                                  conversation.PurpleConversation *conv,
106                                  void *user_data)
107         void *(*request_file) (const_char *title, const_char *filename,
108                                glib.gboolean savedialog, glib.GCallback ok_cb,
109                                glib.GCallback cancel_cb,
110                                account.PurpleAccount *account,
111                                const_char *who,
112                                conversation.PurpleConversation *conv,
113                                void *user_data)
114         void (*close_request) (PurpleRequestType type, void *ui_handle)
115         void *(*request_folder) (const_char *title, const_char *dirname,
116                                  glib.GCallback ok_cb,
117                                  glib.GCallback cancel_cb,
118                                  account.PurpleAccount *account,
119                                  const_char *who,
120                                  conversation.PurpleConversation *conv,
121                                  void *user_data)
122
123     void purple_request_close(PurpleRequestType type, void *uihandle)
124     void purple_request_set_ui_ops(PurpleRequestUiOps *ops)