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