4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
11 * Full author contact details are available in file CREDITS.
14 #ifndef GUICHARACTER_H
15 #define GUICHARACTER_H
17 #include "GuiDialog.h"
18 #include "ui_CharacterUi.h"
19 #include "frontend_helpers.h" // for LanguagePair
44 typedef std::pair<QString, Font::FONT_FAMILY> FamilyPair;
45 typedef std::pair<QString, Font::FONT_SERIES> SeriesPair;
46 typedef std::pair<QString, Font::FONT_SHAPE> ShapePair;
47 typedef std::pair<QString, Font::FONT_SIZE> SizePair;
48 typedef std::pair<QString, FontState> BarPair;
49 typedef std::pair<QString, Color_color> ColorPair;
51 class GuiCharacter : public GuiDialog, public Ui::CharacterUi, public Controller
56 GuiCharacter(LyXView & lv);
59 void change_adaptor();
62 void closeEvent(QCloseEvent * e);
64 Controller & controller() { return *this; }
68 void updateContents();
70 std::vector<FamilyPair> family;
71 std::vector<SeriesPair> series;
72 std::vector<ShapePair> shape;
73 std::vector<SizePair> size;
74 std::vector<BarPair> bar;
75 std::vector<ColorPair> color;
76 std::vector<LanguagePair> language;
79 bool initialiseParams(std::string const & data);
83 void dispatchParams();
85 bool isBufferDependent() const { return true; }
87 kb_action getLfun() const { return LFUN_FONT_FREE_UPDATE; }
90 void setFamily(Font::FONT_FAMILY);
92 void setSeries(Font::FONT_SERIES);
94 void setShape(Font::FONT_SHAPE);
96 void setSize(Font::FONT_SIZE);
98 void setBar(FontState);
100 void setColor(Color_color);
102 void setLanguage(std::string const &);
104 void setToggleAll(bool);
107 Font::FONT_FAMILY getFamily() const;
109 Font::FONT_SERIES getSeries() const;
111 Font::FONT_SHAPE getShape() const;
113 Font::FONT_SIZE getSize() const;
115 FontState getBar() const;
117 Color_color getColor() const;
119 std::string getLanguage() const;
121 bool getToggleAll() const;
127 /// If true the language should be reset.
128 /// If false the language of font_ is used.
132 } // namespace frontend
135 #endif // GUICHARACTER_H