// -*- 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
#include FORMS_H_LOCATION
#include <utility> // pair
-class Combox;
+class ControlPrefs;
+
class Dialogs;
class LyXView;
class RGBColor;
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;
/** 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();
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
void Modify();
///
void SwitchColorSpace() const;
- ///
- string const X11hexname(RGBColor const &) const;
///
FormPreferences & parent_;
///
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:
///
///
FD_preferences_interface const * dialog();
///
- void apply() const;
+ void apply(LyXRC & rc) const;
///
void build();
///
///
bool input(FL_OBJECT const * const);
///
- void update();
+ void update(LyXRC const & rc);
private:
///
///
FD_preferences_language const * dialog();
///
- void apply(); // not const because calls update()
+ void apply(LyXRC & rc); // not const because calls update()
///
void build();
///
///
bool input(FL_OBJECT const * const);
///
- void update();
- ///
- static void ComboCB(int, void *, Combox *);
+ void update(LyXRC const & rc);
private:
///
///
boost::scoped_ptr<FD_preferences_language> dialog_;
///
- boost::scoped_ptr<Combox> combo_default_lang;
- ///
std::vector<string> lang_;
};
///
///
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:
///
///
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:
///
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:
///
///
FD_preferences_paths const * dialog();
///
- void apply();
+ void apply(LyXRC & rc);
///
void build();
///
///
bool input(FL_OBJECT const * const);
///
- void update();
+ void update(LyXRC const & rc);
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:
///
///
FD_preferences_screen_fonts const * dialog();
///
- void apply() const;
+ void apply(LyXRC & rc) const;
///
void build();
///
///
bool input();
///
- void update();
+ void update(LyXRC const & rc);
private:
///
///
FD_preferences_spelloptions const * dialog();
///
- void apply(); // not const because calls update()!
+ void apply(LyXRC & rc); // not const because calls update()!
///
void build();
///
///
bool input(FL_OBJECT const * const);
///
- void update();
+ void update(LyXRC const & rc);
private:
///
///
LnFmisc lnf_misc_;
///
+ Identity identity_;
+ ///
OutputsMisc outputs_misc_;
///
Paths paths_;
///
RGBColor col;
};
- /// The ButtonController
- ButtonController<PreferencesPolicy, xformsBC> bc_;
};
-
-inline
-xformsBC & FormPreferences::bc()
-{
- return bc_;
-}
-
-#endif
+#endif // FORMPREFERENCES_H