]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCharacter.h
Simpler structure, 2-3s faster compiles. Not that it matters much...
[lyx.git] / src / frontends / controllers / ControlCharacter.h
1 // -*- C++ -*-
2 /**
3  * \file ControlCharacter.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  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef CONTROLCHARACTER_H
13 #define CONTROLCHARACTER_H
14
15 #include "Dialog.h"
16 #include "Font.h"
17
18 namespace lyx {
19
20 class Color_color;
21
22 namespace frontend {
23
24 enum FONT_STATE {
25         ///
26         IGNORE,
27         ///
28         EMPH_TOGGLE,
29         ///
30         UNDERBAR_TOGGLE,
31         ///
32         NOUN_TOGGLE,
33         ///
34         INHERIT
35 };
36
37 class ControlCharacter : public Controller
38 {
39 public:
40         ///
41         ControlCharacter(Dialog &);
42         ///
43         ~ControlCharacter();
44         ///
45         virtual bool initialiseParams(std::string const & data);
46         ///
47         virtual void clearParams() {}
48         ///
49         virtual void dispatchParams();
50         ///
51         virtual bool isBufferDependent() const { return true; }
52         ///
53         virtual kb_action getLfun() const { return LFUN_FONT_FREE_UPDATE; }
54
55         ///
56         void setFamily(Font::FONT_FAMILY);
57         ///
58         void setSeries(Font::FONT_SERIES);
59         ///
60         void setShape(Font::FONT_SHAPE);
61         ///
62         void setSize(Font::FONT_SIZE);
63         ///
64         void setBar(FONT_STATE);
65         ///
66         void setColor(Color_color);
67         ///
68         void setLanguage(std::string const &);
69         ///
70         void setToggleAll(bool);
71
72         ///
73         Font::FONT_FAMILY getFamily() const;
74         ///
75         Font::FONT_SERIES getSeries() const;
76         ///
77         Font::FONT_SHAPE getShape() const;
78         ///
79         Font::FONT_SIZE getSize() const;
80         ///
81         FONT_STATE getBar() const;
82         ///
83         Color_color getColor() const;
84         ///
85         std::string getLanguage() const;
86         ///
87         bool getToggleAll() const;
88 private:
89         ///
90         Font * font_;
91         ///
92         bool toggleall_;
93         /// If true the language should be reset.
94         /// If false the language of font_ is used.
95         bool reset_lang_;
96 };
97
98 } // namespace frontend
99 } // namespace lyx
100
101 #endif // CONTROLCHARACTER_H