X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkfilechooser.h;h=6ff9f08b8b42c87f9e2b4c4831f171772c4124fe;hb=cade42d5094ceaa7799aa8e2135959573646a4b6;hp=0e08c7da6748735be01aaa40ead7e46b717f7560;hpb=57223c9a056bfff1635ddd1e67f660cd5a61e9ff;p=~andy%2Fgtk diff --git a/gtk/gtkfilechooser.h b/gtk/gtkfilechooser.h index 0e08c7da6..6ff9f08b8 100644 --- a/gtk/gtkfilechooser.h +++ b/gtk/gtkfilechooser.h @@ -13,18 +13,16 @@ * 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 . */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) -#error "Only 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 can be included directly." +#endif + #include #include @@ -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,13 +86,29 @@ 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, - GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS + GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS, + GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME } GtkFileChooserError; GQuark gtk_file_chooser_error_quark (void); @@ -84,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, @@ -91,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); @@ -135,6 +172,22 @@ gboolean gtk_file_chooser_set_current_folder_uri (GtkFileChooser *chooser, const gchar *uri); gchar * gtk_file_chooser_get_current_folder_uri (GtkFileChooser *chooser); +/* GFile manipulation */ +GFile * gtk_file_chooser_get_file (GtkFileChooser *chooser); +gboolean gtk_file_chooser_set_file (GtkFileChooser *chooser, + GFile *file, + GError **error); +gboolean gtk_file_chooser_select_file (GtkFileChooser *chooser, + GFile *file, + GError **error); +void gtk_file_chooser_unselect_file (GtkFileChooser *chooser, + GFile *file); +GSList * gtk_file_chooser_get_files (GtkFileChooser *chooser); +gboolean gtk_file_chooser_set_current_folder_file (GtkFileChooser *chooser, + GFile *file, + GError **error); +GFile * gtk_file_chooser_get_current_folder_file (GtkFileChooser *chooser); + /* Preview widget */ void gtk_file_chooser_set_preview_widget (GtkFileChooser *chooser, @@ -147,8 +200,9 @@ void gtk_file_chooser_set_use_preview_label (GtkFileChooser *chooser, gboolean use_label); gboolean gtk_file_chooser_get_use_preview_label (GtkFileChooser *chooser); -char *gtk_file_chooser_get_preview_filename (GtkFileChooser *chooser); -char *gtk_file_chooser_get_preview_uri (GtkFileChooser *chooser); +char *gtk_file_chooser_get_preview_filename (GtkFileChooser *chooser); +char *gtk_file_chooser_get_preview_uri (GtkFileChooser *chooser); +GFile *gtk_file_chooser_get_preview_file (GtkFileChooser *chooser); /* Extra widget */