]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormPreferences.h
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / FormPreferences.h
index 335220f121ad07829be2998b28a85ebe9ad53a37..9ef2f6adfb27806d8151d8ebdc2388dc1e0a156e 100644 (file)
@@ -1,22 +1,21 @@
 // -*- C++ -*-
 /**
  * \file FormPreferences.h
- * Copyright 1995-2002 the LyX Team
  * Copyright 1999-2001 Allan Rae
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Allan Rae, rae@lyx.org
- * \author Angus Leeming, a.leeming@ic.ac.uk
+ * \author Allan Rae
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #ifndef FORMPREFERENCES_H
 #define FORMPREFERENCES_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
-#include "FormBaseDeprecated.h"
+#include "FormBase.h"
 #include "Color.h" // NamedColor
 #include "xforms_helpers.h" // XformColor
 
@@ -25,7 +24,8 @@
 #include FORMS_H_LOCATION
 #include <utility> // pair
 
-class Combox;
+class ControlPrefs;
+
 class Dialogs;
 class LyXView;
 class RGBColor;
@@ -37,6 +37,7 @@ struct FD_preferences_inputs_misc;
 struct FD_preferences_interface;
 struct FD_preferences_language;
 struct FD_preferences_lnf_misc;
+struct FD_preferences_identity;
 struct FD_preferences_inner_tab;
 struct FD_preferences_outputs_misc;
 struct FD_preferences_paths;
@@ -46,17 +47,13 @@ struct FD_preferences_spelloptions;
 
 
 /** This class provides an XForms implementation of the FormPreferences Dialog.
   The preferences dialog allows users to set/save their preferences.
*  The preferences dialog allows users to set/save their preferences.
  */
