Fixing set account's options to invalid values
[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 struct PurpleRequestUiOps:
65         void *(*request_input) (const_char *title, const_char *primary,
66                                 const_char *secondary,
67                                 const_char *default_value,
68                                 glib.gboolean multiline, glib.gboolean masked,
69                                 glib.gchar *hint, const_char *ok_text,
70                                 glib.GCallback ok_cb, const_char *cancel_text,
71                                 glib.GCallback cancel_cb,
72                                 account.PurpleAccount *account,
73                                 const_char *who,
74                                 conversation.PurpleConversation *conv,
75                                 void *user_data)
76         void *(*request_choice) (const_char *title, const_char *primary,
77                                  const_char *secondary, int default_value,
78                                  const_char *ok_text, glib.GCallback ok_cb,
79                                  const_char *cancel_text,
80                                  glib.GCallback cancel_cb,
81                                  account.PurpleAccount *account,
82                                  const_char *who,
83                                  conversation.PurpleConversation *conv,
84                                  void *user_data, va_list choices)
85         void *(*request_action) (const_char *title, const_char *primary,
86                                  const_char *secondary, int default_action,
87                                  account.PurpleAccount *account,
88                                  const_char *who,
89                                  conversation.PurpleConversation *conv,
90                                  void *user_data, size_t action_count,
91                                  va_list actions)
92         void *(*request_fields) (const_char *title, const_char *primary,
93                                  const_char *secondary,
94                                  PurpleRequestFields *fields,
95                                  const_char *ok_text, glib.GCallback ok_cb,
96                                  const_char *cancel_text,
97                                  glib.GCallback cancel_cb,
98                                  account.PurpleAccount *account,
99                                  const_char *who,
100                                  conversation.PurpleConversation *conv,
101                                  void *user_data)
102         void *(*request_file) (const_char *title, const_char *filename,
103                                glib.gboolean savedialog, glib.GCallback ok_cb,
104                                glib.GCallback cancel_cb,
105                                account.PurpleAccount *account,
106                                const_char *who,
107                                conversation.PurpleConversation *conv,
108                                void *user_data)
109         void (*close_request) (PurpleRequestType type, void *ui_handle)
110         void *(*request_folder) (const_char *title, const_char *dirname,
111                                  glib.GCallback ok_cb,
112                                  glib.GCallback cancel_cb,
113                                  account.PurpleAccount *account,
114                                  const_char *who,
115                                  conversation.PurpleConversation *conv,
116                                  void *user_data)
117
118     void c_purple_request_set_ui_ops "purple_request_set_ui_ops" (PurpleRequestUiOps *ops)