]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCharacter.h
b593c83c52643b6445e3f7aff5d3afcebdccb357
[lyx.git] / src / frontends / controllers / ControlCharacter.h
1 /**
2  * \file ControlCharacter.h
3  * Copyright 2001 The LyX Team.
4  * See the file COPYING.
5  *
6  * \author Angus Leeming, a.leeming@.ac.uk
7  */
8
9 #ifndef CONTROLCHARACTER_H
10 #define CONTROLCHARACTER_H
11
12 #ifdef __GNUG__
13 #pragma interface
14 #endif
15
16 #include "ControlDialogs.h"
17 #include "lyxfont.h"
18 #include "LColor.h"
19
20 /** A controller for Character dialogs.
21  */
22 class ControlCharacter : public ControlDialog<ControlConnectBD>
23 {
24 public:
25         ///
26         enum FONT_STATE {
27                 ///
28                 IGNORE,
29                 ///
30                 EMPH_TOGGLE,
31                 ///
32                 UNDERBAR_TOGGLE,
33                 ///
34                 NOUN_TOGGLE,
35                 ///
36                 LATEX_TOGGLE,
37                 ///
38                 INHERIT
39         };
40         
41         ///
42         typedef std::pair<string, LyXFont::FONT_FAMILY> FamilyPair;
43         ///
44         typedef std::pair<string, LyXFont::FONT_SERIES> SeriesPair;
45         ///
46         typedef std::pair<string, LyXFont::FONT_SHAPE>  ShapePair;
47         ///
48         typedef std::pair<string, LyXFont::FONT_SIZE>   SizePair;
49         ///
50         typedef std::pair<string, FONT_STATE> BarPair;
51         ///
52         typedef std::pair<string, LColor::color> ColorPair;
53
54         ///
55         ControlCharacter(LyXView &, Dialogs &);
56
57         ///
58         void setFamily(LyXFont::FONT_FAMILY);
59         ///
60         void setSeries(LyXFont::FONT_SERIES);
61         ///
62         void setShape(LyXFont::FONT_SHAPE);
63         ///
64         void setSize(LyXFont::FONT_SIZE);
65         ///
66         void setBar(FONT_STATE);
67         ///
68         void setColor(LColor::color);
69         ///
70         void setLanguage(string const &);
71         ///
72         void setToggleAll(bool);
73
74 private:
75         /// Get changed parameters and Dispatch them to the kernel.
76         virtual void apply();
77         /// set the params before show or update.
78         virtual void setParams();
79         /// clean-up on hide.
80         virtual void clearParams();
81
82         ///
83         LyXFont * font_;
84         ///
85         bool toggleall_;
86 };
87
88 /// Helper functions
89 std::vector<ControlCharacter::FamilyPair> const getFamilyData();
90 ///
91 std::vector<ControlCharacter::SeriesPair> const getSeriesData();
92 ///
93 std::vector<ControlCharacter::ShapePair>  const getShapeData();
94 ///
95 std::vector<ControlCharacter::SizePair>   const getSizeData();
96 ///
97 std::vector<ControlCharacter::BarPair>    const getBarData();
98 ///
99 std::vector<ControlCharacter::ColorPair>  const getColorData();
100 ///
101 std::vector<string> const getLanguageData();
102
103 #endif // CONTROLCHARACTER_H