]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiCharacter.h
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / GuiCharacter.h
1 // -*- C++ -*-
2 /**
3  * \file GuiCharacter.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  * \author Edwin Leuven
9  * \author John Levon
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef GUICHARACTER_H
15 #define GUICHARACTER_H
16
17 #include "GuiDialog.h"
18 #include "ui_CharacterUi.h"
19 #include "qt_helpers.h" // for LanguagePair
20 #include "Font.h"
21
22
23 namespace lyx {
24 namespace frontend {
25
26 enum FontState {
27         ///
28         IGNORE,
29         ///
30         EMPH_TOGGLE,
31         ///
32         UNDERBAR_TOGGLE,
33         ///
34         NOUN_TOGGLE,
35         ///
36         INHERIT
37 };
38
39 typedef std::pair<QString, FontFamily> FamilyPair;
40 typedef std::pair<QString, FontFamily> FamilyPair;
41 typedef std::pair<QString, FontSeries> SeriesPair;
42 typedef std::pair<QString, FontShape>  ShapePair;
43 typedef std::pair<QString, FontSize>   SizePair;
44 typedef std::pair<QString, FontState>  BarPair;
45 typedef std::pair<QString, ColorCode>  ColorPair;
46
47 class GuiCharacter : public GuiDialog, public Ui::CharacterUi
48 {
49         Q_OBJECT
50
51 public:
52         GuiCharacter(GuiView & lv);
53
54 protected Q_SLOTS:
55         void change_adaptor();
56
57 private:
58         /// Apply changes
59         void applyView();
60         /// update
61         void updateContents();
62
63         QList<FamilyPair> family;
64         QList<SeriesPair> series;
65         QList<ShapePair>  shape;
66         QList<SizePair>   size;
67         QList<BarPair>    bar;
68         QList<ColorPair>  color;
69         QList<LanguagePair> language;
70
71         ///
72         bool initialiseParams(std::string const & data);
73         ///
74         void clearParams() {}
75         ///
76         void dispatchParams();
77         ///
78         bool isBufferDependent() const { return true; }
79         ///
80         FuncCode getLfun() const { return LFUN_FONT_FREE_UPDATE; }
81
82         ///
83         void setFamily(FontFamily);
84         ///
85         void setSeries(FontSeries);
86         ///
87         void setShape(FontShape);
88         ///
89         void setSize(FontSize);
90         ///
91         void setBar(FontState);
92         ///
93         void setColor(ColorCode);
94         ///
95         void setLanguage(QString const &);
96
97         ///
98         FontFamily getFamily() const;
99         ///
100         FontSeries getSeries() const;
101         ///
102         FontShape getShape() const;
103         ///
104         FontSize getSize() const;
105         ///
106         FontState getBar() const;
107         ///
108         ColorCode getColor() const;
109         ///
110         QString getLanguage() const;
111
112 private:
113         ///
114         Font font_;
115         ///
116         bool toggleall_;
117         /// If true the language should be reset.
118         /// If false the language of font_ is used.
119         bool reset_lang_;
120 };
121
122 } // namespace frontend
123 } // namespace lyx
124
125 #endif // GUICHARACTER_H