GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

filechooser.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00023 00024 #ifndef GFC_GTK_FILE_CHOOSER_HH 00025 #define GFC_GTK_FILE_CHOOSER_HH 00026 00027 #ifndef GFC_G_TYPE_HH 00028 #include <gfc/glib/type.hh> 00029 #endif 00030 00031 #ifndef GFC_GTK_FILE_FILTER_HH 00032 #include <gfc/gtk/filefilter.hh> 00033 #endif 00034 00035 #ifndef __GTK_FILE_CHOOSER_H__ 00036 #include <gtk/gtkfilechooser.h> 00037 #endif 00038 00039 #ifndef _CPP_VECTOR 00040 #include <vector> 00041 #endif 00042 00043 namespace GFC { 00044 00045 namespace G { 00046 class Error; 00047 } 00048 00049 namespace Gtk { 00050 00051 class Widget; 00052 00056 00057 enum FileChooserAction 00058 { 00059 FILE_CHOOSER_ACTION_OPEN = GTK_FILE_CHOOSER_ACTION_OPEN, 00061 00062 FILE_CHOOSER_ACTION_SAVE = GTK_FILE_CHOOSER_ACTION_SAVE, 00065 00066 FILE_CHOOSER_ACTION_SELECT_FOLDER = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, 00069 00070 FILE_CHOOSER_ACTION_CREATE_FOLDER = GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER 00073 }; 00074 00077 00078 enum FileChooserError 00079 { 00080 FILE_CHOOSER_ERROR_NONEXISTENT = GTK_FILE_CHOOSER_ERROR_NONEXISTENT, 00082 00083 FILE_CHOOSER_ERROR_BAD_FILENAME = GTK_FILE_CHOOSER_ERROR_BAD_FILENAME 00085 }; 00086 00166 00167 class FileChooser : public virtual G::TypeInterface 00168 { 00169 protected: 00172 00173 FileChooser(); 00175 00176 virtual ~FileChooser() = 0; 00177 00181 00182 typedef G::Signal<void> CurrentFolderChangedSignalType; 00183 typedef G::SignalProxy<TypeInstance, CurrentFolderChangedSignalType> CurrentFolderChangedSignalProxy; 00184 static const CurrentFolderChangedSignalType current_folder_changed_signal; 00189 00190 typedef G::Signal<void> FilerActivatedSignalType; 00191 typedef G::SignalProxy<TypeInstance, FilerActivatedSignalType> FilerActivatedSignalProxy; 00192 static const FilerActivatedSignalType file_activated_signal; 00197 00198 typedef G::Signal<void> SelectionChangedSignalType; 00199 typedef G::SignalProxy<TypeInstance, SelectionChangedSignalType> SelectionChangedSignalProxy; 00200 static const SelectionChangedSignalType selection_changed_signal; 00205 00206 typedef G::Signal<void> UpdatePreviewSignalType; 00207 typedef G::SignalProxy<TypeInstance, UpdatePreviewSignalType> UpdatePreviewSignalProxy; 00208 static const UpdatePreviewSignalType update_preview_signal; 00213 00215 00216 public: 00219 00220 GtkFileChooser* gtk_file_chooser() const; 00222 00223 operator GtkFileChooser* () const; 00225 00226 FileChooserAction get_action() const; 00229 00230 bool get_local_only() const; 00233 00234 bool get_select_multiple() const; 00237 00238 bool get_show_hidden() const; 00241 00242 String get_filename() const; 00251 00252 bool get_filenames(std::vector<String>& filenames) const; 00259 00260 String get_current_folder() const; 00265 00266 String get_uri() const; 00272 00273 bool get_uris(std::vector<String>& uris) const; 00279 00280 String get_current_folder_uri() const; 00283 00284 Widget* get_preview_widget() const; 00287 00288 bool get_preview_widget_active() const; 00292 00293 bool get_use_preview_label() const; 00297 00298 String get_preview_filename() const; 00304 00305 String get_preview_uri() const; 00308 00309 Widget* get_extra_widget() const; 00312 00313 FileFilter* get_filter() const; 00316 00317 bool list_filters(std::vector<String>& filters) const; 00321 00322 bool list_shortcut_folders(std::vector<String>& folders) const; 00326 00327 bool list_shortcut_folder_uris(std::vector<String>& uris) const; 00331 00335 00336 void set_action(FileChooserAction action); 00343 00344 void set_local_only(bool local_only); 00352 00353 void set_select_multiple(bool select_multiple); 00359 00360 void set_show_hidden(bool show_hidden); 00363 00364 void set_current_name(const char *name); 00365 void set_current_name(const String& name); 00373 00374 bool set_filename(const char *filename); 00375 bool set_filename(const String& filename); 00386 00387 bool select_filename(const char *filename); 00388 bool select_filename(const String& filename); 00395 00396 void unselect_filename(const char *filename); 00397 void unselect_filename(const String& filename); 00403 00404 void select_all(); 00406 00407 void unselect_all(); 00409 00410 bool set_current_folder(const char *filename); 00411 bool set_current_folder(const String& filename); 00418 00419 bool set_uri(const char *uri); 00420 bool set_uri(const String& uri); 00431 00432 bool select_uri(const char *uri); 00433 bool select_uri(const String& uri); 00440 00441 void unselect_uri(const char *uri); 00442 void unselect_uri(const String& uri); 00448 00449 bool set_current_folder_uri(const char *uri); 00450 bool set_current_folder_uri(const String& uri); 00457 00458 void set_preview_widget(Widget& preview_widget); 00472 00473 void set_preview_widget_active(bool active); 00480 00481 void set_use_preview_label(bool use_label); 00490 00491 void set_extra_widget(Widget& extra_widget); 00494 00495 void add_filter(const FileFilter& filter); 00500 00501 void remove_filter(const FileFilter& filter); 00504 00505 void set_filter(const FileFilter& filter); 00513 00514 bool add_shortcut_folder(const char *folder, G::Error *error = 0); 00515 bool add_shortcut_folder(const String& folder, G::Error *error = 0); 00526 00527 bool remove_shortcut_folder(const char *folder, G::Error *error = 0); 00528 bool remove_shortcut_folder(const String& folder, G::Error *error = 0); 00535 00536 bool add_shortcut_folder_uri(const char *uri, G::Error *error = 0); 00537 bool add_shortcut_folder_uri(const String& uri, G::Error *error = 0); 00548 00549 bool remove_shortcut_folder_uri(const char *uri, G::Error *error = 0); 00550 bool remove_shortcut_folder_uri(const String& uri, G::Error *error = 0); 00557 00561 00562 const CurrentFolderChangedSignalProxy sig_current_folder_changed(); 00574 00575 const FilerActivatedSignalProxy sig_file_activated(); 00584 00585 const SelectionChangedSignalProxy sig_selection_changed(); 00597 00598 const UpdatePreviewSignalProxy sig_update_preview(); 00613 00615 }; 00616 00617 } // namespace Gtk 00618 00619 } // namespace GFC 00620 00621 #include <gfc/gtk/inline/filechooser.inl> 00622 00623 #endif // GFC_GTK_FILE_CHOOSER_HH 00624

Generated on Tue Aug 24 00:34:31 2004 for GFC-UI by doxygen 1.3.8