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
19 #include "commandtags.h"
27 * \brief GUI-I definition of file dialog interface
32 /// label, directory path button
33 typedef std::pair<string, string> Button;
37 Later, /**< modeless chooser, no result */
38 Chosen /**< string contains filename */
42 typedef std::pair<FileDialog::ResultType, string> Result;
45 * Constructs a file dialog attached to LyXView \param lv, with
46 * title \param title. If \param a is \const LFUN_SELECT_FILE_SYNC
47 * then a value will be returned immediately upon performing a open(),
48 * otherwise a callback Dispatch() will be invoked with the filename as
49 * argument, of action \param a.
51 * Up to two optional extra buttons are allowed for specifying
52 * additional directories in the navigation (an empty
53 * directory is interpreted as getcwd())
55 FileDialog(LyXView * lv, string const & title,
56 kb_action a = LFUN_SELECT_FILE_SYNC,
57 Button b1 = Button(string(), string()),
58 Button b2 = Button(string(), string()));
64 * Choose a file for opening, starting in directory \param
65 * path, with the file selection \param mask. The \param mask
66 * string is of the form :
68 * <glob to match> | <description>
70 * for example, "*.ps | PostScript files (*.ps)".
72 * FIXME: should support multiple lines of these for different file types.
74 Result const open(string const & path = string(),
75 string const & mask = string(),
76 string const & suggested = string());
79 * Choose a directory, starting in directory \param
82 Result const opendir(string const & path = string(),
83 string const & suggested = string());
86 * Choose a file for saving, starting in directory \param
87 * path, with the file selection \param mask. The \param mask
88 * string is of the form :
90 * <glob to match> | <description>
92 * for example, "*.ps | PostScript files (*.ps)".
94 Result const save(string const & path = string(),
95 string const & mask = string(),
96 string const & suggested = string());
99 /* This *has* to be public because there is no way to specify extern "C" functions
100 * as friends of Private implementation for the xforms implementation ... grr
103 friend class Private;
113 /// success action to perform if not synchronous
118 #endif // FILEDIALOG_H