comparison src/request.h @ 13267:f3ae450fb947

[gaim-migrate @ 15633] Part of SF Patch #1175520 from dennisne This adds a request API function to select a folder. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 13 Feb 2006 03:40:00 +0000
parents c08fcbcc6a3e
children 3638606a5afa
comparison
equal deleted inserted replaced
13266:d1088b7771d4 13267:f3ae450fb947
40 { 40 {
41 GAIM_REQUEST_INPUT = 0, /**< Text input request. */ 41 GAIM_REQUEST_INPUT = 0, /**< Text input request. */
42 GAIM_REQUEST_CHOICE, /**< Multiple-choice request. */ 42 GAIM_REQUEST_CHOICE, /**< Multiple-choice request. */
43 GAIM_REQUEST_ACTION, /**< Action request. */ 43 GAIM_REQUEST_ACTION, /**< Action request. */
44 GAIM_REQUEST_FIELDS, /**< Multiple fields request. */ 44 GAIM_REQUEST_FIELDS, /**< Multiple fields request. */
45 GAIM_REQUEST_FILE /**< File open or save request. */ 45 GAIM_REQUEST_FILE, /**< File open or save request. */
46 GAIM_REQUEST_FOLDER /**< Folder selection request. */
46 47
47 } GaimRequestType; 48 } GaimRequestType;
48 49
49 /** 50 /**
50 * A type of field. 51 * A type of field.
203 void *user_data); 204 void *user_data);
204 void *(*request_file)(const char *title, const char *filename, 205 void *(*request_file)(const char *title, const char *filename,
205 gboolean savedialog, GCallback ok_cb, 206 gboolean savedialog, GCallback ok_cb,
206 GCallback cancel_cb, void *user_data); 207 GCallback cancel_cb, void *user_data);
207 void (*close_request)(GaimRequestType type, void *ui_handle); 208 void (*close_request)(GaimRequestType type, void *ui_handle);
209 void *(*request_folder)(const char *title, const char *dirname,
210 GCallback ok_cb, GCallback cancel_cb,
211 void *user_data);
208 } GaimRequestUiOps; 212 } GaimRequestUiOps;
209 213
210 typedef void (*GaimRequestInputCb)(void *, const char *); 214 typedef void (*GaimRequestInputCb)(void *, const char *);
211 typedef void (*GaimRequestActionCb)(void *, int); 215 typedef void (*GaimRequestActionCb)(void *, int);
212 typedef void (*GaimRequestChoiceCb)(void *, int); 216 typedef void (*GaimRequestChoiceCb)(void *, int);
1162 * @param multiline TRUE if the inputted text can span multiple lines. 1166 * @param multiline TRUE if the inputted text can span multiple lines.
1163 * @param masked TRUE if the inputted text should be masked in some way. 1167 * @param masked TRUE if the inputted text should be masked in some way.
1164 * @param hint Optionally suggest how the input box should appear. 1168 * @param hint Optionally suggest how the input box should appear.
1165 * Use "html," for example, to allow the user to enter 1169 * Use "html," for example, to allow the user to enter
1166 * HTML. 1170 * HTML.
1167 * @param ok_text The text for the OK button. 1171 * @param ok_text The text for the @c OK button.
1168 * @param ok_cb The callback for the OK button. 1172 * @param ok_cb The callback for the @c OK button.
1169 * @param cancel_text The text for the cancel button. 1173 * @param cancel_text The text for the @c Cancel button.
1170 * @param cancel_cb The callback for the cancel button. 1174 * @param cancel_cb The callback for the @c Cancel button.
1171 * @param user_data The data to pass to the callback. 1175 * @param user_data The data to pass to the callback.
1172 * 1176 *
1173 * @return A UI-specific handle. 1177 * @return A UI-specific handle.
1174 */ 1178 */
1175 void *gaim_request_input(void *handle, const char *title, 1179 void *gaim_request_input(void *handle, const char *title,
1188 * the comments on gaim_request_input. 1192 * the comments on gaim_request_input.
1189 * @param title The title of the message. 1193 * @param title The title of the message.
1190 * @param primary The main point of the message. 1194 * @param primary The main point of the message.
1191 * @param secondary The secondary information. 1195 * @param secondary The secondary information.
1192 * @param default_value The default value. 1196 * @param default_value The default value.
1193 * @param ok_text The text for the OK button. 1197 * @param ok_text The text for the @c OK button.
1194 * @param ok_cb The callback for the OK button. 1198 * @param ok_cb The callback for the @c OK button.
1195 * @param cancel_text The text for the cancel button. 1199 * @param cancel_text The text for the @c Cancel button.
1196 * @param cancel_cb The callback for the cancel button. 1200 * @param cancel_cb The callback for the @c Cancel button.
1197 * @param user_data The data to pass to the callback. 1201 * @param user_data The data to pass to the callback.
1198 * @param ... The choices. This argument list should be 1202 * @param ... The choices. This argument list should be
1199 * terminated with a NULL parameter. 1203 * terminated with a NULL parameter.
1200 * 1204 *
1201 * @return A UI-specific handle. 1205 * @return A UI-specific handle.
1215 * the comments on gaim_request_input. 1219 * the comments on gaim_request_input.
1216 * @param title The title of the message. 1220 * @param title The title of the message.
1217 * @param primary The main point of the message. 1221 * @param primary The main point of the message.
1218 * @param secondary The secondary information. 1222 * @param secondary The secondary information.
1219 * @param default_value The default value. 1223 * @param default_value The default value.
1220 * @param ok_text The text for the OK button. 1224 * @param ok_text The text for the @c OK button.
1221 * @param ok_cb The callback for the OK button. 1225 * @param ok_cb The callback for the @c OK button.
1222 * @param cancel_text The text for the cancel button. 1226 * @param cancel_text The text for the @c Cancel button.
1223 * @param cancel_cb The callback for the cancel button. 1227 * @param cancel_cb The callback for the @c Cancel button.
1224 * @param user_data The data to pass to the callback. 1228 * @param user_data The data to pass to the callback.
1225 * @param choices The choices. This argument list should be 1229 * @param choices The choices. This argument list should be
1226 * terminated with a NULL parameter. 1230 * terminated with a @c NULL parameter.
1227 * 1231 *
1228 * @return A UI-specific handle. 1232 * @return A UI-specific handle.
1229 */ 1233 */
1230 void *gaim_request_choice_varg(void *handle, const char *title, 1234 void *gaim_request_choice_varg(void *handle, const char *title,
1231 const char *primary, const char *secondary, 1235 const char *primary, const char *secondary,
1289 * the comments on gaim_request_input. 1293 * the comments on gaim_request_input.
1290 * @param title The title of the message. 1294 * @param title The title of the message.
1291 * @param primary The main point of the message. 1295 * @param primary The main point of the message.
1292 * @param secondary The secondary information. 1296 * @param secondary The secondary information.
1293 * @param fields The list of fields. 1297 * @param fields The list of fields.
1294 * @param ok_text The text for the OK button. 1298 * @param ok_text The text for the @c OK button.
1295 * @param ok_cb The callback for the OK button. 1299 * @param ok_cb The callback for the @c OK button.
1296 * @param cancel_text The text for the cancel button. 1300 * @param cancel_text The text for the @c Cancel button.
1297 * @param cancel_cb The callback for the cancel button. 1301 * @param cancel_cb The callback for the @c Cancel button.
1298 * @param user_data The data to pass to the callback. 1302 * @param user_data The data to pass to the callback.
1299 * 1303 *
1300 * @return A UI-specific handle. 1304 * @return A UI-specific handle.
1301 */ 1305 */
1302 void *gaim_request_fields(void *handle, const char *title, 1306 void *gaim_request_fields(void *handle, const char *title,
1320 * @param handle The handle. 1324 * @param handle The handle.
1321 */ 1325 */
1322 void gaim_request_close_with_handle(void *handle); 1326 void gaim_request_close_with_handle(void *handle);
1323 1327
1324 /** 1328 /**
1325 * A wrapper for gaim_request_action() that uses Yes and No buttons. 1329 * A wrapper for gaim_request_action() that uses @c Yes and @c No buttons.
1326 */ 1330 */
1327 #define gaim_request_yes_no(handle, title, primary, secondary, \ 1331 #define gaim_request_yes_no(handle, title, primary, secondary, \
1328 default_action, user_data, yes_cb, no_cb) \ 1332 default_action, user_data, yes_cb, no_cb) \
1329 gaim_request_action((handle), (title), (primary), (secondary), \ 1333 gaim_request_action((handle), (title), (primary), (secondary), \
1330 (default_action), (user_data), 2, \ 1334 (default_action), (user_data), 2, \
1331 _("Yes"), (yes_cb), _("No"), (no_cb)) 1335 _("Yes"), (yes_cb), _("No"), (no_cb))
1332 1336
1333 /** 1337 /**
1334 * A wrapper for gaim_request_action() that uses OK and Cancel buttons. 1338 * A wrapper for gaim_request_action() that uses @c OK and @c Cancel buttons.
1335 */ 1339 */
1336 #define gaim_request_ok_cancel(handle, title, primary, secondary, \ 1340 #define gaim_request_ok_cancel(handle, title, primary, secondary, \
1337 default_action, user_data, ok_cb, cancel_cb) \ 1341 default_action, user_data, ok_cb, cancel_cb) \
1338 gaim_request_action((handle), (title), (primary), (secondary), \ 1342 gaim_request_action((handle), (title), (primary), (secondary), \
1339 (default_action), (user_data), 2, \ 1343 (default_action), (user_data), 2, \
1348 gaim_request_action((handle), (title), (primary), (secondary), \ 1352 gaim_request_action((handle), (title), (primary), (secondary), \
1349 (default_action), (user_data), 2, \ 1353 (default_action), (user_data), 2, \
1350 _("_Accept"), (accept_cb), _("Cancel"), (cancel_cb)) 1354 _("_Accept"), (accept_cb), _("Cancel"), (cancel_cb))
1351 1355
1352 /** 1356 /**
1353 * Displays a file selector request dialog. Returns the selected filename into 1357 * Displays a file selector request dialog. Returns the selected filename to
1354 * the callback. Can be used for either opening a file or saving a file. 1358 * the callback. Can be used for either opening a file or saving a file.
1355 * 1359 *
1356 * @param handle The plugin or connection handle. For some 1360 * @param handle The plugin or connection handle. For some
1357 * things this is EXTREMELY important. See 1361 * things this is EXTREMELY important. See
1358 * the comments on gaim_request_input. 1362 * the comments on gaim_request_input.
1359 * @param title The title for the dialog (may be NULL) 1363 * @param title The title for the dialog (may be @c NULL)
1360 * @param filename The default filename (may be NULL) 1364 * @param filename The default filename (may be @c NULL)
1361 * @param savedialog True if this dialog is being used to save a file. 1365 * @param savedialog True if this dialog is being used to save a file.
1362 * False if it is being used to open a file. 1366 * False if it is being used to open a file.
1363 * @param ok_cb The callback for the OK button. 1367 * @param ok_cb The callback for the @c OK button.
1364 * @param cancel_cb The callback for the cancel button. 1368 * @param cancel_cb The callback for the @c Cancel button.
1365 * @param user_data The data to pass to the callback. 1369 * @param user_data The data to pass to the callback.
1366 * 1370 *
1367 * @return A UI-specific handle. 1371 * @return A UI-specific handle.
1368 */ 1372 */
1369 void *gaim_request_file(void *handle, const char *title, const char *filename, 1373 void *gaim_request_file(void *handle, const char *title, const char *filename,
1370 gboolean savedialog, 1374 gboolean savedialog,
1371 GCallback ok_cb, GCallback cancel_cb, 1375 GCallback ok_cb, GCallback cancel_cb,
1372 void *user_data); 1376 void *user_data);
1373 1377
1378 /**
1379 * Displays a folder select dialog. Returns the selected filename to
1380 * the callback.
1381 *
1382 * @param handle The plugin or connection handle. For some
1383 * things this is EXTREMELY important. See
1384 * the comments on gaim_request_input.
1385 * @param title The title for the dialog (may be @c NULL)
1386 * @param dirname The default directory name (may be @c NULL)
1387 * @param ok_cb The callback for the @c OK button.
1388 * @param cancel_cb The callback for the @c Cancel button.
1389 * @param user_data The data to pass to the callback.
1390 *
1391 * @return A UI-specific handle.
1392 */
1393 void *gaim_request_folder(void *handle, const char *title, const char *dirname,
1394 GCallback ok_cb, GCallback cancel_cb,
1395 void *user_data);
1396
1374 /*@}*/ 1397 /*@}*/
1375 1398
1376 /**************************************************************************/ 1399 /**************************************************************************/
1377 /** @name UI Registration Functions */ 1400 /** @name UI Registration Functions */
1378 /**************************************************************************/ 1401 /**************************************************************************/