00001
00002
00003 #ifndef _HILDON_FMMM_FILE_SELECTION_H
00004 #define _HILDON_FMMM_FILE_SELECTION_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <gtkmm/container.h>
00031 #include <gtkmm/filefilter.h>
00032 #include <hildon-fmmm/file-system-model.h>
00033
00034
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _HildonFileSelection HildonFileSelection;
00037 typedef struct _HildonFileSelectionClass HildonFileSelectionClass;
00038 #endif
00039
00040
00041 namespace Hildon
00042 { class FileSelection_Class; }
00043 namespace Hildon
00044 {
00045
00051 enum FileSelectionMode
00052 {
00053 FILE_SELECTION_MODE_LIST,
00054 FILE_SELECTION_MODE_THUMBNAILS
00055 };
00056
00057
00061 enum FileSelectionPane
00062 {
00063 FILE_SELECTION_PANE_NAVIGATION,
00064 FILE_SELECTION_PANE_CONTENT
00065 };
00066
00067
00071 enum FileSelectionSortKey
00072 {
00073 FILE_SELECTION_SORT_NAME,
00074 FILE_SELECTION_SORT_TYPE,
00075 FILE_SELECTION_SORT_MODIFIED,
00076 FILE_SELECTION_SORT_SIZE
00077 };
00078
00079
00085 class FileSelection
00086 : public Gtk::Container
00087 {
00088 public:
00089 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00090 typedef FileSelection CppObjectType;
00091 typedef FileSelection_Class CppClassType;
00092 typedef HildonFileSelection BaseObjectType;
00093 typedef HildonFileSelectionClass BaseClassType;
00094 #endif
00095
00096 virtual ~FileSelection();
00097
00098 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00099
00100 private:
00101 friend class FileSelection_Class;
00102 static CppClassType fileselection_class_;
00103
00104
00105 FileSelection(const FileSelection&);
00106 FileSelection& operator=(const FileSelection&);
00107
00108 protected:
00109 explicit FileSelection(const Glib::ConstructParams& construct_params);
00110 explicit FileSelection(HildonFileSelection* castitem);
00111
00112 #endif
00113
00114 public:
00115 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00116 static GType get_type() G_GNUC_CONST;
00117 static GType get_base_type() G_GNUC_CONST;
00118 #endif
00119
00121 HildonFileSelection* gobj() { return reinterpret_cast<HildonFileSelection*>(gobject_); }
00122
00124 const HildonFileSelection* gobj() const { return reinterpret_cast<HildonFileSelection*>(gobject_); }
00125
00126
00127 public:
00128
00129 #ifdef GLIBMM_VFUNCS_ENABLED
00130 #endif //GLIBMM_VFUNCS_ENABLED
00131
00132 protected:
00133
00134 #ifdef GLIBMM_VFUNCS_ENABLED
00135 #endif //GLIBMM_VFUNCS_ENABLED
00136
00137
00138 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00139 virtual void on_current_folder_changed();
00140 virtual void on_file_activated();
00141 virtual void on_selection_changed();
00142 virtual void on_navigation_pane_context_menu();
00143 virtual void on_content_pane_context_menu();
00144 virtual void on_items_dropped(GtkFilePath* destination, GSList * sources);
00145 virtual void on_location_insensitive(GtkTreeIter* iter);
00146 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00147
00148
00149 private:
00150
00151 public:
00152 explicit FileSelection(const Glib::RefPtr<FileSystemModel>& model);
00153
00154
00160 void set_mode(FileSelectionMode mode);
00161
00167 FileSelectionMode get_mode() const;
00168
00174 void set_sort_key(FileSelectionSortKey key, Gtk::SortType order);
00175
00176
00181 void get_sort_key(FileSelectionSortKey& key, Gtk::SortType& order) const;
00182
00183
00190 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00191 bool set_current_folder(const GtkFilePath* folder);
00192 #else
00193 bool set_current_folder(const GtkFilePath* folder, std::auto_ptr<Glib::Error>& error);
00194 #endif //GLIBMM_EXCEPTIONS_ENABLED
00195
00196
00202 GtkFilePath* get_current_folder() const;
00203
00204 Gtk::TreeModel::iterator get_current_folder_iter() const;
00205
00206
00215 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00216 bool select_path(const GtkFilePath* path);
00217 #else
00218 bool select_path(const GtkFilePath* path, std::auto_ptr<Glib::Error>& error);
00219 #endif //GLIBMM_EXCEPTIONS_ENABLED
00220
00221
00227 void unselect_path(const GtkFilePath* path);
00228
00232 void select_all();
00233
00236 void unselect_all();
00237
00242 void clear_multi_selection();
00243
00244
00245
00253 GSList* get_selected_paths();
00254
00255
00261 void set_select_multiple(bool select_multiple = true);
00262
00266 bool get_select_multiple() const;
00267
00268
00273 void set_filter(const Gtk::FileFilter& filter);
00274
00279 Gtk::FileFilter* get_filter();
00280
00285 const Gtk::FileFilter* get_filter() const;
00286
00287
00292 void dim_current_selection() const;
00293
00297 void undim_all();
00298
00299
00304 FileSelectionPane get_active_pane() const;
00305
00306
00309 void hide_content_pane();
00310
00315 void show_content_pane();
00316
00317
00318
00319
00320 Glib::SignalProxy0< void > signal_current_folder_changed();
00321
00322
00323 Glib::SignalProxy0< void > signal_file_activated();
00324
00325
00326 Glib::SignalProxy0< void > signal_selection_changed();
00327
00328
00329 Glib::SignalProxy0< void > signal_navigation_pane_context_menu();
00330
00331
00332 Glib::SignalProxy0< void > signal_content_pane_context_menu();
00333
00334
00335 Glib::SignalProxy2< void,GtkFilePath*,GSList * > signal_items_dropped();
00336
00337
00338
00339 Glib::SignalProxy1< void,GtkTreeIter* > signal_location_insensitive();
00340
00341
00342 #ifdef GLIBMM_PROPERTIES_ENABLED
00343
00349 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<FileSystemModel> > property_model() const;
00350 #endif //#GLIBMM_PROPERTIES_ENABLED
00351
00352
00353 #ifdef GLIBMM_PROPERTIES_ENABLED
00354
00360 Glib::PropertyProxy_ReadOnly<bool> property_drag_enabled() const;
00361 #endif //#GLIBMM_PROPERTIES_ENABLED
00362
00363
00364 #ifdef GLIBMM_PROPERTIES_ENABLED
00365
00371 Glib::PropertyProxy<Glib::ustring> property_empty_text() ;
00372 #endif //#GLIBMM_PROPERTIES_ENABLED
00373
00374 #ifdef GLIBMM_PROPERTIES_ENABLED
00375
00381 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_empty_text() const;
00382 #endif //#GLIBMM_PROPERTIES_ENABLED
00383
00384 #ifdef GLIBMM_PROPERTIES_ENABLED
00385
00391 Glib::PropertyProxy_ReadOnly<int> property_visible_columns() const;
00392 #endif //#GLIBMM_PROPERTIES_ENABLED
00393
00394
00395 #ifdef GLIBMM_PROPERTIES_ENABLED
00396
00402 Glib::PropertyProxy<GtkFilePath*> property_safe_folder() ;
00403 #endif //#GLIBMM_PROPERTIES_ENABLED
00404
00405 #ifdef GLIBMM_PROPERTIES_ENABLED
00406
00412 Glib::PropertyProxy_ReadOnly<GtkFilePath*> property_safe_folder() const;
00413 #endif //#GLIBMM_PROPERTIES_ENABLED
00414
00415 #ifdef GLIBMM_PROPERTIES_ENABLED
00416
00422 Glib::PropertyProxy<int> property_active_pane() ;
00423 #endif //#GLIBMM_PROPERTIES_ENABLED
00424
00425 #ifdef GLIBMM_PROPERTIES_ENABLED
00426
00432 Glib::PropertyProxy_ReadOnly<int> property_active_pane() const;
00433 #endif //#GLIBMM_PROPERTIES_ENABLED
00434
00435 #ifdef GLIBMM_PROPERTIES_ENABLED
00436
00442 Glib::PropertyProxy<bool> property_show_hidden() ;
00443 #endif //#GLIBMM_PROPERTIES_ENABLED
00444
00445 #ifdef GLIBMM_PROPERTIES_ENABLED
00446
00452 Glib::PropertyProxy_ReadOnly<bool> property_show_hidden() const;
00453 #endif //#GLIBMM_PROPERTIES_ENABLED
00454
00455 #ifdef GLIBMM_PROPERTIES_ENABLED
00456
00462 Glib::PropertyProxy<bool> property_local_only() ;
00463 #endif //#GLIBMM_PROPERTIES_ENABLED
00464
00465 #ifdef GLIBMM_PROPERTIES_ENABLED
00466
00472 Glib::PropertyProxy_ReadOnly<bool> property_local_only() const;
00473 #endif //#GLIBMM_PROPERTIES_ENABLED
00474
00475
00476 };
00477
00478 }
00479
00480
00481 namespace Glib
00482 {
00488 Hildon::FileSelection* wrap(HildonFileSelection* object, bool take_copy = false);
00489 }
00490
00491
00492 #endif
00493