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.
24 * \brief GUI-I definition of file dialog interface
29 /// label, directory path button
30 typedef std::pair<std::string, std::string> Button;
34 Later, /**< modeless chooser, no result */
35 Chosen /**< string contains filename */
39 typedef std::pair<FileDialog::ResultType, std::string> Result;
42 * Constructs a file dialog with title \param title.
43 * If \param a is \const LFUN_SELECT_FILE_SYNC then a value
44 * will be returned immediately upon performing a open(),
45 * otherwise a callback Dispatch() will be invoked with the filename as
46 * argument, of action \param a.
48 * Up to two optional extra buttons are allowed for specifying
49 * additional directories in the navigation (an empty
50 * directory is interpreted as getcwd())
52 FileDialog(std::string const & title,
53 kb_action a = LFUN_SELECT_FILE_SYNC,
54 Button b1 = Button(std::string(), std::string()),
55 Button b2 = Button(std::string(), std::string()));
61 * Choose a file for opening, starting in directory \param
62 * path, with the file selection \param mask. The \param mask
63 * string is of the form :
65 * <glob to match> | <description>
67 * for example, "*.ps | PostScript files (*.ps)".
69 * FIXME: should support multiple lines of these for different file types.
71 Result const open(std::string const & path = std::string(),
72 std::string const & mask = std::string(),
73 std::string const & suggested = std::string());
76 * Choose a directory, starting in directory \param
79 Result const opendir(std::string const & path = std::string(),
80 std::string const & suggested = std::string());
83 * Choose a file for saving, starting in directory \param
84 * path, with the file selection \param mask. The \param mask
85 * string is of the form :
87 * <glob to match> | <description>
89 * for example, "*.ps | PostScript files (*.ps)".
91 Result const save(std::string const & path = std::string(),
92 std::string const & mask = std::string(),
93 std::string const & suggested = std::string());
96 /* This *has* to be public because there is no way to specify extern "C" functions
97 * as friends of Private implementation for the xforms implementation ... grr
100 friend class Private;
107 /// success action to perform if not synchronous
112 #endif // FILEDIALOG_H