]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommand.C
Nothing but a changed email address (trying to factor my tree in in small steps)
[lyx.git] / src / frontends / controllers / ControlCommand.C
1 /* This file is part of
2  * ======================================================
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \file ControlCommand.C
11  * \author Angus Leeming <leeming@lyx.org>
12  */
13
14 #include <config.h>
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif
19
20 #include "ControlCommand.h"
21
22 #include "BufferView.h"
23 #include "funcrequest.h"
24 #include "lyxfunc.h"
25
26
27 ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac)
28         : ControlInset<InsetCommand, InsetCommandParams>(lv, d),
29           action_(ac)
30 {}
31
32
33 InsetCommandParams const ControlCommand::getParams(string const & arg)
34 {
35         InsetCommandParams params;
36         params.setFromString(arg);
37         return params;
38 }
39
40
41 InsetCommandParams const ControlCommand::getParams(InsetCommand const & inset)
42 {
43         return inset.params();
44 }
45
46
47 void ControlCommand::applyParamsToInset()
48 {
49         inset()->setParams(params());
50         bufferview()->updateInset(inset(), true);
51 }
52
53
54 void ControlCommand::applyParamsNoInset()
55 {
56         if (action_ == LFUN_NOACTION)
57                 return;
58         lyxfunc().dispatch(FuncRequest(action_, params().getAsString()));
59 }