2001-08-06 06:23:09 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-19 13:00:56 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file math_charinset.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.
|
|
|
|
|
*/
|
|
|
|
|
|
2001-08-06 06:23:09 +00:00
|
|
|
|
#ifndef MATH_CHARINSET_H
|
|
|
|
|
#define MATH_CHARINSET_H
|
|
|
|
|
|
2004-02-03 11:21:08 +00:00
|
|
|
|
#include "math_inset.h"
|
2001-08-06 06:23:09 +00:00
|
|
|
|
|
|
|
|
|
|
2003-08-19 13:00:56 +00:00
|
|
|
|
/// The base character inset.
|
2004-02-03 11:21:08 +00:00
|
|
|
|
class MathCharInset : public MathInset {
|
2001-08-06 06:23:09 +00:00
|
|
|
|
public:
|
2001-08-17 09:48:24 +00:00
|
|
|
|
///
|
|
|
|
|
explicit MathCharInset(char c);
|
2001-08-06 06:23:09 +00:00
|
|
|
|
///
|
2003-06-02 10:03:27 +00:00
|
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
2001-08-06 17:20:26 +00:00
|
|
|
|
///
|
2003-05-28 13:22:36 +00:00
|
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
2001-08-06 06:23:09 +00:00
|
|
|
|
///
|
2003-05-28 13:22:36 +00:00
|
|
|
|
void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
|
2002-03-19 16:55:58 +00:00
|
|
|
|
///
|
2002-03-21 06:57:13 +00:00
|
|
|
|
void drawT(TextPainter &, int x, int y) const;
|
2004-02-03 11:21:08 +00:00
|
|
|
|
///
|
|
|
|
|
int width() const { return width_; }
|
2004-02-02 17:32:56 +00:00
|
|
|
|
|
2002-03-19 16:55:58 +00:00
|
|
|
|
///
|
2001-11-09 08:35:57 +00:00
|
|
|
|
void write(WriteStream & os) const;
|
2001-08-06 06:23:09 +00:00
|
|
|
|
///
|
2002-06-18 15:44:30 +00:00
|
|
|
|
void normalize(NormalStream & ns) const;
|
|
|
|
|
///
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void octave(OctaveStream & os) const;
|
2005-07-14 22:41:59 +00:00
|
|
|
|
///
|
|
|
|
|
void mathmlize(MathMLStream & ms) const;
|
2001-08-06 06:23:09 +00:00
|
|
|
|
/// identifies Charinsets
|
2001-08-17 13:18:10 +00:00
|
|
|
|
MathCharInset const * asCharInset() const { return this; }
|
2001-08-06 06:23:09 +00:00
|
|
|
|
///
|
|
|
|
|
char getChar() const { return char_; }
|
2001-08-09 08:53:16 +00:00
|
|
|
|
///
|
|
|
|
|
bool isRelOp() const;
|
2001-08-06 06:23:09 +00:00
|
|
|
|
|
|
|
|
|
private:
|
2004-11-23 23:04:52 +00:00
|
|
|
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
2001-08-06 06:23:09 +00:00
|
|
|
|
/// the character
|
|
|
|
|
char char_;
|
2004-02-03 11:21:08 +00:00
|
|
|
|
/// cached width
|
|
|
|
|
mutable int width_;
|
2001-08-06 06:23:09 +00:00
|
|
|
|
};
|
|
|
|
|
#endif
|