2002-06-18 15:44:30 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-19 13:00:56 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file math_numberinset.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
|
#ifndef MATH_NUMBERINSET_H
|
|
|
|
|
#define MATH_NUMBERINSET_H
|
|
|
|
|
|
2003-05-28 13:22:36 +00:00
|
|
|
|
#include "math_inset.h"
|
2002-06-18 15:44:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Some inset that "is" a number
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* mainly for math-extern
|
2002-06-18 15:44:30 +00:00
|
|
|
|
*/
|
2003-05-28 13:22:36 +00:00
|
|
|
|
class MathNumberInset : public MathInset {
|
2002-06-18 15:44:30 +00:00
|
|
|
|
public:
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
explicit MathNumberInset(std::string const & s);
|
2002-06-18 15:44:30 +00:00
|
|
|
|
///
|
2003-07-25 17:11:25 +00:00
|
|
|
|
virtual std::auto_ptr<InsetBase> clone() const;
|
2002-06-18 15:44:30 +00:00
|
|
|
|
///
|
2003-06-02 10:03:27 +00:00
|
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
2002-06-18 15:44:30 +00:00
|
|
|
|
///
|
2003-03-21 14:20:48 +00:00
|
|
|
|
void draw(PainterInfo &, int x, int y) const;
|
2002-06-18 15:44:30 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string str() const { return str_; }
|
2002-06-18 15:44:30 +00:00
|
|
|
|
///
|
|
|
|
|
MathNumberInset * asNumberInset() { return this; }
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
void normalize(NormalStream &) const;
|
|
|
|
|
///
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void octave(OctaveStream &) const;
|
2002-06-18 15:44:30 +00:00
|
|
|
|
///
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void maple(MapleStream &) const;
|
2002-06-18 15:44:30 +00:00
|
|
|
|
///
|
|
|
|
|
void mathmlize(MathMLStream &) const;
|
|
|
|
|
///
|
|
|
|
|
void write(WriteStream & os) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
/// the number as string
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string str_;
|
2002-06-18 15:44:30 +00:00
|
|
|
|
};
|
|
|
|
|
#endif
|