2001-10-19 11:25:48 +00:00
|
|
|
// -*- C++ -*-
|
2003-08-19 13:00:56 +00:00
|
|
|
/**
|
2006-09-17 09:14:18 +00:00
|
|
|
* \file InsetMathBox.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-10-19 11:25:48 +00:00
|
|
|
#ifndef MATH_BOXINSET_H
|
|
|
|
#define MATH_BOXINSET_H
|
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
#include "InsetMathNest.h"
|
2003-10-06 15:43:21 +00:00
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2001-10-19 11:25:48 +00:00
|
|
|
/// Support for \\mbox
|
2006-09-16 18:11:38 +00:00
|
|
|
class InsetMathBox : public InsetMathNest {
|
2001-10-19 11:25:48 +00:00
|
|
|
public:
|
|
|
|
///
|
2009-11-08 11:45:46 +00:00
|
|
|
explicit InsetMathBox(Buffer * buf, docstring const & name);
|
2001-10-19 11:25:48 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
mode_type currentMode() const override { return TEXT_MODE; }
|
2002-07-18 11:02:33 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const override;
|
2002-06-04 09:06:04 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void draw(PainterInfo & pi, int x, int y) const override;
|
2001-10-19 11:25:48 +00:00
|
|
|
///
|
2020-12-26 20:04:36 +01:00
|
|
|
void write(TeXMathStream & os) const override;
|
2001-10-19 11:25:48 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void normalize(NormalStream & ns) const override;
|
2002-07-10 07:15:36 +00:00
|
|
|
///
|
2020-12-26 20:02:46 +01:00
|
|
|
void mathmlize(MathMLStream & ms) const override;
|
2009-11-14 21:11:23 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void htmlize(HtmlStream & ms) const override;
|
2010-03-30 02:37:05 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void infoize(odocstream & os) const override;
|
2008-03-05 18:57:08 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void validate(LaTeXFeatures & features) const override;
|
2009-07-16 19:00:24 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
InsetCode lyxCode() const override { return MATH_BOX_CODE; }
|
2001-10-19 11:25:48 +00:00
|
|
|
|
|
|
|
private:
|
2020-10-01 10:42:11 +03:00
|
|
|
Inset * clone() const override { return new InsetMathBox(*this); }
|
2001-10-19 11:25:48 +00:00
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
docstring name_;
|
2001-10-19 11:25:48 +00:00
|
|
|
};
|
2002-06-24 15:37:14 +00:00
|
|
|
|
|
|
|
|
2007-11-06 20:57:29 +00:00
|
|
|
/// Non-AMS-style frame
|
|
|
|
class InsetMathFBox : public InsetMathNest {
|
|
|
|
public:
|
|
|
|
///
|
2019-09-15 23:56:17 +02:00
|
|
|
explicit InsetMathFBox(Buffer * buf);
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
mode_type currentMode() const override { return TEXT_MODE; }
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-12-02 17:13:32 +02:00
|
|
|
marker_type marker(BufferView const *) const override { return marker_type::NO_MARKER; }
|
2017-01-06 09:52:10 +01:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void draw(PainterInfo & pi, int x, int y) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-12-26 20:04:36 +01:00
|
|
|
void write(TeXMathStream & os) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
/// write normalized content
|
2020-10-01 10:42:11 +03:00
|
|
|
void normalize(NormalStream & ns) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-12-26 20:02:46 +01:00
|
|
|
void mathmlize(MathMLStream & ms) const override;
|
2009-11-14 21:11:23 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void htmlize(HtmlStream & ms) const override;
|
2010-03-30 02:37:05 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void infoize(odocstream & os) const override;
|
2009-12-31 20:36:34 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void validate(LaTeXFeatures & features) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
private:
|
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
Inset * clone() const override { return new InsetMathFBox(*this); }
|
2007-11-06 20:57:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-02-28 12:46:32 +00:00
|
|
|
/// Extra nesting: \\makebox or \\framebox.
|
2007-11-06 20:57:29 +00:00
|
|
|
class InsetMathMakebox : public InsetMathNest {
|
|
|
|
public:
|
|
|
|
///
|
2009-11-08 11:45:46 +00:00
|
|
|
InsetMathMakebox(Buffer * buf, bool framebox);
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void draw(PainterInfo & pi, int x, int y) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-12-26 20:04:36 +01:00
|
|
|
void write(TeXMathStream & os) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
/// write normalized content
|
2020-10-01 10:42:11 +03:00
|
|
|
void normalize(NormalStream & ns) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-12-26 20:02:46 +01:00
|
|
|
void mathmlize(MathMLStream & ms) const override;
|
2009-11-14 21:11:23 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void htmlize(HtmlStream & ms) const override;
|
2010-03-30 02:37:05 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
mode_type currentMode() const override { return TEXT_MODE; }
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void infoize(odocstream & os) const override;
|
2009-12-31 20:36:34 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void validate(LaTeXFeatures & features) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
private:
|
2020-10-01 10:42:11 +03:00
|
|
|
Inset * clone() const override { return new InsetMathMakebox(*this); }
|
2008-02-28 12:46:32 +00:00
|
|
|
///
|
|
|
|
bool framebox_;
|
2007-11-06 20:57:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// AMS-style frame
|
|
|
|
class InsetMathBoxed : public InsetMathNest {
|
|
|
|
public:
|
|
|
|
///
|
2019-09-15 23:56:17 +02:00
|
|
|
explicit InsetMathBoxed(Buffer * buf);
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-12-02 17:13:32 +02:00
|
|
|
marker_type marker(BufferView const *) const override { return marker_type::NO_MARKER; }
|
2017-01-06 09:52:10 +01:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void validate(LaTeXFeatures & features) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void draw(PainterInfo & pi, int x, int y) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-12-26 20:04:36 +01:00
|
|
|
void write(TeXMathStream & os) const override;
|
2009-11-14 21:11:23 +00:00
|
|
|
///
|
2020-12-26 20:02:46 +01:00
|
|
|
void mathmlize(MathMLStream & ms) const override;
|
2010-03-30 02:37:05 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void htmlize(HtmlStream & ms) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
/// write normalized content
|
2020-10-01 10:42:11 +03:00
|
|
|
void normalize(NormalStream & ns) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void infoize(odocstream & os) const override;
|
2007-11-06 20:57:29 +00:00
|
|
|
private:
|
2020-10-01 10:42:11 +03:00
|
|
|
Inset * clone() const override { return new InsetMathBoxed(*this); }
|
2007-11-06 20:57:29 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-11-06 20:57:29 +00:00
|
|
|
#endif // MATH_MBOX
|