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"
25 namespace support { class FileFilterList; }
30 * \brief GUI-I definition of file dialog interface
35 /// label, directory path button
36 typedef std::pair<docstring, docstring> Button;
40 Later, /**< modeless chooser, no result */
41 Chosen /**< string contains filename */
45 typedef std::pair<FileDialog::ResultType, docstring> Result;
48 * Constructs a file dialog with title \param title.
49 * If \param a is \const LFUN_SELECT_FILE_SYNC then a value
50 * will be returned immediately upon performing a open(),
51 * otherwise a callback Dispatch() will be invoked with the filename as
52 * argument, of action \param a.
54 * Up to two optional extra buttons are allowed for specifying
55 * additional directories in the navigation (an empty
56 * directory is interpreted as getcwd())
58 FileDialog(docstring const & title,
59 kb_action a = LFUN_SELECT_FILE_SYNC,
60 Button b1 = Button(docstring(), docstring()),
61 Button b2 = Button(docstring(), docstring()));
66 /// Choose a file for opening, starting in directory \c path.
67 Result const open(docstring const & path,
68 support::FileFilterList const & filters,
69 docstring const & suggested);
71 /// Choose a directory, starting in directory \c path.
72 Result const opendir(docstring const & path = docstring(),
73 docstring const & suggested = docstring());
75 /// Choose a file for saving, starting in directory \c path.
76 Result const save(docstring const & path,
77 support::FileFilterList const & filters,
78 docstring const & suggested);
88 /// success action to perform if not synchronous
94 #endif // FILEDIALOG_H