]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlPrefs.h
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlPrefs.h
index aa54bb41df0bdcbdfdb16ff36555eb4b36a6d3d8..0d5f158808ca2ff4498fce673649f849d252377f 100644 (file)
 #ifndef CONTROLPREFS_H
 #define CONTROLPREFS_H
 
-
-#include "ControlDialog_impl.h"
+#include "Dialog.h"
+#include "converter.h"
+#include "format.h"
 #include "lyxrc.h"
+#include "mover.h"
 
+#include <string>
+#include <vector>
 
-class Converters;
 class LColor_color;
-class Formats;
 
-class ControlPrefs : public ControlDialogBI {
-public:
-       ControlPrefs(LyXView &, Dialogs &);
+namespace lyx {
+namespace frontend {
 
-       // FIXME: we should probably devolve the individual
-       // settings to methods here. But for now, this will
-       // do
+class ControlPrefs : public Dialog::Controller {
+public:
+       ControlPrefs(Dialog &);
+       ///
+       virtual bool initialiseParams(std::string const &);
+       ///
+       virtual void clearParams() {}
+       ///
+       virtual void dispatchParams();
+       ///
+       virtual bool isBufferDependent() const { return false; }
 
        LyXRC & rc() { return rc_; }
-
        LyXRC const & rc() const { return rc_; }
 
+       Converters & converters() { return converters_; }
+       Converters const & converters() const { return converters_; }
+
+       Formats & formats() { return formats_; }
+       Formats const & formats() const { return formats_; }
+
+       Movers & movers() { return movers_; }
+       Movers const & movers() const { return movers_; }
+
        /// various file pickers
-       std::string const browsebind(std::string const & file);
-       std::string const browseUI(std::string const & file);
-       std::string const browsekbmap(std::string const & file);
-       std::string const browsedict(std::string const & file);
+       std::string const browsebind(std::string const & file) const;
+       std::string const browseUI(std::string const & file) const;
+       std::string const browsekbmap(std::string const & file) const;
+       std::string const browsedict(std::string const & file) const;
 
        /// general browse
-       std::string const browse(std::string const & file, std::string const & title);
+       std::string const browse(std::string const & file,
+                                std::string const & title) const;
 
        /// browse directory
-       std::string const browsedir(std::string const & path, std::string const & title);
+       std::string const browsedir(std::string const & path,
+                                   std::string const & title) const;
 
        /// redraw widgets (for xforms color change)
        void redrawGUI();
@@ -54,21 +73,32 @@ public:
        /// update the screen fonts after change
        void updateScreenFonts();
 
-       /// set global converters
-       void setConverters(Converters const & conv);
-
-       /// set global formats
-       void setFormats(Formats const & form);
+       /// adjust the prefs paper sizes
+       PAPER_SIZE const toPaperSize(int i) const;
+       /// adjust the prefs paper sizes
+       int const fromPaperSize(PAPER_SIZE papersize) const;
 
 private:
-       /// get current lyxrc
-       virtual void setParams();
-
-       /// apply current lyxrc
-       virtual void apply();
-
        /// temporary lyxrc
        LyXRC rc_;
+
+       /// temporary converters
+       Converters converters_;
+
+       /// temporary formats
+       Formats formats_;
+
+       /// temporary movers
+       Movers movers_;
+
+       /// A list of colors to be dispatched
+       std::vector<std::string> colors_;
+
+       bool redraw_gui_;
+       bool update_screen_font_;
 };
 
+} // namespace frontend
+} // namespace lyx
+
 #endif // CONTROLPREFS_H