3 * \file ControlCommand.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
11 * ControlCommand is a controller class for dialogs that create or modify
12 * an inset derived from InsetCommand.
15 #ifndef CONTROLCOMMAND_H
16 #define CONTROLCOMMAND_H
20 #include "insets/InsetCommandParams.h"
25 class ControlCommand : public Dialog::Controller {
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
32 ControlCommand(Dialog &, std::string const & command_name,
33 std::string const & lfun_name);
35 virtual ~ControlCommand() {}
37 InsetCommandParams & params() { return params_; }
39 InsetCommandParams const & params() const { return params_; }
41 virtual bool initialiseParams(std::string const & data);
43 virtual void clearParams();
45 virtual void dispatchParams();
47 virtual bool isBufferDependent() const { return true; }
51 InsetCommandParams params_;
52 /// Flags what action is taken by Kernel::dispatch()
53 std::string const lfun_name_;
56 } // namespace frontend
59 #endif // CONTROLCOMMAND_H