]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommand.h
fix scrolling bug: 3320 and 3652, maybe not perfect
[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 namespace lyx {
23 namespace frontend {
24
25 class ControlCommand : public Dialog::Controller {
26 public:
27         /** LFUN_INSET_APPLY requires a name, "citation", "ref" etc so that
28             it knows what to do with the rest of the contents.
29             An empty \p lfun_name indicates that no action will occur on
30             'Apply'.
31          */
32         ControlCommand(Dialog &, std::string const & command_name,
33                        std::string const & lfun_name);
34         ///
35         virtual ~ControlCommand() {}
36         ///
37         InsetCommandParams & params() { return params_; }
38         ///
39         InsetCommandParams const & params() const { return params_; }
40         ///
41         virtual bool initialiseParams(std::string const & data);
42         /// clean-up on hide.
43         virtual void clearParams();
44         /// clean-up on hide.
45         virtual void dispatchParams();
46         ///
47         virtual bool isBufferDependent() const { return true; }
48
49 private:
50         ///
51         InsetCommandParams params_;
52         /// Flags what action is taken by Kernel::dispatch()
53         std::string const lfun_name_;
54 };
55
56 } // namespace frontend
57 } // namespace lyx
58
59 #endif // CONTROLCOMMAND_H