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