]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormFiledialog.h
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / FormFiledialog.h
index 4f4032444d19f09264130d7f7b1245b89047e5ae..93b97b26c3194270fe5b0dea0db7eb1c979ae2c5 100644 (file)
@@ -1,23 +1,18 @@
 // -*- C++ -*-
 /**
  * \file FormFiledialog.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, moz@compsoc.man.ac.uk
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef FORMFILEDIALOG_H
 #define FORMFILEDIALOG_H
 
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include "LString.h"
-
 #include "forms_fwd.h"
 
 #include "frontends/FileDialog.h"
 
 #include <vector>
 
+class Dialogs;
+
 /// DirEntry internal structure definition
 class DirEntry {
 public:
        ///
-       string pszName;
+       std::string name_;
        ///
-       string pszDisplayed;
+       std::string displayed_;
        ///
-       string pszLsEntry;
+       std::string ls_entry_;
 };
 
 
@@ -48,6 +45,15 @@ public:
 
 class FD_filedialog;
 
+namespace lyx {
+namespace support {
+
+class FileFilterList;
+
+} // namespace support
+} // namespace lyx
+
+
 class FileDialog::Private : public boost::signals::trackable {
 public:
        ///
@@ -56,15 +62,19 @@ public:
        ~Private();
 
        /// sets file selector user button action
-       void SetButton(int iIndex, string const & pszName = string(),
-                      string const & pszPath = string());
+       void SetButton(int iIndex, std::string const & pszName = std::string(),
+                      std::string const & pszPath = std::string());
        /// gets last dialog directory
-       string const GetDirectory() const;
+       std::string const GetDirectory() const;
        /// launches dialog and returns selected file
-       string const Select(string const & pszTitle = string(),
-                      string const & pszPath = string(),
-                      string const & pszMask = string(),
-                      string const & pszSuggested = string());
+       std::string const Select(std::string const & pszTitle,
+                                std::string const & pszPath,
+                                lyx::support::FileFilterList const & filters,
+                                std::string const & pszSuggested);
+       /// launches dialog and returns selected directory
+       std::string const SelectDir(std::string const & pszTitle = std::string(),
+                      std::string const & pszPath = std::string(),
+                      std::string const & pszSuggested = std::string());
        /// XForms objects callback (static)
        static void FileDlgCB(FL_OBJECT *, long);
        /// Callback for double click in list
@@ -74,35 +84,39 @@ public:
 
 private:
        /// data
-       static FD_filedialog * pFileDlgForm;
+       static FD_filedialog * file_dlg_form_;
+       ///
+       static FileDialog::Private * current_dlg_;
+       ///
+       static int minw_;
        ///
-       static FileDialog::Private * pCurrentDlg;
+       static int minh_;
        ///
-       string pszUserPath1;
+       std::string user_path1_;
        ///
-       string pszUserPath2;
+       std::string user_path2_;
        ///
-       string pszDirectory;
+       std::string directory_;
        ///
-       string pszMask;
+       std::string mask_;
        ///
-       string pszFileName;
+       std::string file_name_;
        ///
-       int iDepth;
+       int depth_;
        ///
-       int iLastSel;
+       int last_sel_;
        ///
-       long lLastTime;
+       long last_time_;
        ///
-       string pszInfoLine;
+       std::string info_line_;
        ///
        typedef std::vector<DirEntry> DirEntries;
        ///
-       DirEntries direntries;
+       DirEntries dir_entries_;
        ///
-       bool force_cancel;
+       bool force_cancel_;
        ///
-       bool force_ok;
+       bool force_ok_;
 
        /** Redraw the form (on receipt of a Signal indicating, for example,
            that the xform colors have been re-mapped).
@@ -111,11 +125,12 @@ private:
        /// updates dialog list to match class directory
        void Reread();
        /// sets dialog current directory
-       void SetDirectory(string const & pszPath);
+       void SetDirectory(std::string const & pszPath);
        /// sets dialog file mask
-       void SetMask(string const & pszNewMask);
+       void SetFilters(std::string const & filters);
+       void SetFilters(lyx::support::FileFilterList const & filters);
        /// sets dialog information line
-       void SetInfoLine(string const & pszLine);
+       void SetInfoLine(std::string const & pszLine);
        /// handle dialog during file selection
        bool RunDialog();
        /// Handle callback from list