X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2FControlCommand.h;h=4a87e106855e94ab0ae2ec66567ee196297f873d;hb=b7c9ae49318e0167a46e7213c967280205db4cf6;hp=709c73fbb18879a485ea7baa18282e8af4fcd3a3;hpb=0c2a3e5960f032dcd8be726e3e63628207a06dd3;p=lyx.git diff --git a/src/frontends/controllers/ControlCommand.h b/src/frontends/controllers/ControlCommand.h index 709c73fbb1..4a87e10685 100644 --- a/src/frontends/controllers/ControlCommand.h +++ b/src/frontends/controllers/ControlCommand.h @@ -1,57 +1,50 @@ // -*- C++ -*- -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 2001 The LyX Team. +/** + * \file ControlCommand.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * ====================================================== + * \author Angus Leeming * - * \file ControlCommand.h - * \author Angus Leeming + * Full author contact details are available in file CREDITS * * 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 -#ifdef __GNUG__ -#pragma interface -#endif -#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()); + /// + InsetCommandParams & params() { return params_; } + /// + InsetCommandParams const & params() const { return params_; } /// - ControlCommand(LyXView &, Dialogs &, kb_action=LFUN_NOACTION); + 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_; };