X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiCharacter.h;h=599807f0ae8a6b1a386a09593256e3cb453a88dc;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=5f0145c066df6ebf8e65287f33388cacc527edcd;hpb=9a95d2a936748c057db94a3083c4b9e6587eea0b;p=lyx.git diff --git a/src/frontends/qt4/GuiCharacter.h b/src/frontends/qt4/GuiCharacter.h index 5f0145c066..599807f0ae 100644 --- a/src/frontends/qt4/GuiCharacter.h +++ b/src/frontends/qt4/GuiCharacter.h @@ -4,6 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * + * \author Angus Leeming * \author Edwin Leuven * \author John Levon * @@ -13,59 +14,90 @@ #ifndef GUICHARACTER_H #define GUICHARACTER_H -#include "GuiDialogView.h" -#include "ControlCharacter.h" +#include "GuiDialog.h" #include "ui_CharacterUi.h" +#include "Font.h" -#include +#include -#include +#ifdef IGNORE +#undef IGNORE +#endif namespace lyx { namespace frontend { -class GuiCharacter; +enum FontState { + /// + IGNORE, + /// + EMPH_TOGGLE, + /// + UNDERBAR_TOGGLE, + /// + NOUN_TOGGLE, + /// + STRIKEOUT_TOGGLE, + /// + UULINE_TOGGLE, + /// + UWAVE_TOGGLE, + /// + INHERIT +}; + +typedef std::pair FamilyPair; +typedef std::pair FamilyPair; +typedef std::pair SeriesPair; +typedef std::pair ShapePair; +typedef std::pair SizePair; +typedef std::pair BarPair; +typedef std::pair ColorPair; +typedef std::pair LanguagePair; -class GuiCharacterDialog : public QDialog, public Ui::CharacterUi { +class GuiCharacter : public GuiDialog, public Ui::CharacterUi +{ Q_OBJECT + public: - GuiCharacterDialog(GuiCharacter * form); -protected: - void closeEvent(QCloseEvent * e); -private: - GuiCharacter * form_; + GuiCharacter(GuiView & lv); + protected Q_SLOTS: void change_adaptor(); -}; - -class GuiCharacter : public GuiView -{ -public: - friend class GuiCharacterDialog; - - GuiCharacter(GuiDialog &); - /// parent controller - ControlCharacter & controller() - { return static_cast(this->getController()); } - /// parent controller - ControlCharacter const & controller() const - { return static_cast(this->getController()); } private: - /// Apply changes - virtual void applyView(); - /// update - virtual void update_contents(); - /// build the dialog - virtual void build_dialog(); - - std::vector family; - std::vector series; - std::vector shape; - std::vector size; - std::vector bar; - std::vector color; - std::vector language; + /// \name Dialog inherited methods + //@{ + void applyView(); + void updateContents(); + bool initialiseParams(std::string const & data); + void clearParams() {} + void dispatchParams(); + bool isBufferDependent() const { return true; } + FuncCode getLfun() const { return LFUN_TEXTSTYLE_UPDATE; } + void saveSession() const; + void restoreSession(); + //@} + + /// + void paramsToDialog(Font const & font); + + QList family; + QList series; + QList shape; + QList size; + QList bar; + QList color; + QList language; + + /// + /// + Font font_; + /// + bool toggleall_; + /// If true the language should be reset. + /// If false the language of font_ is used. + bool reset_lang_; }; } // namespace frontend