* 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"
+#include "support/Length.h"
+
namespace lyx {
+struct InsetSpaceParams;
/// Smart spaces
class InsetMathSpace : public InsetMath {
public:
///
- explicit InsetMathSpace(int sp);
+ explicit InsetMathSpace();
+ ///
+ explicit InsetMathSpace(std::string const & name, std::string const & length);
///
- explicit InsetMathSpace(docstring const & name);
+ explicit InsetMathSpace(Length const & length, bool const prot = false);
///
- InsetMathSpace const * asSpaceInset() const { return this; }
+ InsetMathSpace const * asSpaceInset() const override { return this; }
///
- InsetMathSpace * asSpaceInset() { return this; }
+ InsetMathSpace * asSpaceInset() override { return this; }
///
void incSpace();
///
- void metrics(MetricsInfo & mi, Dimension & dim) const;
+ void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
- void draw(PainterInfo & pi, int x, int y) const;
+ void draw(PainterInfo & pi, int x, int y) const override;
///
- void normalize(NormalStream &) const;
+ void normalize(NormalStream &) const override;
+ ///
+ void validate(LaTeXFeatures & features) const override;
+ ///
+ void maple(MapleStream &) const override;
+ ///
+ void mathematica(MathematicaStream &) const override;
+ ///
+ void octave(OctaveStream &) const override;
+ ///
+ void mathmlize(MathMLStream & ms) const override;
///
- void validate(LaTeXFeatures & features) const;
+ void htmlize(HtmlStream & ms) const override;
///
- void maple(MapleStream &) const;
+ void write(TeXMathStream & os) const override;
+ /// generate something that will be understood by the Dialogs.
+ InsetSpaceParams params() const;
///
- void mathematica(MathematicaStream &) const;
+ bool hasSettings() const override { return true; }
///
- void octave(OctaveStream &) const;
+ bool clickable(BufferView const &, int, int) const override { return true; }
///
- void write(WriteStream & os) const;
+ std::string contextMenuName() const override;
+ ///
+ bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
+ ///
+ InsetCode lyxCode() const override { return MATH_SPACE_CODE; }
+
+protected:
+ ///
+ void doDispatch(Cursor & cur, FuncRequest & cmd) override;
private:
- virtual Inset * clone() const;
+ Inset * clone() const override;
///
- int space_;
+ bool isNegative() const;
///
- Dimension dim_;
+ int space_;
+ /// amount of space for \\hspace
+ Length length_;
};