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