]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommand.h
Collapse all those LFUN_XYZ_APPLY to a single LFUN_INSET_APPLY.
[lyx.git] / src / frontends / controllers / ControlCommand.h
1 // -*- C++ -*-
2 /**
3  * \file ControlCommand.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS
10  *
11  * ControlCommand is a controller class for dialogs that create or modify
12  * an inset derived from InsetCommand.
13  */
14
15 #ifndef CONTROLCOMMAND_H
16 #define CONTROLCOMMAND_H
17
18
19 #include "Dialog.h"
20 #include "insets/insetcommandparams.h"
21
22
23 class ControlCommand : public Dialog::Controller {
24 public:
25         /** LFUN_INSET_APPLY requires a name, "citation", "ref" etc so that
26             it knows what to do with the rest of the contents.
27             An empty name indicates that no action will occur on 'Apply'.
28          */
29         ControlCommand(Dialog &, string const & lfun_name = string());
30         ///
31         InsetCommandParams & params() { return params_; }
32         ///
33         InsetCommandParams const & params() const { return params_; }
34         ///
35         virtual void initialiseParams(string const & data);
36         /// clean-up on hide.
37         virtual void clearParams();
38         /// clean-up on hide.
39         virtual void dispatchParams();
40         ///
41         virtual bool isBufferDependent() const { return true; }
42
43 private:
44         ///
45         InsetCommandParams params_;
46         /// Flags what action is taken by Kernel::dispatch()
47         string const lfun_name_;
48 };
49
50
51 #endif // CONTROLCOMMAND_H