X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_parinset.h;h=17b6e0bd069c79ed8134cc87970d539757631ecb;hb=d359dd8fca52c4f0100f7cf4bf636113c5c4e49f;hp=c8e2784d1632500c467c012e382fee7f631a77ce;hpb=d5905fabf640bac1abda9ac7174000c3f2e34260;p=lyx.git diff --git a/src/mathed/math_parinset.h b/src/mathed/math_parinset.h index c8e2784d16..17b6e0bd06 100644 --- a/src/mathed/math_parinset.h +++ b/src/mathed/math_parinset.h @@ -1,98 +1,22 @@ -// -*- C++ -*- #ifndef MATH_PARINSET_H #define MATH_PARINSET_H -#include "math_inset.h" -#include "math_defs.h" +#include "math_hullinset.h" -struct MathedRowSt; -class MathedArray; - - -/** The math paragraph base class, base to all editable math objects */ -class MathParInset: public MathedInset { -public: - /// - MathParInset(short st = LM_ST_TEXT, string const & nm = string(), - short ot = LM_OT_MIN); - /// - explicit - MathParInset(MathParInset *); - /// - virtual ~MathParInset(); - /// - virtual MathedInset * Clone(); - /// Draw the object on a drawable - virtual void draw(Painter &, int x, int baseline); - /// Write LaTeX code - virtual void Write(std::ostream &, bool fragile); - /// - virtual void Metrics(); - /// - virtual void UserSetSize(short); - /// Data is stored in a LyXArray - virtual void SetData(MathedArray *); - /// - virtual MathedArray * GetData(); - /// Paragraph position - virtual void GetXY(int &, int &) const; - /// - virtual void setXY(int x, int y); - /// - virtual void SetFocus(int, int) {} - /// - virtual bool Inside(int, int); - // Tab stuff used by Matrix. +class MathParInset : public MathHullInset { +public: /// - virtual void SetAlign(char, string const &) {} + MathParInset(); /// - virtual int GetColumns() const { return 1; } + MathParInset * asParInset() { return this; } /// - virtual int GetRows() const { return 1; } + void metrics(MathMetricsInfo & mi) const; /// - virtual bool isMatrix() const { return false; } - // Vertical switching + void draw(MathPainterInfo &, int x, int y) const; /// - virtual bool setArgumentIdx(int i) { return (i == 0); } + void infoize(std::ostream & os) const; /// - virtual bool setNextArgIdx() { return false; } - /// - virtual int getArgumentIdx() const { return 0; } - /// - virtual int getMaxArgumentIdx() const { return 0; } - /// - virtual void SetStyle(short); - /// - virtual MathedRowSt * getRowSt() const; - /// - virtual void setRowSt(MathedRowSt *) {} - /// - virtual bool Permit(short f) const; - /// - int xo() const { - return xo_; - } - /// - int yo() const { - return yo_; - } -protected: - /// Paragraph data is stored here - MathedArray * array; - /// - short flag; - /// - void xo(int tx) { - xo_ = tx; - } - /// - void yo(int ty) { - yo_ = ty; - } -private: - /// Cursor start position - int xo_; - /// - int yo_; + void write(WriteStream & os) const; }; + #endif