2 * \file math_substackinset.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "LaTeXFeatures.h"
14 #include "math_substackinset.h"
15 #include "math_data.h"
16 #include "math_mathmlstream.h"
17 #include "support/std_ostream.h"
19 #include "funcrequest.h"
20 #include "FuncStatus.h"
23 #include "support/lstrings.h"
26 using lyx::support::bformat;
31 MathSubstackInset::MathSubstackInset()
36 auto_ptr<InsetBase> MathSubstackInset::doClone() const
38 return auto_ptr<InsetBase>(new MathSubstackInset(*this));
42 void MathSubstackInset::metrics(MetricsInfo & mi, Dimension & dim) const
44 if (mi.base.style == LM_ST_DISPLAY) {
45 StyleChanger dummy(mi.base, LM_ST_TEXT);
46 MathGridInset::metrics(mi, dim);
48 MathGridInset::metrics(mi, dim);
54 void MathSubstackInset::draw(PainterInfo & pi, int x, int y) const
56 MathGridInset::draw(pi, x + 1, y);
60 bool MathSubstackInset::getStatus(LCursor & cur, FuncRequest const & cmd,
61 FuncStatus & flag) const
64 case LFUN_TABULAR_FEATURE: {
65 string const name("substack");
66 string const s = cmd.argument;
67 if (s == "add-vline-left" || s == "add-vline-right") {
69 N_("Can't add vertical grid lines in '%1$s'"), name));
73 return MathGridInset::getStatus(cur, cmd, flag);
76 return MathGridInset::getStatus(cur, cmd, flag);
81 void MathSubstackInset::infoize(std::ostream & os) const
87 void MathSubstackInset::write(WriteStream & os) const
90 MathGridInset::write(os);
95 void MathSubstackInset::normalize(NormalStream & os) const
98 MathGridInset::normalize(os);
103 void MathSubstackInset::maple(MapleStream & os) const
106 MathGridInset::maple(os);
111 void MathSubstackInset::validate(LaTeXFeatures & features) const
113 features.require("amsmath");
114 MathGridInset::validate(features);