// -*- C++ -*-
/**
* \file FormPreferences.h
- * Copyright 1999-2001 Allan Rae
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Allan Rae
* \author Angus Leeming
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#ifndef FORMPREFERENCES_H
#define FORMPREFERENCES_H
-#ifdef __GNUG__
-#pragma interface
-#endif
+#include "FormDialogView.h"
-#include "FormBase.h"
-#include "Color.h" // NamedColor
-#include "xforms_helpers.h" // XformColor
+#include "lyx_forms.h"
#include <boost/scoped_ptr.hpp>
-#include FORMS_H_LOCATION
-#include <utility> // pair
+class Converters;
+class Formats;
+class Movers;
-class ControlPrefs;
-
-class Combox;
class Dialogs;
+class LyXRC;
class LyXView;
-class RGBColor;
+
+namespace lyx {
+namespace frontend {
+
+class ControlPrefs;
struct FD_preferences;
struct FD_preferences_colors;
struct FD_preferences_converters;
+struct FD_preferences_copiers;
struct FD_preferences_formats;
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;
struct FD_preferences_screen_fonts;
struct FD_preferences_spelloptions;
+class FormColorpicker;
+class NamedColor;
+class RGBColor;
+class XformsColor;
/** 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 FormCB<ControlPrefs, FormDB<FD_preferences> > {
+class FormPreferences
+ : public FormController<ControlPrefs, FormView<FD_preferences> > {
public:
- FormPreferences();
+ FormPreferences(Dialog &);
private:
/** Redraw the form (on receipt of a Signal indicating, for example,
/// Build the dialog
virtual void build();
/// control which feedback message is output
- string const getFeedback(FL_OBJECT *);
+ std::string const getFeedback(FL_OBJECT *);
/// Converters tabfolder
boost::scoped_ptr<FD_preferences_inner_tab> converters_tab_;
public:
///
enum GuiColors {
- GUI_COLOR_CHOICE = FL_FREE_COL14,
- GUI_COLOR_HUE_DIAL = FL_FREE_COL15,
+ GUI_COLOR_CHOICE = FL_FREE_COL15,
GUI_COLOR_CURSOR = FL_FREE_COL16
};
///
///
void build();
///
- string const feedback(FL_OBJECT const * const) const;
+ std::string const feedback(FL_OBJECT const * const) const;
///
void input(FL_OBJECT const * const);
///
///
void InputBrowserLyX() const;
///
- void InputHSV();
- ///
- void InputRGB();
- ///
void LoadBrowserLyX();
///
void Modify();
- ///
- void SwitchColorSpace() const;
- ///
- string const X11hexname(RGBColor const &) const;
///
FormPreferences & parent_;
///
boost::scoped_ptr<FD_preferences_colors> dialog_;
+ ///
+ boost::scoped_ptr<FormColorpicker> picker_;
/// A vector of LyX LColor GUI name and associated RGB color.
std::vector<NamedColor> lyxColorDB;
///
FD_preferences_converters const * dialog();
///
- void apply() const;
- ///
void build();
///
- string const feedback(FL_OBJECT const * const) const;
+ std::string const feedback(FL_OBJECT const * const) const;
///
bool input(FL_OBJECT const * const);
///
///
void UpdateBrowser();
///
- void UpdateChoices() const;
+ void UpdateChoices();
private:
///
///
bool Input();
///
- string const GetFrom() const;
+ std::string const GetFrom();
///
- string const GetTo() const;
+ std::string const GetTo();
+ ///
+ ::Converters & converters();
+ ::Formats & formats();
///
FormPreferences & parent_;
///
friend class Converters;
+ ///
+ class Copiers {
+ public:
+ ///
+ Copiers(FormPreferences & p);
+ ///
+ FD_preferences_copiers const * dialog();
+ ///
+ void build();
+ ///
+ std::string const feedback(FL_OBJECT const * const) const;
+ ///
+ bool input(FL_OBJECT const * const);
+ ///
+ void update();
+
+ private:
+ ///
+ bool Add();
+ ///
+ bool Browser();
+ ///
+ bool Erase();
+ ///
+ bool Input();
+ ///
+ ::Movers & movers();
+
+ ///
+ FormPreferences & parent_;
+ ///
+ boost::scoped_ptr<FD_preferences_copiers> dialog_;
+ };
+ ///
+ friend class Copiers;
+
///
class Formats {
public:
///
FD_preferences_formats const * dialog();
///
- void apply() const;
- ///
void build();
///
- string const feedback(FL_OBJECT const * const) const;
+ std::string const feedback(FL_OBJECT const * const) const;
///
bool input(FL_OBJECT const * const);
///
bool erase();
///
bool Input();
+ //
+ ::Converters & converters();
+ ::Formats & formats();
///
FormPreferences & parent_;
///
void build();
///
- string const feedback(FL_OBJECT const * const) const;
+ std::string const feedback(FL_OBJECT const * const) const;
///
void update(LyXRC const & rc);
///
void build();
///
- string const feedback(FL_OBJECT const * const) const;
+ std::string const feedback(FL_OBJECT const * const) const;
///
bool input(FL_OBJECT const * const);
///
///
void build();
///
- string const feedback(FL_OBJECT const * const) const;
+ std::string const feedback(FL_OBJECT const * const) const;
///
bool input(FL_OBJECT const * const);
///
void update(LyXRC const & rc);
- ///
- static void ComboCB(int, void *, Combox *);
private:
///
///
boost::scoped_ptr<FD_preferences_language> dialog_;
///
- boost::scoped_ptr<Combox> combo_default_lang;
- ///
- std::vector<string> lang_;
+ std::vector<std::string> lang_;
};
///
friend class Language;
///
void build();
///
- string const feedback(FL_OBJECT const * const) const;
+ std::string const feedback(FL_OBJECT const * const) const;
///
void update(LyXRC const & rc);
///
friend class LnFmisc;
+ class Identity {
+ public:
+ ///
+ Identity(FormPreferences & p);
+ ///
+ FD_preferences_identity const * dialog();
+ ///
+ void apply(LyXRC & rc) const;
+ ///
+ void build();
+ ///
+ std::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:
///
void build();
///
- string const feedback(FL_OBJECT const * const) const;
+ std::string const feedback(FL_OBJECT const * const) const;
///
void update(LyXRC const & rc);
///
void build();
///
- string const feedback(FL_OBJECT const * const) const;
+ std::string const feedback(FL_OBJECT const * const) const;
///
bool input(FL_OBJECT const * const);
///
///
void build();
///
- string const feedback(FL_OBJECT const * const) const;
+ std::string const feedback(FL_OBJECT const * const) const;
///
void update(LyXRC const & rc);
///
void build();
///
- string const feedback(FL_OBJECT const * const) const;
+ std::string const feedback(FL_OBJECT const * const) const;
///
bool input();
///
///
void build();
///
- string const feedback(FL_OBJECT const * const) const;
+ std::string const feedback(FL_OBJECT const * const) const;
///
bool input(FL_OBJECT const * const);
///
///
Converters converters_;
///
- InputsMisc inputs_misc_;
+ Copiers copiers_;
///
Formats formats_;
///
+ Identity identity_;
+ ///
+ InputsMisc inputs_misc_;
+ ///
Interface interface_;
///
Language language_;
ScreenFonts screen_fonts_;
///
SpellOptions spelloptions_;
-
- /** A couple of helper structs to enable colors to be sorted by name
- and by color */
- ///
- struct SortColorsByName {
- ///
- int operator()(NamedColor const & a, NamedColor const & b) const
- { return (a.getname() < b.getname()); }
- };
- ///
- struct SortColorsByColor {
- ///
- SortColorsByColor(RGBColor c) : col(c) {}
- ///
- int operator()(RGBColor const &, RGBColor const &) const;
- ///
- RGBColor col;
- };
};
+} // namespace frontend
+} // namespace lyx
+
#endif // FORMPREFERENCES_H