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
25 * \brief GUI-I definition of file dialog interface
30 /// label, directory path button
31 typedef std::pair<string, string> Button;
35 Later, /**< modeless chooser, no result */
36 Chosen /**< string contains filename */
40 typedef std::pair<FileDialog::ResultType, string> Result;
43 * Constructs a file dialog with title \param title.
44 * If \param a is \const LFUN_SELECT_FILE_SYNC then a value
45 * will be returned immediately upon performing a open(),
46 * otherwise a callback Dispatch() will be invoked with the filename as
47 * argument, of action \param a.
49 * Up to two optional extra buttons are allowed for specifying
50 * additional directories in the navigation (an empty
51 * directory is interpreted as getcwd())
53 FileDialog(string const & title,
54 kb_action a = LFUN_SELECT_FILE_SYNC,
55 Button b1 = Button(string(), string()),
56 Button b2 = Button(string(), string()));
62 * Choose a file for opening, starting in directory \param
63 * path, with the file selection \param mask. The \param mask
64 * string is of the form :
66 * <glob to match> | <description>
68 * for example, "*.ps | PostScript files (*.ps)".
70 * FIXME: should support multiple lines of these for different file types.
72 Result const open(string const & path = string(),
73 string const & mask = string(),
74 string const & suggested = string());
77 * Choose a directory, starting in directory \param
80 Result const opendir(string const & path = string(),
81 string const & suggested = string());
84 * Choose a file for saving, starting in directory \param
85 * path, with the file selection \param mask. The \param mask
86 * string is of the form :
88 * <glob to match> | <description>
90 * for example, "*.ps | PostScript files (*.ps)".
92 Result const save(string const & path = string(),
93 string const & mask = string(),
94 string const & suggested = string());
97 /* This *has* to be public because there is no way to specify extern "C" functions
98 * as friends of Private implementation for the xforms implementation ... grr
101 friend class Private;
108 /// success action to perform if not synchronous
113 #endif // FILEDIALOG_H