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 namespace support { class FileFilterList; }
29 * \brief GUI-I definition of file dialog interface
34 /// label, directory path button
35 typedef std::pair<QString, QString> Button;
39 Later, /**< modeless chooser, no result */
40 Chosen /**< string contains filename */
44 typedef std::pair<FileDialog::ResultType, QString> Result;
47 * Constructs a file dialog with title \param title.
48 * If \param a is \const LFUN_SELECT_FILE_SYNC then a value
49 * will be returned immediately upon performing a open(),
50 * otherwise a callback Dispatch() will be invoked with the filename as
51 * argument, of action \param a.
53 * Up to two optional extra buttons are allowed for specifying
54 * additional directories in the navigation (an empty
55 * directory is interpreted as FileName::getcwd())
57 FileDialog(QString const & title, FuncCode a = LFUN_SELECT_FILE_SYNC);
61 void setButton1(QString const & label, QString const & dir);
62 void setButton2(QString const & label, QString const & dir);
64 /// Choose a file for opening, starting in directory \c path.
65 Result open(QString const & path,
66 support::FileFilterList const & filters,
67 QString const & suggested = QString());
69 /// Choose a directory, starting in directory \c path.
70 Result opendir(QString const & path = QString(),
71 QString const & suggested = QString());
73 /// Choose a file for saving, starting in directory \c path.
74 Result save(QString const & path,
75 support::FileFilterList const & filters,
76 QString const & suggested = QString());
86 /// success action to perform if not synchronous
92 #endif // FILEDIALOG_H