]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlNote.C
Martin's changes to the Note inset.
[lyx.git] / src / frontends / controllers / ControlNote.C
1 /**
2  * \file ControlNote.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13 #include "ControlNote.h"
14 #include "funcrequest.h"
15 #include "insets/insetnote.h"
16 #include "debug.h"
17 #include "gettext.h"
18
19
20 using std::vector;
21
22
23 ControlNote::ControlNote(Dialog & parent)
24         : Dialog::Controller(parent)
25 {}
26
27
28 bool ControlNote::initialiseParams(string const & data)
29 {
30     InsetNoteParams params;
31         InsetNoteMailer::string2params(data, params);
32         params_.reset(new InsetNoteParams(params));
33         
34         return true;
35
36 }
37
38
39 void ControlNote::clearParams()
40 {
41         params_.reset();
42 }
43
44
45 void ControlNote::dispatchParams()
46 {
47         string const lfun = InsetNoteMailer::params2string(string("note"), params());
48         kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
49 }
50
51
52 void note_gui_tokens(vector<string> & ids, vector<string> & gui_names)
53 {
54         char const * const ids_[] = {"Note", "Comment", "Greyedout"};
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(_("LyX Note"));
59         gui_names.push_back(_("Comment"));
60         gui_names.push_back(_("Greyed Out"));
61 }