4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
10 * Full author contact details are available in file CREDITS.
17 #include "support/docstring.h"
24 namespace support { class FileFilterList; }
29 * \brief GUI-I definition of file dialog interface
34 /// label, directory path button
35 typedef std::pair<docstring, docstring> Button;
39 Later, /**< modeless chooser, no result */
40 Chosen /**< string contains filename */
44 typedef std::pair<FileDialog::ResultType, docstring> Result;
47 * Constructs a file dialog with title \param title.
48 * If \param a is \const LFUN_SELECT_FILE_SYNC then a value
49 * will be returned immediately upon performing a open(),
50 * otherwise a callback Dispatch() will be invoked with the filename as
51 * argument, of action \param a.
53 * Up to two optional extra buttons are allowed for specifying
54 * additional directories in the navigation (an empty
55 * directory is interpreted as FileName::getcwd())
57 FileDialog(docstring const & title, kb_action a = LFUN_SELECT_FILE_SYNC);
61 void setButton1(docstring const & label, docstring const & dir);
62 void setButton2(docstring const & label, docstring const & dir);
64 /// Choose a file for opening, starting in directory \c path.
65 Result const open(docstring const & path,
66 support::FileFilterList const & filters,
67 docstring const & suggested);
69 /// Choose a directory, starting in directory \c path.
70 Result const opendir(docstring const & path = docstring(),
71 docstring const & suggested = docstring());
73 /// Choose a file for saving, starting in directory \c path.
74 Result const save(docstring const & path,
75 support::FileFilterList const & filters,
76 docstring const & suggested);
86 /// success action to perform if not synchronous
92 #endif // FILEDIALOG_H