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.
|
2001-03-22 11:24:36 +00:00
|
|
|
*
|
|
|
|
* 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.
|
2002-03-21 21:21:28 +00:00
|
|
|
*
|
2001-03-15 13:37:04 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONTROLCOMMAND_H
|
|
|
|
#define CONTROLCOMMAND_H
|
|
|
|
|
|
|
|
|
2001-03-23 17:09:34 +00:00
|
|
|
#include "ControlInset.h"
|
2001-03-15 13:37:04 +00:00
|
|
|
#include "insets/insetcommand.h"
|
|
|
|
#include "commandtags.h" // kb_action
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
/** The Inset dialog controller. Connects/disconnects signals, launches
|
2001-03-15 13:37:04 +00:00
|
|
|
GUI-dependent View and returns the output from this View to the kernel.
|
|
|
|
*/
|
2002-10-21 17:38:09 +00:00
|
|
|
class ControlCommand
|
|
|
|
: public ControlInset<InsetCommand, InsetCommandParams>
|
2001-03-15 13:37:04 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
ControlCommand(LyXView &, Dialogs &, kb_action=LFUN_NOACTION);
|
|
|
|
private:
|
2001-03-23 17:09:34 +00:00
|
|
|
/// Dispatch the changed parameters to the kernel.
|
|
|
|
virtual void applyParamsToInset();
|
2002-03-21 21:21:28 +00:00
|
|
|
///
|
2001-03-23 17:09:34 +00:00
|
|
|
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 &);
|
|
|
|
|
2001-03-15 13:37:04 +00:00
|
|
|
/// Controls what is done in LyXFunc::Dispatch()
|
|
|
|
kb_action const action_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // CONTROLCOMMAND_H
|