2008-10-23 00:48:06 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file InsetMathSpecialChar.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Enrico Forestieri
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MATH_SPECIALCHARINSET_H
|
|
|
|
#define MATH_SPECIALCHARINSET_H
|
|
|
|
|
|
|
|
#include "InsetMath.h"
|
|
|
|
|
2010-10-31 14:39:50 +00:00
|
|
|
#include "support/docstring.h"
|
|
|
|
|
2008-10-23 00:48:06 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
/// The special character inset.
|
2008-11-15 12:44:11 +00:00
|
|
|
class InsetMathSpecialChar : public InsetMath
|
|
|
|
{
|
2008-10-23 00:48:06 +00:00
|
|
|
public:
|
|
|
|
///
|
2008-11-15 12:44:11 +00:00
|
|
|
explicit InsetMathSpecialChar(docstring const & name);
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const override;
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void draw(PainterInfo & pi, int x, int y) const override;
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void metricsT(TextMetricsInfo const & mi, Dimension & dim) const override;
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void drawT(TextPainter &, int x, int y) const override;
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
int kerning(BufferView const *) const override { return kerning_; }
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-12-26 19:04:36 +00:00
|
|
|
void write(TeXMathStream & os) const override;
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void validate(LaTeXFeatures & features) const override;
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void normalize(NormalStream & ns) const override;
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void octave(OctaveStream & os) const override;
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void maple(MapleStream &) const override;
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void mathematica(MathematicaStream &) const override;
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-12-26 19:02:46 +00:00
|
|
|
void mathmlize(MathMLStream & ms) const override;
|
2010-03-31 20:49:21 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void htmlize(HtmlStream & ms) const override;
|
2008-10-23 00:48:06 +00:00
|
|
|
/// identifies SpecialChar insets
|
2020-10-01 07:42:11 +00:00
|
|
|
InsetMathSpecialChar const * asSpecialCharInset() const override { return this; }
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
docstring name() const override { return name_; }
|
2008-10-23 00:48:06 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
char_type getChar() const override { return char_; }
|
2009-07-16 19:00:24 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
InsetCode lyxCode() const override { return MATH_SPECIALCHAR_CODE; }
|
2008-10-23 00:48:06 +00:00
|
|
|
|
|
|
|
private:
|
2020-10-01 07:42:11 +00:00
|
|
|
Inset * clone() const override;
|
2008-10-23 00:48:06 +00:00
|
|
|
/// the latex name
|
|
|
|
docstring name_;
|
|
|
|
/// the displayed character
|
|
|
|
char_type char_;
|
|
|
|
/// cached kerning for superscript
|
|
|
|
mutable int kerning_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2008-11-15 12:44:11 +00:00
|
|
|
#endif // MATH_SPECIALCHARINSET_H
|