]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommand.C
Hold on to your hats.
[lyx.git] / src / frontends / controllers / ControlCommand.C
1 /**
2  * \file ControlCommand.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 "ControlCommand.h"
14 #include "Kernel.h"
15
16 #include "funcrequest.h"
17 #include "insets/insetcommand.h"
18
19
20 ControlCommand::ControlCommand(Dialog & dialog, kb_action ac)
21         : Dialog::Controller(dialog),
22           action_(ac)
23 {}
24
25
26 void ControlCommand::initialiseParams(string const & data)
27 {
28         InsetCommandMailer::string2params(data, params_);
29 }
30
31
32 void ControlCommand::clearParams()
33 {
34         params_.setCmdName(string());
35         params_.setOptions(string());
36         params_.setContents(string());
37 }
38
39
40 void ControlCommand::dispatchParams()
41 {
42         if (action_ == LFUN_NOACTION)
43                 return;
44
45         FuncRequest fr(action_, InsetCommandMailer::params2string(params_));
46         kernel().dispatch(fr);
47 }