mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
2805c29734
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15023 a592a061-630c-0410-9148-cb99ea01b6c8
77 lines
1.7 KiB
C++
77 lines
1.7 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file math_macrotemplate.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Alejandro Aguilar Sierra
|
|
* \author André Pönitz
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef MATH_MACROTEMPLATE_H
|
|
#define MATH_MACROTEMPLATE_H
|
|
|
|
#include "math_data.h"
|
|
#include "math_macrotable.h"
|
|
#include "math_nestinset.h"
|
|
|
|
#include "support/types.h"
|
|
|
|
/// This class contains the macro definition.
|
|
class MathMacroTemplate : public InsetMathNest {
|
|
public:
|
|
///
|
|
MathMacroTemplate();
|
|
///
|
|
MathMacroTemplate(std::string const & name, int nargs,
|
|
std::string const & type,
|
|
MathArray const & = MathArray(),
|
|
MathArray const & = MathArray());
|
|
///
|
|
explicit MathMacroTemplate(std::istream & is);
|
|
///
|
|
void edit(LCursor & cur, bool left);
|
|
///
|
|
EDITABLE editable() const { return HIGHLY_EDITABLE; }
|
|
///
|
|
void read(Buffer const &, LyXLex & lex);
|
|
///
|
|
void write(Buffer const &, std::ostream & os) const;
|
|
///
|
|
void write(WriteStream & os) const;
|
|
/// Number of arguments
|
|
int numargs() const;
|
|
///
|
|
void numargs(int);
|
|
///
|
|
std::string name() const;
|
|
///
|
|
MacroData asMacroData() const;
|
|
///
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
|
///
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
|
/// identifies macro templates
|
|
MathMacroTemplate * asMacroTemplate() { return this; }
|
|
/// identifies macro templates
|
|
MathMacroTemplate const * asMacroTemplate() const { return this; }
|
|
///
|
|
InsetBase::Code lyxCode() const { return MATHMACRO_CODE; }
|
|
|
|
private:
|
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
|
/// prefix in inset
|
|
lyx::docstring prefix() const;
|
|
|
|
///
|
|
int numargs_;
|
|
///
|
|
std::string name_;
|
|
/// newcommand or renewcommand or def
|
|
std::string type_;
|
|
};
|
|
|
|
#endif
|