X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2FControlCommand.h;h=4a87e106855e94ab0ae2ec66567ee196297f873d;hb=b7c9ae49318e0167a46e7213c967280205db4cf6;hp=9603419cc48d7f8597caae8d5d9ea61a1630f226;hpb=99d1627a471b92f403598d03dfc861ddc3c11be0;p=lyx.git diff --git a/src/frontends/controllers/ControlCommand.h b/src/frontends/controllers/ControlCommand.h index 9603419cc4..4a87e10685 100644 --- a/src/frontends/controllers/ControlCommand.h +++ b/src/frontends/controllers/ControlCommand.h @@ -10,42 +10,41 @@ * * ControlCommand is a controller class for dialogs that create or modify * an inset derived from InsetCommand. - * - * The class is likely to be changed as other Inset controllers are created - * and it becomes clear just what functionality can be moved back into - * ControlInset. - * */ #ifndef CONTROLCOMMAND_H #define CONTROLCOMMAND_H -#include "ControlInset.h" -#include "insets/insetcommand.h" -#include "commandtags.h" // kb_action +#include "Dialog.h" +#include "insets/insetcommandparams.h" -/** The Inset dialog controller. Connects/disconnects signals, launches - GUI-dependent View and returns the output from this View to the kernel. - */ -class ControlCommand - : public ControlInset -{ + +class ControlCommand : public Dialog::Controller { public: + /** LFUN_INSET_APPLY requires a name, "citation", "ref" etc so that + it knows what to do with the rest of the contents. + An empty name indicates that no action will occur on 'Apply'. + */ + ControlCommand(Dialog &, string const & lfun_name = string()); /// - ControlCommand(LyXView &, Dialogs &, kb_action=LFUN_NOACTION); + InsetCommandParams & params() { return params_; } + /// + InsetCommandParams const & params() const { return params_; } + /// + virtual void initialiseParams(string const & data); + /// clean-up on hide. + virtual void clearParams(); + /// clean-up on hide. + virtual void dispatchParams(); + /// + virtual bool isBufferDependent() const { return true; } + private: - /// Dispatch the changed parameters to the kernel. - virtual void applyParamsToInset(); /// - virtual void applyParamsNoInset(); - /// get the parameters from the string passed to createInset. - virtual InsetCommandParams const getParams(string const &); - /// get the parameters from the inset passed to showInset. - virtual InsetCommandParams const getParams(InsetCommand const &); - - /// Controls what is done in LyXFunc::Dispatch() - kb_action const action_; + InsetCommandParams params_; + /// Flags what action is taken by Kernel::dispatch() + string const lfun_name_; };