1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27 #ifndef __GTK_FILESEL_H__
28 #define __GTK_FILESEL_H__
32 #include <gtk/gtkdialog.h>
37 #endif /* __cplusplus */
40 #define GTK_TYPE_FILE_SELECTION (gtk_file_selection_get_type ())
41 #define GTK_FILE_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_SELECTION, GtkFileSelection))
42 #define GTK_FILE_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FILE_SELECTION, GtkFileSelectionClass))
43 #define GTK_IS_FILE_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FILE_SELECTION))
44 #define GTK_IS_FILE_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FILE_SELECTION))
45 #define GTK_FILE_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FILE_SELECTION, GtkFileSelectionClass))
48 typedef struct _GtkFileSelection GtkFileSelection;
49 typedef struct _GtkFileSelectionClass GtkFileSelectionClass;
51 struct _GtkFileSelection
54 GtkDialog parent_instance;
59 GtkWidget *selection_entry;
60 GtkWidget *selection_text;
63 GtkWidget *cancel_button;
64 GtkWidget *help_button;
65 GtkWidget *history_pulldown;
66 GtkWidget *history_menu;
68 GtkWidget *fileop_dialog;
69 GtkWidget *fileop_entry;
73 GtkWidget *fileop_c_dir;
74 GtkWidget *fileop_del_file;
75 GtkWidget *fileop_ren_file;
77 GtkWidget *button_area;
78 GtkWidget *action_area;
81 GPtrArray *selected_names;
85 struct _GtkFileSelectionClass
87 GtkDialogClass parent_class;
89 /* Padding for future expansion */
90 void (*_gtk_reserved1) (void);
91 void (*_gtk_reserved2) (void);
92 void (*_gtk_reserved3) (void);
93 void (*_gtk_reserved4) (void);
97 GType gtk_file_selection_get_type (void) G_GNUC_CONST;
98 GtkWidget* gtk_file_selection_new (const gchar *title);
99 void gtk_file_selection_set_filename (GtkFileSelection *filesel,
100 const gchar *filename);
101 /* This function returns the selected filename in the C runtime's
102 * multibyte string encoding, which may or may not be the same as that
103 * used by GDK (UTF-8). To convert to UTF-8, call g_filename_to_utf8().
104 * The returned string points to a statically allocated buffer and
105 * should be copied away.
107 G_CONST_RETURN gchar* gtk_file_selection_get_filename (GtkFileSelection *filesel);
109 void gtk_file_selection_complete (GtkFileSelection *filesel,
110 const gchar *pattern);
111 void gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel);
112 void gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel);
114 gchar** gtk_file_selection_get_selections (GtkFileSelection *filesel);
116 void gtk_file_selection_set_select_multiple (GtkFileSelection *filesel,
117 gboolean select_multiple);
118 gboolean gtk_file_selection_get_select_multiple (GtkFileSelection *filesel);
122 #endif /* __cplusplus */
125 #endif /* __GTK_FILESEL_H__ */