annotate src/request.h @ 5734:5cd96052bc45

[gaim-migrate @ 6158] had these prefs wrong committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Wed, 04 Jun 2003 06:05:17 +0000
parents cce2d7868c78
children 11001789cb22
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file request.h Request API
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 * @ingroup core
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org>
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * (at your option) any later version.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * GNU General Public License for more details.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 #ifndef _GAIM_REQUEST_H_
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 #define _GAIM_REQUEST_H_
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 #include <stdlib.h>
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 #include <glib-object.h>
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 #include <glib.h>
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 * Request types.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 typedef enum
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 {
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35 GAIM_REQUEST_INPUT = 0, /**< Text input request. */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 GAIM_REQUEST_CHOICE, /**< Multiple-choice request. */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 GAIM_REQUEST_ACTION /**< Action request. */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 } GaimRequestType;
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 * Request UI operations.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 typedef struct
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 {
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46 void *(*request_input)(const char *title, const char *primary,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 const char *secondary, const char *default_value,
5482
a41149ee8a29 [gaim-migrate @ 5878]
Christian Hammond <chipx86@chipx86.com>
parents: 5477
diff changeset
48 gboolean multiline,
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49 const char *ok_text, GCallback ok_cb,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50 const char *cancel_text, GCallback cancel_cb,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 void *user_data);
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52 void *(*request_choice)(const char *title, const char *primary,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53 const char *secondary, unsigned int default_value,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54 const char *ok_text, GCallback ok_cb,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55 const char *cancel_text, GCallback cancel_cb,
5496
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
56 void *user_data, size_t choice_count,
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
57 va_list choices);
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58 void *(*request_action)(const char *title, const char *primary,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 const char *secondary, unsigned int default_action,
5496
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
60 void *user_data, size_t action_count,
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
61 va_list actions);
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62
5482
a41149ee8a29 [gaim-migrate @ 5878]
Christian Hammond <chipx86@chipx86.com>
parents: 5477
diff changeset
63 void (*close_request)(GaimRequestType type, void *ui_handle);
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 } GaimRequestUiOps;
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66
5498
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
67 typedef void (*GaimRequestInputCb)(void *, const char *);
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
68 typedef void (*GaimRequestActionCb)(void *, int);
5482
a41149ee8a29 [gaim-migrate @ 5878]
Christian Hammond <chipx86@chipx86.com>
parents: 5477
diff changeset
69
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 /**************************************************************************/
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 /** @name Request API */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 /**************************************************************************/
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 /*@{*/
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 * Prompts the user for text input.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 * @param handle The plugin or connection handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 * @param title The title of the message.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 * @param primary The main point of the message.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 * @param secondary The secondary information.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 * @param default_value The default value.
5482
a41149ee8a29 [gaim-migrate @ 5878]
Christian Hammond <chipx86@chipx86.com>
parents: 5477
diff changeset
83 * @param multiline TRUE if the inputted text can span multiple lines.
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 * @param ok_text The text for the OK button.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 * @param ok_cb The callback for the OK button.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 * @param cancel_text The text for the cancel button.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 * @param cancel_cb The callback for the cancel button.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88 * @param user_data The data to pass to the callback.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 * @return A UI-specific handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 void *gaim_request_input(void *handle, const char *title,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 const char *primary, const char *secondary,
5482
a41149ee8a29 [gaim-migrate @ 5878]
Christian Hammond <chipx86@chipx86.com>
parents: 5477
diff changeset
94 const char *default_value, gboolean multiline,
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 const char *ok_text, GCallback ok_cb,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96 const char *cancel_text, GCallback cancel_cb,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97 void *user_data);
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100 * Prompts the user for multiple-choice input.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
101 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
102 * @param handle The plugin or connection handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
103 * @param title The title of the message.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
104 * @param primary The main point of the message.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
105 * @param secondary The secondary information.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 * @param default_value The default value.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107 * @param ok_text The text for the OK button.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108 * @param ok_cb The callback for the OK button.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109 * @param cancel_text The text for the cancel button.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110 * @param cancel_cb The callback for the cancel button.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111 * @param user_data The data to pass to the callback.
5496
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
112 * @param choice_count The number of choices.
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
113 * @param choice The choices.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
114 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115 * @return A UI-specific handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
116 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
117 void *gaim_request_choice(void *handle, const char *title,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118 const char *primary, const char *secondary,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119 unsigned int default_value,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
120 const char *ok_text, GCallback ok_cb,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121 const char *cancel_text, GCallback cancel_cb,
5496
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
122 void *user_data, size_t choice_count, ...);
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
125 * Prompts the user for multiple-choice input.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
126 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
127 * @param handle The plugin or connection handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
128 * @param title The title of the message.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
129 * @param primary The main point of the message.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130 * @param secondary The secondary information.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
131 * @param default_value The default value.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
132 * @param ok_text The text for the OK button.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
133 * @param ok_cb The callback for the OK button.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
134 * @param cancel_text The text for the cancel button.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135 * @param cancel_cb The callback for the cancel button.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
136 * @param user_data The data to pass to the callback.
5496
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
137 * @param choice_count The number of choices.
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
138 * @param choices The choices.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
139 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
140 * @return A UI-specific handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
141 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
142 void *gaim_request_choice_varg(void *handle, const char *title,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143 const char *primary, const char *secondary,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144 unsigned int default_value,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
145 const char *ok_text, GCallback ok_cb,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
146 const char *cancel_text, GCallback cancel_cb,
5496
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
147 void *user_data, size_t choice_count,
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
148 va_list choices);
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
149
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
150 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
151 * Prompts the user for an action.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
152 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153 * This is often represented as a dialog with a button for each action.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
154 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155 * @param handle The plugin or connection handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156 * @param title The title of the message.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
157 * @param primary The main point of the message.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
158 * @param secondary The secondary information.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
159 * @param default_action The default value.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
160 * @param user_data The data to pass to the callback.
5496
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
161 * @param action_count The number of actions.
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
162 * @param action The first action.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
163 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
164 * @return A UI-specific handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
165 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
166 void *gaim_request_action(void *handle, const char *title,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
167 const char *primary, const char *secondary,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
168 unsigned int default_action,
5496
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
169 void *user_data, size_t action_count, ...);
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
170
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
171 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
172 * Prompts the user for an action.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
173 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
174 * This is often represented as a dialog with a button for each action.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
175 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
176 * @param handle The plugin or connection handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
177 * @param title The title of the message.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
178 * @param primary The main point of the message.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
179 * @param secondary The secondary information.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
180 * @param default_action The default value.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
181 * @param user_data The data to pass to the callback.
5496
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
182 * @param action_count The number of actions.
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
183 * @param actions A list of actions and callbacks.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
184 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
185 * @return A UI-specific handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
186 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
187 void *gaim_request_action_varg(void *handle, const char *title,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
188 const char *primary, const char *secondary,
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
189 unsigned int default_action,
5496
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
190 void *user_data, size_t action_count,
b7c0be69c749 [gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents: 5482
diff changeset
191 va_list actions);
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
192
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
193 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
194 * Closes a request.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
195 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
196 * This should be used only by the UI operation functions and part of the
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
197 * core.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
198 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
199 * @param type The request type.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
200 * @param uihandle The request UI handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
201 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
202 void gaim_request_close(GaimRequestType type, void *uihandle);
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
203
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
204 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
205 * Closes all requests registered with the specified handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
206 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
207 * @param handle The handle.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
208 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
209 void gaim_request_close_with_handle(void *handle);
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
210
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
211 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
212 * A wrapper for gaim_request_action() that uses Yes and No buttons.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
213 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
214 #define gaim_request_yes_no(handle, title, primary, secondary, \
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
215 default_action, user_data, yes_cb, no_cb) \
5498
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
216 gaim_request_action((handle), (title), (primary), (secondary), \
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
217 (default_action), (user_data), 2, \
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
218 _("Yes"), (yes_cb), _("No"), (no_cb))
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
219
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
220 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
221 * A wrapper for gaim_request_action() that uses OK and Cancel buttons.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
222 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
223 #define gaim_request_ok_cancel(handle, title, primary, secondary, \
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
224 default_action, user_data, ok_cb, cancel_cb) \
5498
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
225 gaim_request_action((handle), (title), (primary), (secondary), \
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
226 (default_action), (user_data), 2, \
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
227 _("OK"), (ok_cb), _("Cancel"), (cancel_cb))
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
228
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
229 /**
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
230 * A wrapper for gaim_request_action() that uses Accept and Cancel buttons.
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
231 */
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
232 #define gaim_request_accept_cancel(handle, title, primary, secondary, \
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
233 default_action, user_data, accept_cb, \
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
234 cancel_cb) \
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
235 gaim_request_action((handle), (title), (primary), (secondary), \
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
236 (default_action), (user_data), 2, \
cce2d7868c78 [gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents: 5496
diff changeset
237 _("Accept"), (accept_cb), _("Cancel"), (cancel_cb))
5477
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
238
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
239 /*@}*/
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
240
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
241 /**************************************************************************/
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
242 /** @name UI Operations API */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
243 /**************************************************************************/
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
244 /*@{*/
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
245
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
246 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
247 * Sets the UI operations structure to be used when displaying a
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
248 * request.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
249 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
250 * @param ops The UI operations structure.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
251 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
252 void gaim_set_request_ui_ops(GaimRequestUiOps *ops);
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
253
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
254 /**
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
255 * Returns the UI operations structure to be used when displaying a
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
256 * request.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
257 *
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
258 * @param ops The UI operations structure.
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
259 */
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
260 GaimRequestUiOps *gaim_get_request_ui_ops(void);
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
261
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
262 /*@}*/
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
263
e8e498255369 [gaim-migrate @ 5873]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
264 #endif /* _GAIM_REQUEST_H_ */