]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlBox.C
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / controllers / ControlBox.C
1 /**
2  * \file ControlBox.C
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 "insets/insetbox.h"
16 #include "gettext.h"
17
18
19 using std::string;
20 using std::vector;
21
22 namespace lyx {
23 namespace frontend {
24
25 ControlBox::ControlBox(Dialog & parent)
26         : Dialog::Controller(parent)
27 {}
28
29
30 bool ControlBox::initialiseParams(string const & data)
31 {
32         InsetBoxParams params("");
33         InsetBoxMailer::string2params(data, params);
34         params_.reset(new InsetBoxParams(params));
35
36         return true;
37
38 }
39
40
41 void ControlBox::clearParams()
42 {
43         params_.reset();
44 }
45
46
47 void ControlBox::dispatchParams()
48 {
49         string const lfun = InsetBoxMailer::params2string(params());
50         kernel().dispatch(FuncRequest(getLfun(), lfun));
51 }
52
53
54 void box_gui_tokens(vector<string> & ids, vector<string> & gui_names)
55 {
56         char const * const ids_[] = {
57                 "Frameless", "Boxed", "ovalbox",
58                 "Ovalbox", "Shadowbox", "Doublebox"};
59         size_t const ids_size = sizeof(ids_) / sizeof(char *);
60         ids = vector<string>(ids_, ids_ + ids_size);
61         gui_names.clear();
62         // FIXME UNICODE
63         gui_names.push_back(lyx::to_utf8(_("No frame drawn")));
64         gui_names.push_back(lyx::to_utf8(_("Rectangular box")));
65         gui_names.push_back(lyx::to_utf8(_("Oval box, thin")));
66         gui_names.push_back(lyx::to_utf8(_("Oval box, thick")));
67         gui_names.push_back(lyx::to_utf8(_("Shadow box")));
68         gui_names.push_back(lyx::to_utf8(_("Double box")));
69 }
70
71 void box_gui_tokens_special_length(vector<string> & ids,
72         vector<string> & gui_names)
73 {
74         char const * const ids_[] = {
75                 "none", "height", "depth",
76                 "totalheight", "width"};
77         size_t const ids_size = sizeof(ids_) / sizeof(char *);
78         ids = vector<string>(ids_, ids_ + ids_size);
79         gui_names.clear();
80         // FIXME UNICODE
81         gui_names.push_back(lyx::to_utf8(_("None")));
82         gui_names.push_back(lyx::to_utf8(_("Height")));
83         gui_names.push_back(lyx::to_utf8(_("Depth")));
84         gui_names.push_back(lyx::to_utf8(_("Total Height")));
85         gui_names.push_back(lyx::to_utf8(_("Width")));
86 }
87
88 } // namespace frontend
89 } // namespace lyx