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.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
2003-08-19 13:00:56 +00:00
|
|
|
|
/** "normal" symbols that don't take limits and don't grow in displayed
|
|
|
|
|
* formulae.
|
|
|
|
|
*/
|
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
|
|
|
|
///
|
2007-09-21 20:39:47 +00:00
|
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
2001-06-27 14:10:35 +00:00
|
|
|
|
///
|
2003-03-21 14:20:48 +00:00
|
|
|
|
void draw(PainterInfo &, int x, int y) const;
|
2004-02-03 11:21:08 +00:00
|
|
|
|
///
|
2008-01-03 15:44:05 +00:00
|
|
|
|
int kerning(BufferView const *) const { return kerning_; }
|
2004-02-03 11:21:08 +00:00
|
|
|
|
|
2001-08-09 08:53:16 +00:00
|
|
|
|
///
|
|
|
|
|
bool isRelOp() const;
|
2007-03-23 02:12:48 +00:00
|
|
|
|
///
|
|
|
|
|
bool isOrdAlpha() const;
|
2001-11-27 13:57:49 +00:00
|
|
|
|
/// do we take scripts?
|
2001-08-30 22:42:26 +00:00
|
|
|
|
bool isScriptable() const;
|
2001-11-27 13:57:49 +00:00
|
|
|
|
/// do we take \limits or \nolimits?
|
2001-09-11 10:58:17 +00:00
|
|
|
|
bool takesLimits() const;
|
2001-11-27 13:57:49 +00:00
|
|
|
|
/// identifies SymbolInset as such
|
2006-09-16 18:11:38 +00:00
|
|
|
|
InsetMathSymbol const * asSymbolInset() const { return this; }
|
2001-11-27 13:57:49 +00:00
|
|
|
|
/// the LaTeX name of the symbol (without the backslash)
|
2006-10-22 10:15:23 +00:00
|
|
|
|
docstring name() const;
|
2002-01-17 08:07:06 +00:00
|
|
|
|
/// request "external features"
|
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
2001-08-03 17:55:10 +00:00
|
|
|
|
|
2001-11-09 14:23:44 +00:00
|
|
|
|
///
|
|
|
|
|
void normalize(NormalStream &) const;
|
2001-11-07 08:51:35 +00:00
|
|
|
|
///
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void maple(MapleStream &) const;
|
2001-11-07 08:51:35 +00:00
|
|
|
|
///
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void maxima(MaximaStream &) const;
|
2002-10-28 17:15:19 +00:00
|
|
|
|
///
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void mathematica(MathematicaStream &) const;
|
2002-07-01 11:17:14 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
void mathmlize(MathStream &) const;
|
2001-11-07 08:51:35 +00:00
|
|
|
|
///
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void octave(OctaveStream &) const;
|
2001-11-09 14:23:44 +00:00
|
|
|
|
///
|
|
|
|
|
void write(WriteStream & os) const;
|
2002-01-16 14:24:38 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
void infoize2(odocstream & os) const;
|
2001-11-16 12:00:27 +00:00
|
|
|
|
|
2001-06-27 14:10:35 +00:00
|
|
|
|
private:
|
2007-08-30 18:03:17 +00:00
|
|
|
|
virtual Inset * clone() const;
|
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
|
|
|
|
///
|
|
|
|
|
mutable int h_;
|
2007-03-21 17:21:59 +00:00
|
|
|
|
/// cached superscript kerning
|
|
|
|
|
mutable int kerning_;
|
2001-10-22 15:37:49 +00:00
|
|
|
|
///
|
2002-05-30 07:09:54 +00:00
|
|
|
|
mutable bool scriptable_;
|
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
|