1 // FileDialog.hxx - abstract inteface for a file open/save dialog
3 #ifndef FG_GUI_FILE_DIALOG_HXX
4 #define FG_GUI_FILE_DIALOG_HXX 1
6 #include <memory> // for std::auto_ptr
8 #include <simgear/misc/strutils.hxx> // for string_list
9 #include <simgear/misc/sg_path.hxx>
11 #include <simgear/nasal/cppbind/NasalCallContext.hxx>
25 std::string getTitle() const
28 void setTitle(const std::string& aTitle);
30 std::string getButton() const
31 { return _buttonText; }
33 void setButton(const std::string& aText);
35 SGPath getDirectory() const
36 { return _initialPath; }
38 void setDirectory(const SGPath& aPath);
40 string_list filterPatterns() const
41 { return _filterPatterns; }
43 void setFilterPatterns(const string_list& patterns);
46 std::string getPlaceholder() const
47 { return _placeholder; }
49 void setPlaceholderName(const std::string& aName);
51 bool showHidden() const
52 { return _showHidden; }
53 void setShowHidden(bool show);
58 virtual ~FGFileDialog ();
60 virtual void exec() = 0;
61 virtual void close() = 0;
66 virtual ~Callback() { }
67 virtual void onFileDialogDone(FGFileDialog* ins, const SGPath& result) = 0;
70 virtual void setCallback(Callback* aCB);
72 void setCallbackFromNasal(const nasal::CallContext& ctx);
74 FGFileDialog(Usage use);
77 std::string _title, _buttonText;
79 string_list _filterPatterns;
80 std::string _placeholder;
82 std::auto_ptr<Callback> _callback;
85 #endif // FG_GUI_FILE_DIALOG_HXX