lyx_mirror/src/mathed/MathMacro.h
Bo Peng e36fba33ab Last (?) batch of renames:
src/frontends/Alert.h src/frontends/alert.h
src/frontends/Alert.cpp src/frontends/alert.cpp
src/frontends/Alert_pimpl.cpp src/frontends/alert_pimpl.cpp
src/frontends/qt4/Alert_pimpl.cpp src/frontends/qt4/alert_pimpl.cpp
src/frontends/controllers/ButtonPolicies.cpp src/frontends/controllers/ButtonPolicy.cpp
src/frontends/controllers/ButtonPolicies.h src/frontends/controllers/ButtonPolicy.h
src/insets/InsetEnv.cpp src/insets/InsetEnvironment.cpp
src/insets/InsetEnv.h src/insets/InsetEnvironment.h
src/mathed/MathMacroTable.h src/mathed/MacroTable.h
src/mathed/MathMacroTable.cpp src/mathed/MacroTable.cpp
src/lyx_cb.h src/callback.h
src/lyx_cb.cpp src/callback.cpp
src/UpdateFlags.h src/update_flags.h


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18076 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-28 20:44:46 +00:00

91 lines
2.1 KiB
C++

// -*- C++ -*-
/**
* \file MathMacro.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_MACRO_H
#define MATH_MACRO_H
#include "InsetMathNest.h"
#include "MathData.h"
#include "InsetMathNest.h"
#include "MacroTable.h"
namespace lyx {
/// This class contains the data for a macro.
class MathMacro : public InsetMathNest {
public:
/// A macro can be built from an existing template
MathMacro(docstring const & name, int numargs);
///
void draw(PainterInfo & pi, int x, int y) const;
///
void drawExpanded(PainterInfo & pi, int x, int y) const;
/// draw selection background
void drawSelection(PainterInfo & pi, int x, int y) const;
/// draw decorations.
void drawDecoration(PainterInfo & pi, int x, int y) const
{ drawMarkers2(pi, x, y); }
///
bool metrics(MetricsInfo & mi, Dimension & dim) const;
/// get cursor position
void cursorPos(BufferView const & bv, CursorSlice const & sl,
bool boundary, int & x, int & y) const;
///
InsetBase * editXY(Cursor & cur, int x, int y);
/// target pos when we enter the inset from the left by pressing "Right"
bool idxFirst(Cursor &) const;
/// target pos when we enter the inset from the right by pressing "Left"
bool idxLast(Cursor &) const;
///
virtual bool notifyCursorLeaves(Cursor &);
///
docstring name() const;
///
void setExpansion(MathData const & exp, MathData const & args) const;
///
void validate(LaTeXFeatures &) const;
///
void maple(MapleStream &) const;
///
void mathmlize(MathStream &) const;
///
void octave(OctaveStream &) const;
///
void infoize(odocstream &) const;
///
void infoize2(odocstream &) const;
private:
virtual std::auto_ptr<InsetBase> doClone() const;
///
void updateExpansion() const;
///
void expand() const;
/// name of macro
docstring name_;
/// the unexpanded macro defintition
mutable MathData tmpl_;
/// the macro substituted with our args
mutable MathData expanded_;
};
} // namespace lyx
#endif