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
|
|
|
*
|
2003-08-23 00:17:00 +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"
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "insets/InsetCommandParams.h"
|
2001-03-15 13:37:04 +00:00
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
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.
|
Rework InsetCommandParams interface and file storage
* src/insets/insetcommandparams.[Ch]:
(operator[]): New, access a parameter
(clear): New, clear all parameters
(info_): New, stire info about this command
(cmdname): Rename to name_
(contents, options, sec_options): Replace with params_. Parameters
are now stored as docstring.
(findInfo): New factor for command info for all commands
(read, write): Use new syntax
(parameter set and get methods): reimplemenmt for new parameter storage
* src/insets/insetcommand.h
(getParam): New, get a parameter
(setParam): New, set a parameter
(parameter set and get methods): Adjust to InsetCommandParams changes
* src/insets/insetbibitem.[Ch]
(write): Remove, not needed anymore
(directWrite): ditto
* src/insets/insetbibitem.C
(InsetBibitem::read): Use InsetCommand::read
* src/insets/insetref.C
(InsetRef::latex): Use new InsetCommandParams interface
* src/mathed/InsetMathHull.C
(InsetMathHull::doDispatch): ditto
* src/text3.C
(LyXText::dispatch): ditto
* src/factory.C
(createInset): Create InsetCommandParams with command name
(readInset): ditto
(readInset): Remove error message for bibitem, since bibitem is
now a normal command inset
* src/buffer.C: Bump file format number
* src/frontends/controllers/ControlCommand.[Ch]
(ControlCommand): take an additional command name parameter
* src/text.C
(readParToken): Remove code for \bibitem
* lib/lyx2lyx/LyX.py: Bump latest file format number
* lib/lyx2lyx/lyx_1_5.py
(convert_bibitem, convert_commandparams): new, convert to new format
(revert_commandparams): new, convert to old format
* development/FORMAT: document new format
* many other files: Adjust to the changes above
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15357 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-17 21:07:16 +00:00
|
|
|
An empty \p lfun_name indicates that no action will occur on
|
|
|
|
'Apply'.
|
2003-02-27 13:26:07 +00:00
|
|
|
*/
|
Rework InsetCommandParams interface and file storage
* src/insets/insetcommandparams.[Ch]:
(operator[]): New, access a parameter
(clear): New, clear all parameters
(info_): New, stire info about this command
(cmdname): Rename to name_
(contents, options, sec_options): Replace with params_. Parameters
are now stored as docstring.
(findInfo): New factor for command info for all commands
(read, write): Use new syntax
(parameter set and get methods): reimplemenmt for new parameter storage
* src/insets/insetcommand.h
(getParam): New, get a parameter
(setParam): New, set a parameter
(parameter set and get methods): Adjust to InsetCommandParams changes
* src/insets/insetbibitem.[Ch]
(write): Remove, not needed anymore
(directWrite): ditto
* src/insets/insetbibitem.C
(InsetBibitem::read): Use InsetCommand::read
* src/insets/insetref.C
(InsetRef::latex): Use new InsetCommandParams interface
* src/mathed/InsetMathHull.C
(InsetMathHull::doDispatch): ditto
* src/text3.C
(LyXText::dispatch): ditto
* src/factory.C
(createInset): Create InsetCommandParams with command name
(readInset): ditto
(readInset): Remove error message for bibitem, since bibitem is
now a normal command inset
* src/buffer.C: Bump file format number
* src/frontends/controllers/ControlCommand.[Ch]
(ControlCommand): take an additional command name parameter
* src/text.C
(readParToken): Remove code for \bibitem
* lib/lyx2lyx/LyX.py: Bump latest file format number
* lib/lyx2lyx/lyx_1_5.py
(convert_bibitem, convert_commandparams): new, convert to new format
(revert_commandparams): new, convert to old format
* development/FORMAT: document new format
* many other files: Adjust to the changes above
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15357 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-17 21:07:16 +00:00
|
|
|
ControlCommand(Dialog &, std::string const & command_name,
|
2007-05-28 22:27:45 +00:00
|
|
|
std::string const & lfun_name);
|
2002-03-21 21:21:28 +00:00
|
|
|
///
|
2007-03-16 20:31:29 +00:00
|
|
|
virtual ~ControlCommand() {}
|
|
|
|
///
|
2003-02-25 14:51:38 +00:00
|
|
|
InsetCommandParams & params() { return params_; }
|
|
|
|
///
|
|
|
|
InsetCommandParams const & params() const { return params_; }
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual bool initialiseParams(std::string const & data);
|
2003-02-25 14:51:38 +00:00
|
|
|
/// 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-10-06 15:43:21 +00:00
|
|
|
std::string const lfun_name_;
|
2001-03-15 13:37:04 +00:00
|
|
|
};
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2001-03-15 13:37:04 +00:00
|
|
|
|
|
|
|
#endif // CONTROLCOMMAND_H
|