2001-06-13 14:33:31 +00:00
|
|
|
// -*- C++ -*-
|
2001-03-15 13:37:04 +00:00
|
|
|
/* This file is part of
|
2002-03-21 21:21:28 +00:00
|
|
|
* ======================================================
|
2001-03-15 13:37:04 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2001-03-21 13:27:03 +00:00
|
|
|
* Copyright 2001 The LyX Team.
|
2001-03-15 13:37:04 +00:00
|
|
|
*
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* \file ControlCommand.h
|
2002-08-15 16:02:22 +00:00
|
|
|
* \author Angus Leeming <leeming@lyx.org>
|
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
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
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.
|
|
|
|
*/
|
2001-03-23 17:09:34 +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
|