]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiCharacter.h
* fix spelling in comments to please John.
[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, ColorCode>  ColorPair;
56 typedef std::pair<QString, QString>    LanguagePair;
57
58 class GuiCharacter : public GuiDialog, public Ui::CharacterUi
59 {
60         Q_OBJECT
61
62 public:
63         GuiCharacter(GuiView & lv);
64
65 protected Q_SLOTS:
66         void change_adaptor();
67
68 private:
69         /// \name Dialog inherited methods
70         //@{
71         void applyView();
72         void updateContents();
73         bool initialiseParams(std::string const & data);
74         void clearParams() {}
75         void dispatchParams();
76         bool isBufferDependent() const { return true; }
77         FuncCode getLfun() const { return LFUN_TEXTSTYLE_UPDATE; }
78         void saveSession() const;
79         void restoreSession();
80         //@}
81
82         ///
83         void paramsToDialog(Font const & font);
84
85         QList<FamilyPair> family;
86         QList<SeriesPair> series;
87         QList<ShapePair>  shape;
88         QList<SizePair>   size;
89         QList<BarPair>    bar;
90         QList<ColorPair>  color;
91         QList<LanguagePair> language;
92
93         ///
94         ///
95         Font font_;
96         ///
97         bool toggleall_;
98         /// If true the language should be reset.
99         /// If false the language of font_ is used.
100         bool reset_lang_;
101 };
102
103 } // namespace frontend
104 } // namespace lyx
105
106 #endif // GUICHARACTER_H