2001-02-13 13:28:32 +00:00
|
|
|
// -*- C++ -*-
|
2003-08-19 13:00:56 +00:00
|
|
|
/**
|
2006-09-17 09:14:18 +00:00
|
|
|
* \file InsetMathSymbol.h
|
2003-08-19 13:00:56 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2003-08-19 13:00:56 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2001-07-27 10:08:04 +00:00
|
|
|
#ifndef MATH_SYMBOLINSET_H
|
|
|
|
#define MATH_SYMBOLINSET_H
|
2001-02-13 13:28:32 +00:00
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
#include "InsetMath.h"
|
2001-02-13 13:28:32 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2005-01-19 15:03:31 +00:00
|
|
|
class latexkeys;
|
2001-07-26 14:37:09 +00:00
|
|
|
|
2003-05-28 13:22:36 +00:00
|
|
|
|
2020-07-19 17:56:07 +00:00
|
|
|
// \xxx symbols that may take limits or grow in displayed formulæ.
|
2006-09-16 18:11:38 +00:00
|
|
|
class InsetMathSymbol : public InsetMath {
|
2001-02-13 13:28:32 +00:00
|
|
|
public:
|
|
|
|
///
|
2006-09-16 18:11:38 +00:00
|
|
|
explicit InsetMathSymbol(latexkeys const * l);
|
2001-02-13 13:28:32 +00:00
|
|
|
///
|
2006-09-16 18:11:38 +00:00
|
|
|
explicit InsetMathSymbol(char const * name);
|
2001-11-08 12:06:56 +00:00
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
explicit InsetMathSymbol(docstring const & name);
|
2001-12-05 08:04:20 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const override;
|
2001-06-27 14:10:35 +00:00
|
|
|
///
|
2020-10-03 12:42:14 +00:00
|
|
|
void draw(PainterInfo &, int x, int y) const override;
|
2004-02-03 11:21:08 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
int kerning(BufferView const *) const override { return kerning_; }
|
2004-02-03 11:21:08 +00:00
|
|
|
|
2013-01-09 21:23:07 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
mode_type currentMode() const override;
|
2001-08-09 08:53:16 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
MathClass mathClass() const override;
|
2007-03-23 02:12:48 +00:00
|
|
|
///
|
|
|
|
bool isOrdAlpha() const;
|
2020-07-19 17:56:07 +00:00
|
|
|
/// The default limits value
|
2020-12-09 08:39:49 +00:00
|
|
|
Limits defaultLimits(bool display) const override;
|
2020-07-19 17:56:07 +00:00
|
|
|
/// whether the inset has limit-like sub/superscript
|
2020-10-01 07:42:11 +00:00
|
|
|
Limits limits() const override { return limits_; }
|
2020-07-19 17:56:07 +00:00
|
|
|
/// sets types of sub/superscripts
|
2020-10-01 07:42:11 +00:00
|
|
|
void limits(Limits lim) override { limits_ = lim; }
|
2001-11-27 13:57:49 +00:00
|
|
|
/// identifies SymbolInset as such
|
2020-10-01 07:42:11 +00:00
|
|
|
InsetMathSymbol const * asSymbolInset() const override { return this; }
|
2001-11-27 13:57:49 +00:00
|
|
|
/// the LaTeX name of the symbol (without the backslash)
|
2020-10-01 07:42:11 +00:00
|
|
|
docstring name() const override;
|
2002-01-17 08:07:06 +00:00
|
|
|
/// request "external features"
|
2020-10-01 07:42:11 +00:00
|
|
|
void validate(LaTeXFeatures & features) const override;
|
2001-08-03 17:55:10 +00:00
|
|
|
|
2001-11-09 14:23:44 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void normalize(NormalStream &) const override;
|
2001-11-07 08:51:35 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void maple(MapleStream &) const override;
|
2001-11-07 08:51:35 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void maxima(MaximaStream &) const override;
|
2002-10-28 17:15:19 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void mathematica(MathematicaStream &) const override;
|
2002-07-01 11:17:14 +00:00
|
|
|
///
|
2020-12-26 19:02:46 +00:00
|
|
|
void mathmlize(MathMLStream &) const override;
|
2001-11-07 08:51:35 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void htmlize(HtmlStream &) const override;
|
2010-03-30 22:51:02 +00:00
|
|
|
/// \param spacing controls whether we print spaces around
|
|
|
|
/// "operator"-type symbols or just print them raw
|
|
|
|
void htmlize(HtmlStream &, bool spacing) const;
|
2010-03-30 00:24:54 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void octave(OctaveStream &) const override;
|
2001-11-09 14:23:44 +00:00
|
|
|
///
|
2020-12-26 19:04:36 +00:00
|
|
|
void write(TeXMathStream & os) const override;
|
2002-01-16 14:24:38 +00:00
|
|
|
///
|
2020-10-03 12:42:14 +00:00
|
|
|
void infoize2(odocstream & os) const override;
|
2009-07-16 19:00:24 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
InsetCode lyxCode() const override { return MATH_SYMBOL_CODE; }
|
2001-11-16 12:00:27 +00:00
|
|
|
|
2001-06-27 14:10:35 +00:00
|
|
|
private:
|
2020-10-01 07:42:11 +00:00
|
|
|
Inset * clone() const override;
|
2001-02-13 13:28:32 +00:00
|
|
|
///
|
2001-07-26 14:37:09 +00:00
|
|
|
latexkeys const * sym_;
|
2001-08-30 22:42:26 +00:00
|
|
|
///
|
2020-07-19 17:56:07 +00:00
|
|
|
Limits limits_ = AUTO_LIMITS;
|
|
|
|
|
|
|
|
// FIXME: these depend on BufferView
|
|
|
|
|
2001-10-22 15:37:49 +00:00
|
|
|
///
|
2020-07-19 17:56:07 +00:00
|
|
|
mutable int h_ = 0;
|
|
|
|
/// cached superscript kerning
|
|
|
|
mutable int kerning_ = 0;
|
2001-02-13 13:28:32 +00:00
|
|
|
};
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
2006-10-22 10:15:23 +00:00
|
|
|
|
2001-02-13 13:28:32 +00:00
|
|
|
#endif
|