]> git.lyx.org Git - features.git/blob - src/frontends/controllers/ControlCommand.h
This is the first part of a cleanup of how we handle the InsetCommand hierarchy....
[features.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 namespace lyx {
23 namespace frontend {
24
25 class ControlCommand : public Controller {
26 public:
27         /// We need to know with what sort of inset we're associated.
28         ControlCommand(Dialog &, std::string const & insetType);
29         ///
30         virtual ~ControlCommand() {}
31         ///
32         InsetCommandParams & params() { return params_; }
33         ///
34         InsetCommandParams const & params() const { return params_; }
35         ///
36         virtual bool initialiseParams(std::string const & data);
37         /// clean-up on hide.
38         virtual void clearParams();
39         /// clean-up on hide.
40         virtual void dispatchParams();
41         ///
42         virtual bool isBufferDependent() const { return true; }
43
44 private:
45         ///
46         InsetCommandParams params_;
47         //FIXME It should be possible to eliminate lfun_name_
48         //now and recover that information from params().insetType().
49         //But let's not do that quite yet.
50         /// Flags what action is taken by Kernel::dispatch()
51         std::string const lfun_name_;
52 };
53
54 } // namespace frontend
55 } // namespace lyx
56
57 #endif // CONTROLCOMMAND_H