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.
26 * \brief GUI-I definition of file dialog interface
31 /// label, directory path button
32 typedef std::pair<QString, QString> Button;
36 Later, /**< modeless chooser, no result */
37 Chosen /**< string contains filename */
41 typedef std::pair<FileDialog::ResultType, QString> Result;
44 * Constructs a file dialog with title \param title.
45 * If \param a is \const LFUN_SELECT_FILE_SYNC then a value
46 * will be returned immediately upon performing a open(),
47 * otherwise a callback Dispatch() will be invoked with the filename as
48 * argument, of action \param a.
50 * Up to two optional extra buttons are allowed for specifying
51 * additional directories in the navigation (an empty
52 * directory is interpreted as FileName::getcwd())
54 FileDialog(QString const & title, FuncCode a = LFUN_SELECT_FILE_SYNC);
58 void setButton1(QString const & label, QString const & dir);
59 void setButton2(QString const & label, QString const & dir);
61 /// Choose a file for opening, starting in directory \c path.
62 Result open(QString const & path, QStringList const & filters,
63 QString const & suggested = QString());
65 /// Choose a directory, starting in directory \c path.
66 Result opendir(QString const & path = QString(),
67 QString const & suggested = QString());
69 /// Choose a file for saving, starting in directory \c path.
70 Result save(QString const & path, QStringList const & filters,
71 QString const & suggested = QString());
73 /// Also retrieve the selected filter (selectedFilter can be 0 if
74 /// that output is not needed).
75 Result save(QString const & path, QStringList const & filters,
76 QString const & suggested, QString *selectedFilter);
86 /// success action to perform if not synchronous
92 #endif // FILEDIALOG_H