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 "qt_helpers.h" // for LanguagePair
42 typedef std::pair<QString, FontFamily> FamilyPair;
43 typedef std::pair<QString, FontSeries> SeriesPair;
44 typedef std::pair<QString, FontShape> ShapePair;
45 typedef std::pair<QString, FontSize> SizePair;
46 typedef std::pair<QString, FontState> BarPair;
47 typedef std::pair<QString, ColorCode> ColorPair;
49 class GuiCharacter : public GuiDialog, public Ui::CharacterUi
54 GuiCharacter(GuiView & lv);
57 void change_adaptor();
63 void updateContents();
65 std::vector<FamilyPair> family;
66 std::vector<SeriesPair> series;
67 std::vector<ShapePair> shape;
68 std::vector<SizePair> size;
69 std::vector<BarPair> bar;
70 std::vector<ColorPair> color;
71 std::vector<LanguagePair> language;
74 bool initialiseParams(std::string const & data);
78 void dispatchParams();
80 bool isBufferDependent() const { return true; }
82 kb_action getLfun() const { return LFUN_FONT_FREE_UPDATE; }
85 void setFamily(FontFamily);
87 void setSeries(FontSeries);
89 void setShape(FontShape);
91 void setSize(FontSize);
93 void setBar(FontState);
95 void setColor(ColorCode);
97 void setLanguage(std::string const &);
100 FontFamily getFamily() const;
102 FontSeries getSeries() const;
104 FontShape getShape() const;
106 FontSize getSize() const;
108 FontState getBar() const;
110 ColorCode getColor() const;
112 std::string getLanguage() const;
119 /// If true the language should be reset.
120 /// If false the language of font_ is used.
124 } // namespace frontend
127 #endif // GUICHARACTER_H