]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormFiledialog.h
Tiny clean-ups.
[lyx.git] / src / frontends / xforms / FormFiledialog.h
index 5d87dd0594fb24ea80f50e6b9f87c67c76f88e66..9c79303c2bc73ad9971a94cfd9a0204033f7ebb1 100644 (file)
@@ -1,52 +1,51 @@
+// -*- 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
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef FORMFILEDIALOG_H
 #define FORMFILEDIALOG_H
 
-#include <vector>
-#include <sigc++/signal_system.h>
-
-#ifdef __GNUG__
-#pragma interface
-#endif
+#include "forms_fwd.h"
 
-#include <config.h>
+#include "frontends/FileDialog.h"
 
-#include "LString.h"
-#include FORMS_H_LOCATION
-#include "form_filedialog.h"
+#include <boost/signals/connection.hpp>
+#include <boost/signals/trackable.hpp>
 
-#include "frontends/FileDialog.h"
+#include <vector>
 
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::Object;
-using SigC::Connection;
-#endif
+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_;
 };
 
-extern "C" void C_LyXFileDlg_FileDlgCB(FL_OBJECT * ob, long data);
-extern "C" void C_LyXFileDlg_DoubleClickCB(FL_OBJECT * ob, long data);
-extern "C" int C_LyXFileDlg_CancelCB(FL_FORM *fl, void *xev);
 
-class FileDialog::Private : public Object
-{
+//extern "C" {
+//     void C_LyXFileDlg_FileDlgCB(FL_OBJECT * ob, long data);
+//     void C_LyXFileDlg_DoubleClickCB(FL_OBJECT * ob, long data);
+//     int C_LyXFileDlg_CancelCB(FL_FORM *fl, void *xev);
+//}
+
+
+class FD_filedialog;
+
+class FileDialog::Private : public boost::signals::trackable {
 public:
        ///
        Private();
@@ -54,15 +53,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(),
+                      std::string const & pszPath = std::string(),
+                      std::string const & pszMask = std::string(),
+                      std::string const & pszSuggested = std::string());
+       /// 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
@@ -72,38 +75,39 @@ public:
 
 private:
        /// data
-       static FD_form_filedialog * pFileDlgForm;
+       static FD_filedialog * file_dlg_form_;
        ///
-       static FileDialog::Private * pCurrentDlg;
+       static FileDialog::Private * current_dlg_;
        ///
-       string pszUserPath1;
+       static int minw_;
        ///
-       string pszUserPath2;
+       static int minh_;
        ///
-       string pszDirectory;
+       std::string user_path1_;
        ///
-       string pszMask;
+       std::string user_path2_;
        ///
-       string pszFileName;
+       std::string directory_;
        ///
-       int iDepth;
+       std::string mask_;
        ///
-       int iLastSel;
+       std::string file_name_;
        ///
-       long lLastTime;
+       int depth_;
        ///
-       string pszInfoLine;
+       int last_sel_;
+       ///
+       long last_time_;
+       ///
+       std::string info_line_;
        ///
        typedef std::vector<DirEntry> DirEntries;
        ///
-       DirEntries direntries;
+       DirEntries dir_entries_;
        ///
-       bool force_cancel;
+       bool force_cancel_;
        ///
-       bool force_ok;
-
-       /// build the dialog
-       FD_form_filedialog * build_filedialog();
+       bool force_ok_;
 
        /** Redraw the form (on receipt of a Signal indicating, for example,
            that the xform colors have been re-mapped).
@@ -112,11 +116,11 @@ 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 SetMask(std::string const & pszNewMask);
        /// 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
@@ -128,7 +132,7 @@ private:
        /// Simulates a click on OK/Cancel
        void Force(bool);
        /// Redraw connection.
-       Connection r_;
+       boost::signals::connection r_;
 };
 
 #endif // FORMFILEDIALOG_H