]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkfilechooser.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gtk / gtkfilechooser.h
index b7983a9660c7b21889c0785bda1e617deb3cc5e9..6ff9f08b8b42c87f9e2b4c4831f171772c4124fe 100644 (file)
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only <gtk/gtk.h> can be included directly."
-#endif
-
 #ifndef __GTK_FILE_CHOOSER_H__
 #define __GTK_FILE_CHOOSER_H__
 
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
 #include <gtk/gtkfilefilter.h>
 #include <gtk/gtkwidget.h>
 
@@ -36,6 +34,23 @@ G_BEGIN_DECLS
 
 typedef struct _GtkFileChooser      GtkFileChooser;
 
+/**
+ * GtkFileChooserAction:
+ * @GTK_FILE_CHOOSER_ACTION_OPEN: Indicates open mode.  The file chooser
+ *  will only let the user pick an existing file.
+ * @GTK_FILE_CHOOSER_ACTION_SAVE: Indicates save mode.  The file chooser
+ *  will let the user pick an existing file, or type in a new
+ *  filename.
+ * @GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: Indicates an Open mode for
+ *  selecting folders.  The file chooser will let the user pick an
+ *  existing folder.
+ * @GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER: Indicates a mode for creating a
+ *  new folder.  The file chooser will let the user name an existing or
+ *  new folder.
+ *
+ * Describes whether a #GtkFileChooser is being used to open existing files
+ * or to save to a possibly new file.
+ */
 typedef enum
 {
   GTK_FILE_CHOOSER_ACTION_OPEN,
@@ -44,6 +59,23 @@ typedef enum
   GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
 } GtkFileChooserAction;
 
+/**
+ * GtkFileChooserConfirmation:
+ * @GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM: The file chooser will present
+ *  its stock dialog to confirm about overwriting an existing file.
+ * @GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME: The file chooser will
+ *  terminate and accept the user's choice of a file name.
+ * @GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN: The file chooser will
+ *  continue running, so as to let the user select another file name.
+ *
+ * Used as a return value of handlers for the
+ * #GtkFileChooser::confirm-overwrite signal of a #GtkFileChooser. This
+ * value determines whether the file chooser will present the stock
+ * confirmation dialog, accept the user's choice of a filename, or
+ * let the user choose another filename.
+ *
+ * Since: 2.8
+ */
 typedef enum
 {
   GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM,
@@ -54,9 +86,24 @@ typedef enum
 GType gtk_file_chooser_get_type (void) G_GNUC_CONST;
 
 /* GError enumeration for GtkFileChooser */
-
+/**
+ * GTK_FILE_CHOOSER_ERROR:
+ *
+ * Used to get the #GError quark for #GtkFileChooser errors.
+ */
 #define GTK_FILE_CHOOSER_ERROR (gtk_file_chooser_error_quark ())
 
+/**
+ * GtkFileChooserError:
+ * @GTK_FILE_CHOOSER_ERROR_NONEXISTENT: Indicates that a file does not exist.
+ * @GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: Indicates a malformed filename.
+ * @GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: Indicates a duplicate path (e.g. when
+ *  adding a bookmark).
+ * @GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: Indicates an incomplete hostname (e.g. "http://foo" without a slash after that).
+ *
+ * These identify the various errors that can occur while calling
+ * #GtkFileChooser functions.
+ */
 typedef enum {
   GTK_FILE_CHOOSER_ERROR_NONEXISTENT,
   GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
@@ -85,6 +132,10 @@ void                 gtk_file_chooser_set_do_overwrite_confirmation (GtkFileChoo
                                                                     gboolean        do_overwrite_confirmation);
 gboolean             gtk_file_chooser_get_do_overwrite_confirmation (GtkFileChooser *chooser);
 
+void                 gtk_file_chooser_set_create_folders  (GtkFileChooser       *chooser,
+                                                         gboolean               create_folders);
+gboolean             gtk_file_chooser_get_create_folders (GtkFileChooser *chooser);
+
 /* Suggested name for the Save-type actions
  */
 void     gtk_file_chooser_set_current_name   (GtkFileChooser *chooser,
@@ -92,21 +143,6 @@ void     gtk_file_chooser_set_current_name   (GtkFileChooser *chooser,
 
 /* Filename manipulation
  */
-#ifdef G_OS_WIN32
-/* Reserve old names for DLL ABI backward compatibility */
-#define gtk_file_chooser_get_filename gtk_file_chooser_get_filename_utf8
-#define gtk_file_chooser_set_filename gtk_file_chooser_set_filename_utf8
-#define gtk_file_chooser_select_filename gtk_file_chooser_select_filename_utf8
-#define gtk_file_chooser_unselect_filename gtk_file_chooser_unselect_filename_utf8
-#define gtk_file_chooser_get_filenames gtk_file_chooser_get_filenames_utf8
-#define gtk_file_chooser_set_current_folder gtk_file_chooser_set_current_folder_utf8
-#define gtk_file_chooser_get_current_folder gtk_file_chooser_get_current_folder_utf8
-#define gtk_file_chooser_get_preview_filename gtk_file_chooser_get_preview_filename_utf8
-#define gtk_file_chooser_add_shortcut_folder gtk_file_chooser_add_shortcut_folder_utf8
-#define gtk_file_chooser_remove_shortcut_folder gtk_file_chooser_remove_shortcut_folder_utf8
-#define gtk_file_chooser_list_shortcut_folders gtk_file_chooser_list_shortcut_folders_utf8
-#endif
-
 gchar *  gtk_file_chooser_get_filename       (GtkFileChooser *chooser);
 gboolean gtk_file_chooser_set_filename       (GtkFileChooser *chooser,
                                              const char     *filename);