comparison src/request.h @ 9502:578986136bac

[gaim-migrate @ 10329] Make gaim_request_file support saving files as well as opening files. Changed silc appropriately, and made the Save dialog in the debug window use this. I changed request.c so that, when closing a request window, it also tries to change any requests or notifies that were created using the ui_handle as the handle. It's similar to using "gc" as the first parameter of a gaim_request_bleh or gaim_notify_bleh function. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 10 Jul 2004 18:38:20 +0000
parents b540c735a6ad
children b13013595c08
comparison
equal deleted inserted replaced
9501:d95e134da0ac 9502:578986136bac
34 /** 34 /**
35 * Request types. 35 * Request types.
36 */ 36 */
37 typedef enum 37 typedef enum
38 { 38 {
39 GAIM_REQUEST_INPUT = 0, /**< Text input request. */ 39 GAIM_REQUEST_INPUT = 0, /**< Text input request. */
40 GAIM_REQUEST_CHOICE, /**< Multiple-choice request. */ 40 GAIM_REQUEST_CHOICE, /**< Multiple-choice request. */
41 GAIM_REQUEST_ACTION, /**< Action request. */ 41 GAIM_REQUEST_ACTION, /**< Action request. */
42 GAIM_REQUEST_FIELDS /**< Multiple fields request. */ 42 GAIM_REQUEST_FIELDS, /**< Multiple fields request. */
43 GAIM_REQUEST_FILE /**< File open or save request. */
43 44
44 } GaimRequestType; 45 } GaimRequestType;
45 46
46 /** 47 /**
47 * A type of field. 48 * A type of field.
188 void *(*request_fields)(const char *title, const char *primary, 189 void *(*request_fields)(const char *title, const char *primary,
189 const char *secondary, GaimRequestFields *fields, 190 const char *secondary, GaimRequestFields *fields,
190 const char *ok_text, GCallback ok_cb, 191 const char *ok_text, GCallback ok_cb,
191 const char *cancel_text, GCallback cancel_cb, 192 const char *cancel_text, GCallback cancel_cb,
192 void *user_data); 193 void *user_data);
193
194 void *(*request_file)(const char *title, const char *filename, 194 void *(*request_file)(const char *title, const char *filename,
195 GCallback ok_cb, GCallback cancel_cb, 195 gboolean savedialog, GCallback ok_cb,
196 void *user_data); 196 GCallback cancel_cb, void *user_data);
197 void (*close_request)(GaimRequestType type, void *ui_handle); 197 void (*close_request)(GaimRequestType type, void *ui_handle);
198 } GaimRequestUiOps; 198 } GaimRequestUiOps;
199 199
200 typedef void (*GaimRequestInputCb)(void *, const char *); 200 typedef void (*GaimRequestInputCb)(void *, const char *);
201 typedef void (*GaimRequestActionCb)(void *, int); 201 typedef void (*GaimRequestActionCb)(void *, int);
202 typedef void (*GaimRequestFieldsCb)(void *, GaimRequestFields *fields); 202 typedef void (*GaimRequestFieldsCb)(void *, GaimRequestFields *fields);
203 typedef void (*GaimRequestFileCb)(void *, const char *filename);
203 204
204 #ifdef __cplusplus 205 #ifdef __cplusplus
205 extern "C" { 206 extern "C" {
206 #endif 207 #endif
207 208
1249 cancel_cb) \ 1250 cancel_cb) \
1250 gaim_request_action((handle), (title), (primary), (secondary), \ 1251 gaim_request_action((handle), (title), (primary), (secondary), \
1251 (default_action), (user_data), 2, \ 1252 (default_action), (user_data), 2, \
1252 _("Accept"), (accept_cb), _("Cancel"), (cancel_cb)) 1253 _("Accept"), (accept_cb), _("Cancel"), (cancel_cb))
1253 1254
1254 /*@}*/ 1255 /**
1255 1256 * Displays a file selector request dialog. Returns the selected filename into
1256 /** 1257 * the callback. Can be used for either opening a file or saving a file.
1257 * Displays file selector request dialog. Returns the selected filename into
1258 * the callback.
1259 * 1258 *
1260 * @param handle The plugin or connection handle. 1259 * @param handle The plugin or connection handle.
1261 * @param title The title for the dialog (may be NULL) 1260 * @param title The title for the dialog (may be NULL)
1262 * @param filename The default filename (may be NULL) 1261 * @param filename The default filename (may be NULL)
1262 * @param savedialog True if this dialog is being used to save a file.
1263 * False if it is being used to open a file.
1263 * @param ok_cb The callback for the OK button. 1264 * @param ok_cb The callback for the OK button.
1264 * @param cancel_cb The callback for the cancel button. 1265 * @param cancel_cb The callback for the cancel button.
1265 * @param user_data The data to pass to the callback. 1266 * @param user_data The data to pass to the callback.
1266 * 1267 *
1267 * @return A UI-specific handle. 1268 * @return A UI-specific handle.
1268 */ 1269 */
1269 void *gaim_request_file(void *handle, const char *title, const char *filename, 1270 void *gaim_request_file(void *handle, const char *title, const char *filename,
1270 GCallback ok_cb, GCallback cancel_cb, 1271 gboolean savedialog,
1271 void *user_data); 1272 GCallback ok_cb, GCallback cancel_cb,
1272 1273 void *user_data);
1274
1275 /*@}*/
1273 1276
1274 /**************************************************************************/ 1277 /**************************************************************************/
1275 /** @name UI Operations API */ 1278 /** @name UI Operations API */
1276 /**************************************************************************/ 1279 /**************************************************************************/
1277 /*@{*/ 1280 /*@{*/