* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author André Pönitz
+ * \author André Pönitz
*
* Full author contact details are available in file CREDITS.
*/
#include "InsetMath.h"
+namespace lyx {
+
class latexkeys;
-/** "normal" symbols that don't take limits and don't grow in displayed
- * formulae.
- */
+// \xxx symbols that may take limits or grow in displayed formulæ.
class InsetMathSymbol : public InsetMath {
public:
///
///
explicit InsetMathSymbol(char const * name);
///
- explicit InsetMathSymbol(std::string const & name);
+ explicit InsetMathSymbol(docstring const & name);
///
- void metrics(MetricsInfo & mi, Dimension & dim) const;
+ void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
- void draw(PainterInfo &, int x, int y) const;
+ void draw(PainterInfo &, int x, int y) const override;
///
- int width() const { return width_; }
+ int kerning(BufferView const *) const override { return kerning_; }
///
- bool isRelOp() const;
- /// do we take scripts?
- bool isScriptable() const;
- /// do we take \limits or \nolimits?
- bool takesLimits() const;
+ mode_type currentMode() const override;
+ ///
+ MathClass mathClass() const override;
+ ///
+ bool isOrdAlpha() const;
+ /// The default limits value
+ Limits defaultLimits(bool display) const override;
+ /// whether the inset has limit-like sub/superscript
+ Limits limits() const override { return limits_; }
+ /// sets types of sub/superscripts
+ void limits(Limits lim) override { limits_ = lim; }
/// identifies SymbolInset as such
- InsetMathSymbol const * asSymbolInset() const { return this; }
+ InsetMathSymbol const * asSymbolInset() const override { return this; }
/// the LaTeX name of the symbol (without the backslash)
- std::string name() const;
+ docstring name() const override;
/// request "external features"
- void validate(LaTeXFeatures & features) const;
+ void validate(LaTeXFeatures & features) const override;
///
- void normalize(NormalStream &) const;
+ void normalize(NormalStream &) const override;
+ ///
+ void maple(MapleStream &) const override;
///
- void maple(MapleStream &) const;
+ void maxima(MaximaStream &) const override;
///
- void maxima(MaximaStream &) const;
+ void mathematica(MathematicaStream &) const override;
///
- void mathematica(MathematicaStream &) const;
+ void mathmlize(MathMLStream &) const override;
///
- void mathmlize(MathMLStream &) const;
+ void htmlize(HtmlStream &) const override;
+ /// \param spacing controls whether we print spaces around
+ /// "operator"-type symbols or just print them raw
+ void htmlize(HtmlStream &, bool spacing) const;
///
- void octave(OctaveStream &) const;
+ void octave(OctaveStream &) const override;
///
- void write(WriteStream & os) const;
+ void write(TeXMathStream & os) const override;
///
- void infoize2(std::ostream & os) const;
+ void infoize2(odocstream & os) const override;
+ ///
+ InsetCode lyxCode() const override { return MATH_SYMBOL_CODE; }
private:
- virtual std::auto_ptr<InsetBase> doClone() const;
+ Inset * clone() const override;
///
latexkeys const * sym_;
///
- mutable int h_;
- /// cached width
- mutable int width_;
+ Limits limits_ = AUTO_LIMITS;
+
+ // FIXME: these depend on BufferView
+
///
- mutable bool scriptable_;
+ mutable int h_ = 0;
+ /// cached superscript kerning
+ mutable int kerning_ = 0;
};
+
+} // namespace lyx
+
#endif