]> git.lyx.org Git - features.git/blobdiff - src/frontends/FileDialog.h
Replace LString.h with support/std_string.h,
[features.git] / src / frontends / FileDialog.h
index 555262117ffb022b5918e8d85140788a9f57e401..bc2ce49d3e46718e438d506c61aa8dea32f34b5b 100644 (file)
@@ -1,27 +1,24 @@
 // -*- C++ -*-
 /**
  * \file FileDialog.h
- * Copyright 2001 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
  * \author unknown
  * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef FILEDIALOG_H
 #define FILEDIALOG_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
 #include <utility>
 
-#include "commandtags.h"
-
-#include "LString.h"
+#include "lfuns.h"
 
-class LyXView;
+#include "support/std_string.h"
 
 /**
  * \class FileDialog
@@ -43,9 +40,9 @@ public:
        typedef std::pair<FileDialog::ResultType, string> Result;
 
        /**
-        * Constructs a file dialog attached to LyXView \param lv, with
-        * title \param title. If \param a is \const LFUN_SELECT_FILE_SYNC
-        * then a value will be returned immediately upon performing a Select(),
+        * Constructs a file dialog with title \param title.
+        * If \param a is \const LFUN_SELECT_FILE_SYNC then a value
+        * will be returned immediately upon performing a open(),
         * otherwise a callback Dispatch() will be invoked with the filename as
         * argument, of action \param a.
         *
@@ -53,7 +50,7 @@ public:
         * additional directories in the navigation (an empty
         * directory is interpreted as getcwd())
         */
-       FileDialog(LyXView * lv, string const & title,
+       FileDialog(string const & title,
                   kb_action a = LFUN_SELECT_FILE_SYNC,
                   Button b1 = Button(string(), string()),
                   Button b2 = Button(string(), string()));
@@ -62,7 +59,7 @@ public:
        ~FileDialog();
 
        /**
-        * Choose a file for selection, starting in directory \param
+        * Choose a file for opening, starting in directory \param
         * path, with the file selection \param mask. The \param mask
         * string is of the form :
         *
@@ -72,7 +69,27 @@ public:
         *
         * FIXME: should support multiple lines of these for different file types.
         */
-       Result const Select(string const & path = string(),
+       Result const open(string const & path = string(),
+               string const & mask = string(),
+               string const & suggested = string());
+
+       /**
+        * Choose a directory, starting in directory \param
+        * path.
+        */
+       Result const opendir(string const & path = string(),
+               string const & suggested = string());
+
+       /**
+        * Choose a file for saving, starting in directory \param
+        * path, with the file selection \param mask. The \param mask
+        * string is of the form :
+        *
+        * <glob to match> | <description>
+        *
+        * for example, "*.ps | PostScript files (*.ps)".
+        */
+       Result const save(string const & path = string(),
                string const & mask = string(),
                string const & suggested = string());
 
@@ -85,9 +102,6 @@ public:
        Private * private_;
 
 private:
-       /// our LyXView
-       LyXView * lv_;
-
        /// the dialog title
        string title_;