2016-10-04 22:25:38 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file InsetMathClass.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author André Pönitz
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MATH_CLASSINSET_H
|
|
|
|
#define MATH_CLASSINSET_H
|
|
|
|
|
|
|
|
#include "MathClass.h"
|
|
|
|
|
|
|
|
#include "InsetMathNest.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
|
|
|
/// Support for LaTeX's \\mathxxx class-changing commands
|
|
|
|
|
|
|
|
class InsetMathClass : public InsetMathNest {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
InsetMathClass(Buffer * buf, MathClass);
|
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
docstring name() const override;
|
2016-10-04 22:25:38 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
MathClass mathClass() const override { return math_class_; }
|
2020-12-09 08:39:49 +00:00
|
|
|
/// The default limits value in \c display style
|
|
|
|
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; }
|
2016-10-04 22:25:38 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const override;
|
2016-10-04 22:25:38 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void draw(PainterInfo & pi, int x, int y) const override;
|
2016-10-04 22:25:38 +00:00
|
|
|
///
|
2020-12-26 19:04:36 +00:00
|
|
|
void write(TeXMathStream & os) const override;
|
2020-12-09 08:39:49 +00:00
|
|
|
///
|
2023-07-27 05:21:46 +00:00
|
|
|
void mathmlize(MathMLStream & ms) const override;
|
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
void infoize(odocstream & os) const override;
|
2016-10-04 22:25:38 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
InsetCode lyxCode() const override { return MATH_CLASS_CODE; }
|
2020-08-02 16:58:40 +00:00
|
|
|
///
|
|
|
|
InsetMathClass * asClassInset() { return this; }
|
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
InsetMathClass const * asClassInset() const override { return this; }
|
2016-10-04 22:25:38 +00:00
|
|
|
|
|
|
|
private:
|
2020-10-01 07:42:11 +00:00
|
|
|
Inset * clone() const override;
|
2016-10-04 22:25:38 +00:00
|
|
|
///
|
|
|
|
MathClass math_class_;
|
2020-12-09 08:39:49 +00:00
|
|
|
///
|
|
|
|
Limits limits_ = AUTO_LIMITS;
|
2016-10-04 22:25:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
#endif
|