]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommand.C
Move the external dialog to the new scheme.
[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, string const & lfun_name)
21         : Dialog::Controller(dialog),
22           lfun_name_(lfun_name)
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 (lfun_name_.empty())
43                 return;
44
45         string const lfun = InsetCommandMailer::params2string(lfun_name_,
46                                                               params_);
47         kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
48 }