X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiCharacter.h;h=599807f0ae8a6b1a386a09593256e3cb453a88dc;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=7cce5132f9f345c2bf4c148995c86a56d05f7522;hpb=a1cec91afaca91968b46e695533c10ad2a3f73d3;p=lyx.git diff --git a/src/frontends/qt4/GuiCharacter.h b/src/frontends/qt4/GuiCharacter.h index 7cce5132f9..599807f0ae 100644 --- a/src/frontends/qt4/GuiCharacter.h +++ b/src/frontends/qt4/GuiCharacter.h @@ -4,71 +4,103 @@ * 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 * * Full author contact details are available in file CREDITS. */ -#ifndef QCHARACTER_H_CONTROLLER -#define QCHARACTER_H_CONTROLLER +#ifndef GUICHARACTER_H +#define GUICHARACTER_H -#include "GuiDialogView.h" +#include "GuiDialog.h" #include "ui_CharacterUi.h" -#include +#include "Font.h" -#include "controllers/frontend_helpers.h" +#include -#include +#ifdef IGNORE +#undef IGNORE +#endif namespace lyx { - -class Font; - namespace frontend { -class GuiCharacter; - -class GuiCharacterDialog : public QDialog, public Ui::CharacterUi { - Q_OBJECT -public: - GuiCharacterDialog(GuiCharacter * form); -protected: - void closeEvent(QCloseEvent * e); -private: - GuiCharacter * form_; -protected Q_SLOTS: - void change_adaptor(); +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 ControlCharacter; - -class GuiCharacter - : public QController > +class GuiCharacter : public GuiDialog, public Ui::CharacterUi { + Q_OBJECT + public: - friend class GuiCharacterDialog; + GuiCharacter(GuiView & lv); + +protected Q_SLOTS: + void change_adaptor(); - GuiCharacter(Dialog &); private: - /// Apply changes - virtual void apply(); - /// 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 } // namespace lyx -#endif // QCHARACTER_H +#endif // GUICHARACTER_H