2001-08-03 17:10:22 +00:00
|
|
|
#ifndef MATH_NESTINSET_H
|
|
|
|
#define MATH_NESTINSET_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-08-03 17:55:10 +00:00
|
|
|
#include "math_diminset.h"
|
2001-08-03 17:10:22 +00:00
|
|
|
|
|
|
|
/** Abstract base class for all math objects that conatin nested items.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
class LaTeXFeatures;
|
|
|
|
|
2001-08-03 17:55:10 +00:00
|
|
|
class MathNestInset : public MathDimInset {
|
2001-08-03 17:10:22 +00:00
|
|
|
public:
|
|
|
|
///
|
2001-08-08 17:26:30 +00:00
|
|
|
explicit MathNestInset(int ncells);
|
2001-08-03 17:10:22 +00:00
|
|
|
|
2001-08-06 17:20:26 +00:00
|
|
|
///
|
|
|
|
void metrics(MathStyles st) const;
|
2001-08-03 17:10:22 +00:00
|
|
|
/// draw the object, sets xo_ and yo_ cached values
|
2001-08-06 17:20:26 +00:00
|
|
|
void draw(Painter &, int x, int y) const;
|
2001-08-03 17:10:22 +00:00
|
|
|
/// appends itself with macro arguments substituted
|
2001-08-06 17:20:26 +00:00
|
|
|
void substitute(MathArray & array, MathMacro const & macro) const;
|
2001-08-03 17:10:22 +00:00
|
|
|
|
|
|
|
/// The left key
|
2001-08-06 17:20:26 +00:00
|
|
|
bool idxLeft(int & idx, int & pos) const;
|
2001-08-03 17:10:22 +00:00
|
|
|
/// The right key
|
2001-08-06 17:20:26 +00:00
|
|
|
bool idxRight(int & idx, int & pos) const;
|
2001-08-03 17:10:22 +00:00
|
|
|
|
|
|
|
/// Move one physical cell up
|
2001-08-06 17:20:26 +00:00
|
|
|
bool idxNext(int & idx, int & pos) const;
|
2001-08-03 17:10:22 +00:00
|
|
|
/// Move one physical cell down
|
2001-08-06 17:20:26 +00:00
|
|
|
bool idxPrev(int & idx, int & pos) const;
|
2001-08-03 17:10:22 +00:00
|
|
|
|
|
|
|
/// Target pos when we enter the inset from the left by pressing "Right"
|
2001-08-06 17:20:26 +00:00
|
|
|
bool idxFirst(int & idx, int & pos) const;
|
2001-08-03 17:10:22 +00:00
|
|
|
/// Target pos when we enter the inset from the right by pressing "Left"
|
2001-08-06 17:20:26 +00:00
|
|
|
bool idxLast(int & idx, int & pos) const;
|
2001-08-03 17:10:22 +00:00
|
|
|
|
|
|
|
/// Where should we go if we press home?
|
2001-08-06 17:20:26 +00:00
|
|
|
bool idxHome(int & idx, int & pos) const;
|
2001-08-03 17:10:22 +00:00
|
|
|
/// Where should we go if we press end?
|
2001-08-06 17:20:26 +00:00
|
|
|
bool idxEnd(int & idx, int & pos) const;
|
2001-08-03 17:10:22 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
int nargs() const;
|
|
|
|
|
|
|
|
///
|
|
|
|
MathArray & cell(int);
|
|
|
|
///
|
|
|
|
MathArray const & cell(int) const;
|
|
|
|
///
|
|
|
|
MathXArray & xcell(int);
|
|
|
|
///
|
|
|
|
MathXArray const & xcell(int) const;
|
|
|
|
|
|
|
|
///
|
|
|
|
bool isActive() const { return nargs() > 0; }
|
|
|
|
///
|
|
|
|
void push_back(MathInset *);
|
|
|
|
///
|
|
|
|
void dump() const;
|
|
|
|
|
|
|
|
///
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
///
|
|
|
|
typedef std::vector<MathXArray> cells_type;
|
|
|
|
/// The nested contents of the inset are contained here.
|
|
|
|
cells_type cells_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|