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
56 GuiCharacter(LyXView & lv);
59 void change_adaptor();
62 void closeEvent(QCloseEvent * e);
66 void updateContents();
68 std::vector<FamilyPair> family;
69 std::vector<SeriesPair> series;
70 std::vector<ShapePair> shape;
71 std::vector<SizePair> size;
72 std::vector<BarPair> bar;
73 std::vector<ColorPair> color;
74 std::vector<LanguagePair> language;
77 bool initialiseParams(std::string const & data);
81 void dispatchParams();
83 bool isBufferDependent() const { return true; }
85 kb_action getLfun() const { return LFUN_FONT_FREE_UPDATE; }
88 void setFamily(Font::FONT_FAMILY);
90 void setSeries(Font::FONT_SERIES);
92 void setShape(Font::FONT_SHAPE);
94 void setSize(Font::FONT_SIZE);
96 void setBar(FontState);
98 void setColor(Color_color);
100 void setLanguage(std::string const &);
103 Font::FONT_FAMILY getFamily() const;
105 Font::FONT_SERIES getSeries() const;
107 Font::FONT_SHAPE getShape() const;
109 Font::FONT_SIZE getSize() const;
111 FontState getBar() const;
113 Color_color getColor() const;
115 std::string getLanguage() const;
122 /// If true the language should be reset.
123 /// If false the language of font_ is used.
127 } // namespace frontend
130 #endif // GUICHARACTER_H