-class FormPreferences : public FormBaseBI {
+class FormPreferences : public FormCB<ControlPrefs, FormDB<FD_preferences> > {
 public:
-       friend void gui_ShowPreferences(LyXView &, Dialogs &);
-       ///
-       FormPreferences(LyXView &, Dialogs &);
+       FormPreferences();
 
 private:
-       /// Pointer to the actual instantiation of the ButtonController.
-       virtual xformsBC & bc();
        /** Redraw the form (on receipt of a Signal indicating, for example,
            that the xforms colours have been re-mapped). */
        virtual void redraw();
@@ -64,26 +61,15 @@ private:
        virtual void update();
        /// Hide the dialog.
        virtual void hide();
-       /// OK (Save) from dialog
-       virtual void ok();
        /// Apply from dialog
        virtual void apply();
        /// Filter the inputs -- return true if entries are valid
-       virtual bool input(FL_OBJECT *, long);
+       virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
        /// Build the dialog
        virtual void build();
-       /// Pointer to the actual instantiation of the xforms form.
-       virtual FL_FORM * form() const;
        /// control which feedback message is output
        string const getFeedback(FL_OBJECT *);
-       ///
-       void browse(FL_OBJECT * input,
-                   string const & title, string const & pattern,
-                   std::pair<string,string> const & dir1= std::make_pair(string(),string()),
-                   std::pair<string,string> const & dir2 = std::make_pair(string(),string()));
 
-       /// Real GUI implementation.
-       boost::scoped_ptr<FD_preferences> dialog_;
        /// Converters tabfolder
        boost::scoped_ptr<FD_preferences_inner_tab> converters_tab_;
        /// reLyX and other import/input stuff
@@ -139,8 +125,6 @@ private:
                void Modify();
                ///
                void SwitchColorSpace() const;
-               ///
-               string const X11hexname(RGBColor const &) const;
 
                ///
                FormPreferences & parent_;
@@ -245,13 +229,13 @@ private:
                ///
                FD_preferences_inputs_misc const * dialog();
                ///
-               void apply() const;
+               void apply(LyXRC & rc) const;
                ///
                void build();
                ///
                string const feedback(FL_OBJECT const * const) const;
                ///
-               void update();
+               void update(LyXRC const & rc);
 
        private:
                ///
@@ -270,7 +254,7 @@ private:
                ///
                FD_preferences_interface const * dialog();
                ///
-               void apply() const;
+               void apply(LyXRC & rc) const;
                ///
                void build();
                ///
@@ -278,7 +262,7 @@ private:
                ///
                bool input(FL_OBJECT const * const);
                ///
-               void update();
+               void update(LyXRC const & rc);
 
        private:
                ///
@@ -297,7 +281,7 @@ private:
                ///
                FD_preferences_language const * dialog();
                ///
-               void apply(); // not const because calls update()
+               void apply(LyXRC & rc); // not const because calls update()
                ///
                void build();
                ///
@@ -305,9 +289,7 @@ private:
                ///
                bool input(FL_OBJECT const * const);
                ///
-               void update();
-               ///
-               static void ComboCB(int, void *, Combox *);
+               void update(LyXRC const & rc);
 
        private:
                ///
@@ -315,8 +297,6 @@ private:
                ///
                boost::scoped_ptr<FD_preferences_language> dialog_;
                ///
-               boost::scoped_ptr<Combox> combo_default_lang;
-               ///
                std::vector<string> lang_;
        };
        ///
@@ -330,13 +310,13 @@ private:
                ///
                FD_preferences_lnf_misc const * dialog();
                ///
-               void apply() const;
+               void apply(LyXRC & rc) const;
                ///
                void build();
                ///
                string const feedback(FL_OBJECT const * const) const;
                ///
-               void update();
+               void update(LyXRC const & rc);
 
        private:
                ///
@@ -347,6 +327,29 @@ private:
        ///
        friend class LnFmisc;
 
+       class Identity {
+       public:
+               ///
+               Identity(FormPreferences &  p);
+               ///
+               FD_preferences_identity const * dialog();
+               ///
+               void apply(LyXRC & rc) const;
+               ///
+               void build();
+               ///
+               string const feedback(FL_OBJECT const * const) const;
+               ///
+               void update(LyXRC const & rc);
+
+       private:
+               ///
+               FormPreferences & parent_;
+               ///
+               boost::scoped_ptr<FD_preferences_identity> dialog_;
+       };
+       friend class Identity;
+
        ///
        class OutputsMisc {
        public:
@@ -355,13 +358,13 @@ private:
                ///
                FD_preferences_outputs_misc const * dialog();
                ///
-               void apply() const;
+               void apply(LyXRC & rc) const;
                ///
                void build();
                ///
                string const feedback(FL_OBJECT const * const) const;
                ///
-               void update();
+               void update(LyXRC const & rc);
 
        private:
                ///
@@ -380,7 +383,7 @@ private:
                ///
                FD_preferences_paths const * dialog();
                ///
-               void apply();
+               void apply(LyXRC & rc);
                ///
                void build();
                ///
@@ -388,7 +391,7 @@ private:
                ///
                bool input(FL_OBJECT const * const);
                ///
-               void update();
+               void update(LyXRC const & rc);
 
        private:
                ///
@@ -407,13 +410,13 @@ private:
                ///
                FD_preferences_printer const * dialog();
                ///
-               void apply() const;
+               void apply(LyXRC & rc) const;
                ///
                void build();
                ///
                string const feedback(FL_OBJECT const * const) const;
                ///
-               void update();
+               void update(LyXRC const & rc);
 
        private:
                ///
@@ -432,7 +435,7 @@ private:
                ///
                FD_preferences_screen_fonts const * dialog();
                ///
-               void apply() const;
+               void apply(LyXRC & rc) const;
                ///
                void build();
                ///
@@ -440,7 +443,7 @@ private:
                ///
                bool input();
                ///
-               void update();
+               void update(LyXRC const & rc);
 
        private:
                ///
@@ -459,7 +462,7 @@ private:
                ///
                FD_preferences_spelloptions const * dialog();
                ///
-               void apply(); // not const because calls update()!
+               void apply(LyXRC & rc); // not const because calls update()!
                ///
                void build();
                ///
@@ -467,7 +470,7 @@ private:
                ///
                bool input(FL_OBJECT const * const);
                ///
-               void update();
+               void update(LyXRC const & rc);
 
        private:
                ///
@@ -496,6 +499,8 @@ private:
        ///
        LnFmisc lnf_misc_;
        ///
+       Identity identity_;
+       ///
        OutputsMisc outputs_misc_;
        ///
        Paths paths_;
@@ -523,15 +528,6 @@ private:
                ///
                RGBColor col;
        };
-       /// The ButtonController
-       ButtonController<PreferencesPolicy, xformsBC> bc_;
 };
 
-
-inline
-xformsBC & FormPreferences::bc()
-{
-       return bc_;
-}
-
-#endif
+#endif // FORMPREFERENCES_H