]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiCharacter.h
Revert "Mark some intentional fall-throughs (in a way understandable to gcc)"
[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         XOUT_TOGGLE,
43         ///
44         UULINE_TOGGLE,
45         ///
46         UWAVE_TOGGLE,
47         ///
48         INHERIT
49 };
50
51 typedef std::pair<QString, FontFamily> FamilyPair;
52 typedef std::pair<QString, FontFamily> FamilyPair;
53 typedef std::pair<QString, FontSeries> SeriesPair;
54 typedef std::pair<QString, FontShape>  ShapePair;
55 typedef std::pair<QString, FontSize>   SizePair;
56 typedef std::pair<QString, FontState>  BarPair;
57 typedef std::pair<QString, QString>    LanguagePair;
58
59 class GuiCharacter : public GuiDialog, public Ui::CharacterUi
60 {
61         Q_OBJECT
62
63 public:
64         GuiCharacter(GuiView & lv);
65
66 protected Q_SLOTS:
67         void change_adaptor();
68
69 private:
70         /// \name Dialog inherited methods
71         //@{
72         void applyView();
73         void updateContents();
74         bool initialiseParams(std::string const & data);
75         void clearParams() {}
76         void dispatchParams();
77         bool isBufferDependent() const { return true; }
78         FuncCode getLfun() const { return LFUN_TEXTSTYLE_UPDATE; }
79         void saveSession() const;
80         void restoreSession();
81         //@}
82
83         ///
84         void paramsToDialog(Font const & font);
85
86         QList<FamilyPair> family;
87         QList<SeriesPair> series;
88         QList<ShapePair>  shape;
89         QList<SizePair>   size;
90         QList<BarPair>    bar;
91         QList<ColorCode> color;
92         QList<LanguagePair> language;
93
94         ///
95         ///
96         Font font_;
97         ///
98         bool toggleall_;
99 };
100
101 } // namespace frontend
102 } // namespace lyx
103
104 #endif // GUICHARACTER_H