]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiCharacter.h
* For gcc to know about QStandardItemModel < QAbstractItemModel we need this header.
[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         //@}
70
71         ///
72         void paramsToDialog(Font const & font);
73
74         QList<FamilyPair> family;
75         QList<SeriesPair> series;
76         QList<ShapePair>  shape;
77         QList<SizePair>   size;
78         QList<BarPair>    bar;
79         QList<ColorPair>  color;
80         QList<LanguagePair> language;
81
82         ///
83         ///
84         Font font_;
85         ///
86         bool toggleall_;
87         /// If true the language should be reset.
88         /// If false the language of font_ is used.
89         bool reset_lang_;
90 };
91
92 } // namespace frontend
93 } // namespace lyx
94
95 #endif // GUICHARACTER_H