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.
27 } // namespace support
34 * \brief GUI-I definition of file dialog interface
39 /// label, directory path button
40 typedef std::pair<std::string, std::string> Button;
44 Later, /**< modeless chooser, no result */
45 Chosen /**< string contains filename */
49 typedef std::pair<FileDialog::ResultType, std::string> Result;
52 * Constructs a file dialog with title \param title.
53 * If \param a is \const LFUN_SELECT_FILE_SYNC then a value
54 * will be returned immediately upon performing a open(),
55 * otherwise a callback Dispatch() will be invoked with the filename as
56 * argument, of action \param a.
58 * Up to two optional extra buttons are allowed for specifying
59 * additional directories in the navigation (an empty
60 * directory is interpreted as getcwd())
62 FileDialog(std::string const & title,
63 kb_action a = LFUN_SELECT_FILE_SYNC,
64 Button b1 = Button(std::string(), std::string()),
65 Button b2 = Button(std::string(), std::string()));
70 /// Choose a file for opening, starting in directory \c path.
71 Result const open(std::string const & path,
72 lyx::support::FileFilterList const & filters,
73 std::string const & suggested);
75 /// Choose a directory, starting in directory \c path.
76 Result const opendir(std::string const & path = std::string(),
77 std::string const & suggested = std::string());
79 /// Choose a file for saving, starting in directory \c path.
80 Result const save(std::string const & path,
81 lyx::support::FileFilterList const & filters,
82 std::string const & suggested);
84 /* This *has* to be public because there is no way to specify
85 * extern "C" functions as friends of Private implementation for
86 * the xforms implementation ... grr
96 /// success action to perform if not synchronous
101 #endif // FILEDIALOG_H