]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_parinset.h
macro rework
[lyx.git] / src / mathed / math_parinset.h
index c5af2cfb5c0aafdbdac4c201be407e0d28747315..6be910752d7486bc7189b585891cbe08aa5aaf07 100644 (file)
 // -*- C++ -*-
+/**
+ * \file math_parinset.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_PARINSET_H
 #define MATH_PARINSET_H
 
-#include "array.h"
-#include "math_inset.h"
-#include "math_defs.h"
-#include "math_rowst.h"
-
-#ifdef __GNUG__
-#pragma interface
-#endif
 
-class MathedArray;
+#include "math_hullinset.h"
 
-
-/** The math paragraph base class, base to all editable math objects
-    \author Alejandro Aguilar Sierra
- */
-class MathParInset : public MathedInset  {
-public: 
-       ///
-       MathParInset(short st = LM_ST_TEXT, string const & nm = string(),
-                    short ot = LM_OT_MIN);
-       ///
-       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 const &);
-       ///
-       virtual MathedArray & GetData();
-       ///
-       virtual MathedArray const & GetData() const;
-       /// 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.
-       ///
-       virtual void SetAlign(char, string const &);
-       ///
-       virtual int GetColumns() const;
-       ///
-       virtual int GetRows() const;
-       ///
-       virtual bool isMatrix() const;
-       // Vertical switching
-       ///
-       virtual bool setArgumentIdx(int i);
-       ///
-       virtual bool setNextArgIdx();
-       ///
-       virtual int getArgumentIdx() const;
-       ///
-       virtual int getMaxArgumentIdx() const;
-       ///
-       virtual void SetStyle(short);
-       ///
-       virtual MathedRowSt * getRowSt() const;
-       ///
-       virtual void setRowSt(MathedRowSt *);
+class MathParInset : public MathHullInset {
+public:
        ///
-       virtual bool Permit(short f) const;
+       MathParInset() {}
        ///
-       int xo() const;
+       MathParInset(MathArray const & ar);
        ///
-       int yo() const;
+       mode_type currentMode() const { return TEXT_MODE; }
        ///
-       void clear();
-protected:
-       /// Paragraph data is stored here
-       MathedArray array;
-       /// 
-       short flag;
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
-       void xo(int tx);
+       void draw(PainterInfo &, int x, int y) const;
        ///
-       void yo(int ty);
-private:
-       /// Cursor start position
-       int xo_;
+       void infoize(std::ostream & os) const;
        ///
-       int yo_;
+       void write(WriteStream & os) const;
 };
 
-
-inline
-void MathParInset::SetAlign(char, string const &)
-{}
-
-
-inline
-int MathParInset::GetColumns() const
-{
-       return 1;
-}
-
-
-inline
-int MathParInset::GetRows() const
-{
-       return 1;
-}
-
-
-inline
-bool MathParInset::isMatrix() const
-{
-       return false;
-}
-
-
-inline
-bool MathParInset::setArgumentIdx(int i)
-{
-       return (i == 0);
-}
-
-
-inline
-bool MathParInset::setNextArgIdx()
-{
-       return false;
-}
-
-
-inline
-int MathParInset::getArgumentIdx() const
-{
-       return 0;
-}
-
-
-inline
-int MathParInset::getMaxArgumentIdx() const
-{
-       return 0;
-}
-
-
-inline
-void MathParInset::setRowSt(MathedRowSt *)
-{}
-
-
-inline
-int MathParInset::xo() const
-{
-       return xo_;
-}
-
-
-inline
-int MathParInset::yo() const
-{
-       return yo_;
-}
-
-
-inline
-void MathParInset::xo(int tx)
-{
-       xo_ = tx;
-}
-
-
-inline
-void MathParInset::yo(int ty)
-{
-       yo_ = ty;
-}
 #endif