2001-08-06 06:23:09 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
#ifndef MATH_CHARINSET_H
|
|
|
|
|
#define MATH_CHARINSET_H
|
|
|
|
|
|
|
|
|
|
#include "math_inset.h"
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
|
#pragma interface
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/** The base character inset.
|
|
|
|
|
\author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class MathCharInset : public MathInset {
|
|
|
|
|
public:
|
2001-08-17 09:48:24 +00:00
|
|
|
|
///
|
|
|
|
|
explicit MathCharInset(char c);
|
2001-08-06 06:23:09 +00:00
|
|
|
|
///
|
|
|
|
|
MathCharInset(char c, MathTextCodes t);
|
|
|
|
|
///
|
|
|
|
|
MathInset * clone() const;
|
|
|
|
|
///
|
2002-01-03 13:52:13 +00:00
|
|
|
|
static MathTextCodes nativeCode(char c);
|
2001-08-17 09:48:24 +00:00
|
|
|
|
///
|
2001-10-19 11:25:48 +00:00
|
|
|
|
void metrics(MathMetricsInfo const & st) const;
|
2001-08-06 17:20:26 +00:00
|
|
|
|
///
|
|
|
|
|
void draw(Painter &, int x, int y) const;
|
2001-08-06 06:23:09 +00:00
|
|
|
|
///
|
2001-11-09 08:35:57 +00:00
|
|
|
|
void write(WriteStream & os) const;
|
2001-08-06 06:23:09 +00:00
|
|
|
|
///
|
2001-08-17 13:18:10 +00:00
|
|
|
|
void writeHeader(std::ostream &) const;
|
|
|
|
|
///
|
|
|
|
|
void writeTrailer(std::ostream &) const;
|
|
|
|
|
///
|
|
|
|
|
void writeRaw(std::ostream &) const;
|
|
|
|
|
///
|
2001-11-09 08:35:57 +00:00
|
|
|
|
void normalize(NormalStream &) const;
|
2001-08-06 06:23:09 +00:00
|
|
|
|
///
|
|
|
|
|
int ascent() const;
|
|
|
|
|
///
|
|
|
|
|
int descent() const;
|
|
|
|
|
///
|
|
|
|
|
int width() const;
|
|
|
|
|
/// 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
|
|
|
|
///
|
2001-08-14 11:19:19 +00:00
|
|
|
|
MathTextCodes code() const { return code_; }
|
|
|
|
|
///
|
2001-08-09 08:53:16 +00:00
|
|
|
|
bool isRelOp() const;
|
2001-08-10 13:17:39 +00:00
|
|
|
|
///
|
|
|
|
|
void handleFont(MathTextCodes t);
|
2001-11-16 09:55:37 +00:00
|
|
|
|
///
|
|
|
|
|
bool match(MathInset *) const;
|
2001-08-06 06:23:09 +00:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
/// the character
|
|
|
|
|
char char_;
|
2001-08-30 06:52:15 +00:00
|
|
|
|
/// the font to be used on screen
|
2001-08-10 13:17:39 +00:00
|
|
|
|
MathTextCodes code_;
|
2001-10-22 15:37:49 +00:00
|
|
|
|
///
|
|
|
|
|
mutable MathMetricsInfo mi_;
|
2001-08-06 06:23:09 +00:00
|
|
|
|
};
|
|
|
|
|
#endif
|