2001-02-13 13:28:32 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
#ifndef MATH_PARINSET_H
|
|
|
|
#define MATH_PARINSET_H
|
|
|
|
|
2001-02-20 10:49:48 +00:00
|
|
|
#include "array.h"
|
2001-02-13 13:28:32 +00:00
|
|
|
#include "math_inset.h"
|
2001-02-13 19:10:18 +00:00
|
|
|
#include "math_defs.h"
|
2001-03-06 17:13:12 +00:00
|
|
|
#include "math_rowst.h"
|
2001-02-13 13:28:32 +00:00
|
|
|
|
2001-03-01 13:37:48 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-02-13 19:10:18 +00:00
|
|
|
class MathedArray;
|
2001-02-13 13:28:32 +00:00
|
|
|
|
|
|
|
|
2001-02-16 09:25:43 +00:00
|
|
|
/** The math paragraph base class, base to all editable math objects
|
|
|
|
\author Alejandro Aguilar Sierra
|
|
|
|
*/
|
2001-03-01 13:37:48 +00:00
|
|
|
class MathParInset : public MathedInset {
|
2001-02-15 12:22:01 +00:00
|
|
|
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
|
2001-02-20 16:00:22 +00:00
|
|
|
virtual void setData(MathedArray const &);
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
2001-02-20 16:00:22 +00:00
|
|
|
virtual MathedArray & GetData();
|
2001-02-28 17:21:16 +00:00
|
|
|
///
|
|
|
|
virtual MathedArray const & GetData() const;
|
2001-02-15 12:22:01 +00:00
|
|
|
/// 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.
|
|
|
|
///
|
2001-03-01 13:37:48 +00:00
|
|
|
virtual void SetAlign(char, string const &);
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
2001-03-01 13:37:48 +00:00
|
|
|
virtual int GetColumns() const;
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
2001-03-01 13:37:48 +00:00
|
|
|
virtual int GetRows() const;
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
2001-03-01 13:37:48 +00:00
|
|
|
virtual bool isMatrix() const;
|
2001-02-15 12:22:01 +00:00
|
|
|
// Vertical switching
|
|
|
|
///
|
2001-03-01 13:37:48 +00:00
|
|
|
virtual bool setArgumentIdx(int i);
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
2001-03-01 13:37:48 +00:00
|
|
|
virtual bool setNextArgIdx();
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
2001-03-01 13:37:48 +00:00
|
|
|
virtual int getArgumentIdx() const;
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
2001-03-01 13:37:48 +00:00
|
|
|
virtual int getMaxArgumentIdx() const;
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
|
|
|
virtual void SetStyle(short);
|
|
|
|
///
|
2001-03-16 12:54:34 +00:00
|
|
|
MathedRowContainer & getRowSt();
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
|
|
|
virtual bool Permit(short f) const;
|
|
|
|
///
|
2001-03-01 13:37:48 +00:00
|
|
|
int xo() const;
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
2001-03-01 13:37:48 +00:00
|
|
|
int yo() const;
|
2001-02-20 13:16:07 +00:00
|
|
|
///
|
|
|
|
void clear();
|
2001-02-15 12:22:01 +00:00
|
|
|
protected:
|
|
|
|
/// Paragraph data is stored here
|
2001-02-20 10:49:48 +00:00
|
|
|
MathedArray array;
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
|
|
|
short flag;
|
|
|
|
///
|
2001-03-01 13:37:48 +00:00
|
|
|
void xo(int tx);
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
2001-03-01 13:37:48 +00:00
|
|
|
void yo(int ty);
|
2001-03-16 12:54:34 +00:00
|
|
|
///
|
|
|
|
MathedRowContainer row_;
|
2001-02-15 12:22:01 +00:00
|
|
|
private:
|
|
|
|
/// Cursor start position
|
|
|
|
int xo_;
|
|
|
|
///
|
|
|
|
int yo_;
|
2001-02-13 13:28:32 +00:00
|
|
|
};
|
2001-03-01 13:37:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
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;
|
|
|
|
}
|
2001-02-13 13:28:32 +00:00
|
|
|
#endif
|