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.
18 #include "support/docstring.h"
29 } // namespace support
36 * \brief GUI-I definition of file dialog interface
41 /// label, directory path button
42 typedef std::pair<lyx::docstring, lyx::docstring> Button;
46 Later, /**< modeless chooser, no result */
47 Chosen /**< string contains filename */
51 typedef std::pair<FileDialog::ResultType, lyx::docstring> Result;
54 * Constructs a file dialog with title \param title.
55 * If \param a is \const LFUN_SELECT_FILE_SYNC then a value
56 * will be returned immediately upon performing a open(),
57 * otherwise a callback Dispatch() will be invoked with the filename as
58 * argument, of action \param a.
60 * Up to two optional extra buttons are allowed for specifying
61 * additional directories in the navigation (an empty
62 * directory is interpreted as getcwd())
64 FileDialog(lyx::docstring const & title,
65 kb_action a = LFUN_SELECT_FILE_SYNC,
66 Button b1 = Button(lyx::docstring(), lyx::docstring()),
67 Button b2 = Button(lyx::docstring(), lyx::docstring()));
72 /// Choose a file for opening, starting in directory \c path.
73 Result const open(lyx::docstring const & path,
74 lyx::support::FileFilterList const & filters,
75 lyx::docstring const & suggested);
77 /// Choose a directory, starting in directory \c path.
78 Result const opendir(lyx::docstring const & path = lyx::docstring(),
79 lyx::docstring const & suggested = lyx::docstring());
81 /// Choose a file for saving, starting in directory \c path.
82 Result const save(lyx::docstring const & path,
83 lyx::support::FileFilterList const & filters,
84 lyx::docstring const & suggested);
92 lyx::docstring title_;
94 /// success action to perform if not synchronous
99 #endif // FILEDIALOG_H