]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiCharacter.h
02cd2feca4280932a818d6bf2e4335161b839a11
[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 "Font.h"
20
21 #include <utility>
22
23 #ifdef IGNORE
24 #undef IGNORE
25 #endif
26
27 namespace lyx {
28 namespace frontend {
29
30 enum FontState {
31         ///
32         IGNORE,
33         ///
34         EMPH_TOGGLE,
35         ///
36         UNDERBAR_TOGGLE,
37         ///
38         NOUN_TOGGLE,
39         ///
40         STRIKEOUT_TOGGLE,
41         ///
42         INHERIT
43 };
44
45 typedef std::pair<QString, FontFamily> FamilyPair;
46 typedef std::pair<QString, FontFamily> FamilyPair;
47 typedef std::pair<QString, FontSeries> SeriesPair;
48 typedef std::pair<QString, FontShape>  ShapePair;
49 typedef std::pair<QString, FontSize>   SizePair;
50 typedef std::pair<QString, FontState>  BarPair;
51 typedef std::pair<QString, ColorCode>  ColorPair;
52 typedef std::pair<QString, QString>    LanguagePair;
53
54 class GuiCharacter : public GuiDialog, public Ui::CharacterUi
55 {
56         Q_OBJECT
57
58 public:
59         GuiCharacter(GuiView & lv);
60
61 protected Q_SLOTS:
62         void change_adaptor();
63
64 private:
65         /// Dialog inherited methods
66         //@{
67         void applyView();
68         void updateContents();
69         bool initialiseParams(std::string const & data);
70         void clearParams() {}
71         void dispatchParams();
72         bool isBufferDependent() const { return true; }
73         FuncCode getLfun() const { return LFUN_TEXTSTYLE_UPDATE; }
74         void saveSession() const;
75         void restoreSession();
76         //@}
77
78         ///
79         void paramsToDialog(Font const & font);
80
81         QList<FamilyPair> family;
82         QList<SeriesPair> series;
83         QList<ShapePair>  shape;
84         QList<SizePair>   size;
85         QList<BarPair>    bar;
86         QList<ColorPair>  color;
87         QList<LanguagePair> language;
88
89         ///
90         ///
91         Font font_;
92         ///
93         bool toggleall_;
94         /// If true the language should be reset.
95         /// If false the language of font_ is used.
96         bool reset_lang_;
97 };
98
99 } // namespace frontend
100 } // namespace lyx
101
102 #endif // GUICHARACTER_H