2 # Copyright (c) 2008 INdT - Instituto Nokia de Tecnologia
4 # This file is part of python-purple.
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.
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.
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/>.
26 ctypedef char const_char "const char"
28 ctypedef void* va_list
30 cdef extern from "libpurple/request.h":
31 ctypedef enum PurpleRequestType:
32 PURPLE_REQUEST_INPUT = 0
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
50 ctypedef struct PurpleRequestFields:
52 glib.GHashTable *fields
53 glib.GList required_fields
56 ctypedef struct PurpleRequestFieldGroup:
57 PurpleRequestFields *fields_list
61 ctypedef struct PurpleRequestField:
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,
74 conversation.PurpleConversation *conv,
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,
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,
89 conversation.PurpleConversation *conv,
90 void *user_data, size_t action_count,
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,
100 conversation.PurpleConversation *conv,
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,
107 conversation.PurpleConversation *conv,
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,
115 conversation.PurpleConversation *conv,
118 void purple_request_close(PurpleRequestType type, void *uihandle)
119 void purple_request_set_ui_ops(PurpleRequestUiOps *ops)