2001-06-13 14:33:31 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-05 14:10:50 +00:00
|
|
|
/**
|
|
|
|
* \file ControlCommand.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-03-15 13:37:04 +00:00
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
* \author Angus Leeming
|
2001-03-15 13:37:04 +00:00
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
* Full author contact details are available in file CREDITS
|
2001-03-15 13:37:04 +00:00
|
|
|
*
|
2001-03-22 11:24:36 +00:00
|
|
|
* ControlCommand is a controller class for dialogs that create or modify
|
2001-03-15 13:37:04 +00:00
|
|
|
* an inset derived from InsetCommand.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONTROLCOMMAND_H
|
|
|
|
#define CONTROLCOMMAND_H
|
|
|
|
|
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
#include "Dialog.h"
|
|
|
|
#include "insets/insetcommandparams.h"
|
2001-03-15 13:37:04 +00:00
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
|
|
|
|
class ControlCommand : public Dialog::Controller {
|
2001-03-15 13:37:04 +00:00
|
|
|
public:
|
2003-02-27 13:26:07 +00:00
|
|
|
/** 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());
|
2002-03-21 21:21:28 +00:00
|
|
|
///
|
2003-02-25 14:51:38 +00:00
|
|
|
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; }
|
2001-03-23 17:09:34 +00:00
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
private:
|
|
|
|
///
|
|
|
|
InsetCommandParams params_;
|
|
|
|
/// Flags what action is taken by Kernel::dispatch()
|
2003-02-27 13:26:07 +00:00
|
|
|
string const lfun_name_;
|
2001-03-15 13:37:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // CONTROLCOMMAND_H
|