]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommand.C
Really dull and boring header shit
[lyx.git] / src / frontends / controllers / ControlCommand.C
1 /**
2  * \file ControlCommand.C
3  * Read the file COPYING
4  *
5  * \author Angus Leeming
6  *
7  * Full author contact details are available in file CREDITS
8  */
9
10 #include <config.h>
11
12 #ifdef __GNUG__
13 #pragma implementation
14 #endif
15
16 #include "ControlCommand.h"
17
18 #include "BufferView.h"
19 #include "funcrequest.h"
20 #include "lyxfunc.h"
21
22
23 ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac)
24         : ControlInset<InsetCommand, InsetCommandParams>(lv, d),
25           action_(ac)
26 {}
27
28
29 InsetCommandParams const ControlCommand::getParams(string const & arg)
30 {
31         InsetCommandParams params;
32         params.setFromString(arg);
33         return params;
34 }
35
36
37 InsetCommandParams const ControlCommand::getParams(InsetCommand const & inset)
38 {
39         return inset.params();
40 }
41
42
43 void ControlCommand::applyParamsToInset()
44 {
45         inset()->setParams(params());
46         bufferview()->updateInset(inset(), true);
47 }
48
49
50 void ControlCommand::applyParamsNoInset()
51 {
52         if (action_ == LFUN_NOACTION)
53                 return;
54         lyxfunc().dispatch(FuncRequest(action_, params().getAsString()));
55 }