]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlBox.cpp
Simpler structure, 2-3s faster compiles. Not that it matters much...
[lyx.git] / src / frontends / controllers / ControlBox.cpp
1 /**
2  * \file ControlBox.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Martin Vermeer (with useful hints from Angus Leeming)
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "ControlBox.h"
14 #include "FuncRequest.h"
15 #include "gettext.h"
16
17
18 using std::string;
19 using std::vector;
20
21 namespace lyx {
22 namespace frontend {
23
24 ControlBox::ControlBox(Dialog & parent)
25         : Controller(parent), params_("")
26 {}
27
28
29 bool ControlBox::initialiseParams(string const & data)
30 {
31         InsetBoxMailer::string2params(data, params_);
32         return true;
33
34 }
35
36
37 void ControlBox::clearParams()
38 {
39         params_ = InsetBoxParams("");
40 }
41
42
43 void ControlBox::dispatchParams()
44 {
45         string const lfun = InsetBoxMailer::params2string(params());
46         dispatch(FuncRequest(getLfun(), lfun));
47 }
48
49
50 void box_gui_tokens(vector<string> & ids, vector<docstring> & gui_names)
51 {
52         char const * const ids_[] = {
53                 "Frameless", "Boxed", "ovalbox",
54                 "Ovalbox", "Shadowbox", "Doublebox"};
55         size_t const ids_size = sizeof(ids_) / sizeof(char *);
56         ids = vector<string>(ids_, ids_ + ids_size);
57         gui_names.clear();
58         gui_names.push_back(_("No frame drawn"));
59         gui_names.push_back(_("Rectangular box"));
60         gui_names.push_back(_("Oval box, thin"));
61         gui_names.push_back(_("Oval box, thick"));
62         gui_names.push_back(_("Shadow box"));
63         gui_names.push_back(_("Double box"));
64 }
65
66 void box_gui_tokens_special_length(vector<string> & ids,
67         vector<docstring> & gui_names)
68 {
69         char const * const ids_[] = {
70                 "none", "height", "depth",
71                 "totalheight", "width"};
72         size_t const ids_size = sizeof(ids_) / sizeof(char *);
73         ids = vector<string>(ids_, ids_ + ids_size);
74         gui_names.clear();
75         gui_names.push_back(_("None"));
76         gui_names.push_back(_("Height"));
77         gui_names.push_back(_("Depth"));
78         gui_names.push_back(_("Total Height"));
79         gui_names.push_back(_("Width"));
80 }
81
82 } // namespace frontend
83 } // namespace lyx