lyx_mirror/src/mathed/InsetFormulaMacro.h
Abdelrazak Younes ff4460603e Make Buffer argument mandatory in most of the InsetMath based class... boring work...
Math manual loads and save correctly it seems but expect some instability period.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31898 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-08 11:45:46 +00:00

78 lines
1.7 KiB
C++

// -*- C++ -*-
/**
* \file InsetFormulaMacro.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 INSET_FORMULA_MACRO_H
#define INSET_FORMULA_MACRO_H
#include "InsetMathNest.h"
namespace lyx {
class MathMacroTemplate;
class Lexer;
// An InsetFormulaMacro only knows its name and asks the global
// MathMacroTable if it needs to know more.
/// Main LyX Inset for defining math macros
class InsetFormulaMacro : public InsetMathNest {
public:
///
InsetFormulaMacro(Buffer * buf);
/// construct a macro hull from its name and the number of arguments
InsetFormulaMacro(Buffer * buf, docstring const & name, int nargs, docstring const & t);
/// constructs a mocro from its LaTeX definition
explicit InsetFormulaMacro(docstring const & s);
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///
void draw(PainterInfo & pi, int x, int y) const;
///
void read(Lexer & lex);
///
void write(std::ostream & os) const;
///
int latex(odocstream & os, OutputParams const &) const;
///
int plaintext(odocstream &, OutputParams const &) const;
///
int docbook(odocstream &, OutputParams const &) const;
///
InsetCode lyxCode() const { return MATHMACRO_CODE_CODE; }
///
docstring const & getInsetName() const { return name_; }
///
bool editable() const { return true; }
///
InsetCode lyxCode() const { return MATH_FORMULA_MACRO_CODE; }
private:
///
MathAtom & tmpl() const;
///
void read(std::istream & is);
/// prefix in inset
docstring prefix() const;
///
docstring name_;
///
Inset * clone() const;
};
} // namespace lyx
#endif