00001 #ifndef _MAP_FILECHOOSER_PREVIEW_H_ 00002 #define _MAP_FILECHOOSER_PREVIEW_H_ 00003 00004 #include "../ui/common/MapPreview.h" 00005 #include "gtkutil/filechooser.h" 00006 #include "ireference.h" 00007 00008 namespace map 00009 { 00010 00011 class MapFileChooserPreview: public gtkutil::FileChooser::Preview 00012 { 00013 // The loaded map resource 00014 Resource* _mapResource; 00015 00016 // The name of the map being previewed 00017 std::string _mapName; 00018 00019 GtkWidget* _previewContainer; 00020 00021 // The description widget (text entry) 00022 GtkWidget* _usageInfo; 00023 00024 // The actual MapPreview widget 00025 ui::MapPreview _preview; 00026 00027 public: 00028 MapFileChooserPreview (); 00029 00030 virtual ~MapFileChooserPreview (); 00031 00032 // Retrieve the preview widget for packing into the dialog 00033 GtkWidget* getPreviewWidget (); 00034 00040 void onFileSelectionChanged (const std::string& newFileName, gtkutil::FileChooser& fileChooser); 00041 00042 private: 00043 00044 // Sets the name of the map to preview, returns TRUE on success 00045 bool setMapName (const std::string& name); 00046 }; 00047 00048 } // namespace map 00049 00050 #endif /* _MAP_FILECHOOSER_PREVIEW_H_ */