diff 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
line wrap: on
line diff
--- a/src/request.h	Sat Jul 10 16:45:36 2004 +0000
+++ b/src/request.h	Sat Jul 10 18:38:20 2004 +0000
@@ -36,10 +36,11 @@
  */
 typedef enum
 {
-	GAIM_REQUEST_INPUT = 0,  /**< Text input request.      */
-	GAIM_REQUEST_CHOICE,     /**< Multiple-choice request. */
-	GAIM_REQUEST_ACTION,     /**< Action request.          */
-	GAIM_REQUEST_FIELDS      /**< Multiple fields request. */
+	GAIM_REQUEST_INPUT = 0,  /**< Text input request.        */
+	GAIM_REQUEST_CHOICE,     /**< Multiple-choice request.   */
+	GAIM_REQUEST_ACTION,     /**< Action request.            */
+	GAIM_REQUEST_FIELDS,     /**< Multiple fields request.   */
+	GAIM_REQUEST_FILE        /**< File open or save request. */
 
 } GaimRequestType;
 
@@ -190,16 +191,16 @@
 							const char *ok_text, GCallback ok_cb,
 							const char *cancel_text, GCallback cancel_cb,
 							void *user_data);
-
 	void *(*request_file)(const char *title, const char *filename,
-			      GCallback ok_cb, GCallback cancel_cb,
-			      void *user_data);
+						  gboolean savedialog, GCallback ok_cb,
+						  GCallback cancel_cb, void *user_data);
 	void (*close_request)(GaimRequestType type, void *ui_handle);
 } GaimRequestUiOps;
 
 typedef void (*GaimRequestInputCb)(void *, const char *);
 typedef void (*GaimRequestActionCb)(void *, int);
 typedef void (*GaimRequestFieldsCb)(void *, GaimRequestFields *fields);
+typedef void (*GaimRequestFileCb)(void *, const char *filename);
 
 #ifdef __cplusplus
 extern "C" {
@@ -1251,15 +1252,15 @@
 						(default_action), (user_data), 2, \
 						_("Accept"), (accept_cb), _("Cancel"), (cancel_cb))
 
-/*@}*/
-
 /**
- * Displays file selector request dialog.  Returns the selected filename into
- * the callback.
+ * Displays a file selector request dialog.  Returns the selected filename into
+ * the callback.  Can be used for either opening a file or saving a file.
  *
  * @param handle      The plugin or connection handle.
  * @param title       The title for the dialog (may be NULL)
  * @param filename    The default filename (may be NULL)
+ * @param savedialog  True if this dialog is being used to save a file.
+ *                    False if it is being used to open a file.
  * @param ok_cb       The callback for the OK button.
  * @param cancel_cb   The callback for the cancel button.
  * @param user_data   The data to pass to the callback.
@@ -1267,9 +1268,11 @@
  * @return A UI-specific handle.
  */
 void *gaim_request_file(void *handle, const char *title, const char *filename,
-			GCallback ok_cb, GCallback cancel_cb,
-			void *user_data);
+						gboolean savedialog,
+						GCallback ok_cb, GCallback cancel_cb,
+						void *user_data);
 
+/*@}*/
 
 /**************************************************************************/
 /** @name UI Operations API                                               */