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
|
|
|
///
|
2002-07-18 11:02:33 +00:00
|
|
|
mode_type currentMode() const { return TEXT_MODE; }
|
|
|
|
///
|
2007-09-21 20:39:47 +00:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
2002-06-04 09:06:04 +00:00
|
|
|
///
|
2003-03-21 14:20:48 +00:00
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
2001-10-19 11:25:48 +00:00
|
|
|
///
|
2001-11-09 08:35:57 +00:00
|
|
|
void write(WriteStream & os) const;
|
2001-10-19 11:25:48 +00:00
|
|
|
///
|
2002-06-04 09:06:04 +00:00
|
|
|
void normalize(NormalStream & ns) const;
|
2002-07-10 07:15:36 +00:00
|
|
|
///
|
2009-12-31 15:46:39 +00:00
|
|
|
void mathmlize(MathStream & ms) const;
|
2009-11-14 21:11:23 +00:00
|
|
|
///
|
2010-03-30 02:37:05 +00:00
|
|
|
void htmlize(HtmlStream & ms) const;
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
void infoize(odocstream & os) const;
|
2008-03-05 18:57:08 +00:00
|
|
|
///
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
2009-07-16 19:00:24 +00:00
|
|
|
///
|
|
|
|
InsetCode lyxCode() const { return MATH_BOX_CODE; }
|
2001-10-19 11:25:48 +00:00
|
|
|
|
|
|
|
private:
|
2007-11-06 20:57:29 +00:00
|
|
|
Inset * clone() const { 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:
|
|
|
|
///
|
2009-11-08 11:45:46 +00:00
|
|
|
InsetMathFBox(Buffer * buf);
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
|
|
|
mode_type currentMode() const { return TEXT_MODE; }
|
|
|
|
///
|
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
|
|
|
///
|
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
|
|
|
///
|
|
|
|
void write(WriteStream & os) const;
|
|
|
|
/// write normalized content
|
|
|
|
void normalize(NormalStream & ns) const;
|
|
|
|
///
|
2009-12-31 20:36:34 +00:00
|
|
|
void mathmlize(MathStream & ms) const;
|
2009-11-14 21:11:23 +00:00
|
|
|
///
|
2010-03-30 02:37:05 +00:00
|
|
|
void htmlize(HtmlStream & ms) const;
|
|
|
|
///
|
2007-11-06 20:57:29 +00:00
|
|
|
void infoize(odocstream & os) const;
|
2009-12-31 20:36:34 +00:00
|
|
|
///
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
2007-11-06 20:57:29 +00:00
|
|
|
private:
|
|
|
|
///
|
|
|
|
Inset * clone() const { return new InsetMathFBox(*this); }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
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
|
|
|
///
|
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
|
|
|
///
|
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
|
|
|
///
|
|
|
|
void write(WriteStream & os) const;
|
|
|
|
/// write normalized content
|
|
|
|
void normalize(NormalStream & ns) const;
|
|
|
|
///
|
2009-12-31 20:36:34 +00:00
|
|
|
void mathmlize(MathStream & ms) const;
|
2009-11-14 21:11:23 +00:00
|
|
|
///
|
2010-03-30 02:37:05 +00:00
|
|
|
void htmlize(HtmlStream & ms) const;
|
|
|
|
///
|
2007-11-06 20:57:29 +00:00
|
|
|
mode_type currentMode() const { return TEXT_MODE; }
|
|
|
|
///
|
|
|
|
void infoize(odocstream & os) const;
|
2009-12-31 20:36:34 +00:00
|
|
|
///
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
2007-11-06 20:57:29 +00:00
|
|
|
private:
|
|
|
|
Inset * clone() const { 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:
|
|
|
|
///
|
2009-11-08 11:45:46 +00:00
|
|
|
InsetMathBoxed(Buffer * buf);
|
2007-11-06 20:57:29 +00:00
|
|
|
///
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
|
|
|
///
|
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
|
|
|
///
|
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
|
|
|
///
|
|
|
|
void write(WriteStream & os) const;
|
2009-11-14 21:11:23 +00:00
|
|
|
///
|
2009-12-31 20:36:34 +00:00
|
|
|
void mathmlize(MathStream & ms) const;
|
2010-03-30 02:37:05 +00:00
|
|
|
///
|
|
|
|
void htmlize(HtmlStream & ms) const;
|
2007-11-06 20:57:29 +00:00
|
|
|
/// write normalized content
|
|
|
|
void normalize(NormalStream & ns) const;
|
|
|
|
///
|
|
|
|
void infoize(odocstream & os) const;
|
|
|
|
private:
|
|
|
|
Inset * clone() const { return new InsetMathBoxed(*this); }
|
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-11-06 20:57:29 +00:00
|
|
|
#endif // MATH_MBOX
|