34class IndexElement :
public BasicElement {
35 IndexElement& operator=(
const IndexElement& ) {
return *
this; }
38 IndexElement(BasicElement* parent = 0);
41 IndexElement(
const IndexElement& );
43 virtual IndexElement* clone() {
44 return new IndexElement( *
this );
60 virtual void entered( SequenceElement* child );
69 const LuPixelPoint& point,
const LuPixelPoint& parentOrigin );
84 ContextStyle::IndexStyle istyle,
85 StyleAttributes& style );
92 virtual void draw( TQPainter& painter,
const LuPixelRect& r,
95 ContextStyle::IndexStyle istyle,
96 StyleAttributes& style,
97 const LuPixelPoint& parentOrigin );
117 virtual void moveLeft(
FormulaCursor* cursor, BasicElement* from);
124 virtual void moveRight(
FormulaCursor* cursor, BasicElement* from);
131 virtual void moveUp(
FormulaCursor* cursor, BasicElement* from);
138 virtual void moveDown(
FormulaCursor* cursor, BasicElement* from);
175 virtual void insert(FormulaCursor*, TQPtrList<BasicElement>&, Direction);
188 virtual void remove(FormulaCursor*, TQPtrList<BasicElement>&, Direction);
194 virtual void normalize(FormulaCursor*, Direction);
199 virtual BasicElement*
getChild(FormulaCursor*, Direction = beforeCursor);
205 virtual void selectChild(FormulaCursor* cursor, BasicElement* child);
221 bool hasUpperLeft()
const {
return upperLeft != 0; }
222 bool hasUpperMiddle()
const {
return upperMiddle != 0; }
223 bool hasUpperRight()
const {
return upperRight != 0; }
224 bool hasLowerLeft()
const {
return lowerLeft != 0; }
225 bool hasLowerMiddle()
const {
return lowerMiddle != 0; }
226 bool hasLowerRight()
const {
return lowerRight != 0; }
230 void setToUpperLeft(FormulaCursor* cursor);
231 void setToUpperMiddle(FormulaCursor* cursor);
232 void setToUpperRight(FormulaCursor* cursor);
233 void setToLowerLeft(FormulaCursor* cursor);
234 void setToLowerMiddle(FormulaCursor* cursor);
235 void setToLowerRight(FormulaCursor* cursor);
239 void moveToUpperLeft(FormulaCursor* cursor, Direction direction);
240 void moveToUpperMiddle(FormulaCursor* cursor, Direction direction);
241 void moveToUpperRight(FormulaCursor* cursor, Direction direction);
242 void moveToLowerLeft(FormulaCursor* cursor, Direction direction);
243 void moveToLowerMiddle(FormulaCursor* cursor, Direction direction);
244 void moveToLowerRight(FormulaCursor* cursor, Direction direction);
248 ElementIndexPtr getUpperLeft() {
return ElementIndexPtr(
new UpperLeftIndex(
this ) ); }
249 ElementIndexPtr getLowerLeft() {
return ElementIndexPtr(
new LowerLeftIndex(
this ) ); }
250 ElementIndexPtr getUpperMiddle() {
return ElementIndexPtr(
new UpperMiddleIndex(
this ) ); }
251 ElementIndexPtr getLowerMiddle() {
return ElementIndexPtr(
new LowerMiddleIndex(
this ) ); }
252 ElementIndexPtr getUpperRight() {
return ElementIndexPtr(
new UpperRightIndex(
this ) ); }
253 ElementIndexPtr getLowerRight() {
return ElementIndexPtr(
new LowerRightIndex(
this ) ); }
258 ElementIndexPtr
getIndex(
int position );
267 virtual TQString formulaString();
281 virtual void writeDom(TQDomElement element);
283 virtual TQString getElementName()
const ;
284 virtual void writeMathMLAttributes( TQDomElement& element )
const ;
285 virtual void writeMathMLContent( TQDomDocument& doc,
286 TQDomElement& element,
287 bool oasisFormat )
const ;
318 virtual IndexElement*
getElement() {
return parent; }
320 IndexElement* parent;
325 class UpperLeftIndex :
public IndexElementIndex {
327 UpperLeftIndex(IndexElement* parent) : IndexElementIndex(parent) {}
328 virtual void moveToIndex(FormulaCursor* cursor, Direction direction)
329 { parent->moveToUpperLeft(cursor, direction); }
330 virtual void setToIndex(FormulaCursor* cursor)
331 { parent->setToUpperLeft(cursor); }
333 {
return parent->hasUpperLeft(); }
336 class LowerLeftIndex :
public IndexElementIndex {
338 LowerLeftIndex(IndexElement* parent) : IndexElementIndex(parent) {}
339 virtual void moveToIndex(FormulaCursor* cursor, Direction direction)
340 { parent->moveToLowerLeft(cursor, direction); }
341 virtual void setToIndex(FormulaCursor* cursor)
342 { parent->setToLowerLeft(cursor); }
344 {
return parent->hasLowerLeft(); }
347 class UpperMiddleIndex :
public IndexElementIndex {
349 UpperMiddleIndex(IndexElement* parent) : IndexElementIndex(parent) {}
350 virtual void moveToIndex(FormulaCursor* cursor, Direction direction)
351 { parent->moveToUpperMiddle(cursor, direction); }
352 virtual void setToIndex(FormulaCursor* cursor)
353 { parent->setToUpperMiddle(cursor); }
355 {
return parent->hasUpperMiddle(); }
358 class LowerMiddleIndex :
public IndexElementIndex {
360 LowerMiddleIndex(IndexElement* parent) : IndexElementIndex(parent) {}
361 virtual void moveToIndex(FormulaCursor* cursor, Direction direction)
362 { parent->moveToLowerMiddle(cursor, direction); }
363 virtual void setToIndex(FormulaCursor* cursor)
364 { parent->setToLowerMiddle(cursor); }
366 {
return parent->hasLowerMiddle(); }
369 class UpperRightIndex :
public IndexElementIndex {
371 UpperRightIndex(IndexElement* parent) : IndexElementIndex(parent) {}
372 virtual void moveToIndex(FormulaCursor* cursor, Direction direction)
373 { parent->moveToUpperRight(cursor, direction); }
374 virtual void setToIndex(FormulaCursor* cursor)
375 { parent->setToUpperRight(cursor); }
377 {
return parent->hasUpperRight(); }
380 class LowerRightIndex :
public IndexElementIndex {
382 LowerRightIndex(IndexElement* parent) : IndexElementIndex(parent) {}
383 virtual void moveToIndex(FormulaCursor* cursor, Direction direction)
384 { parent->moveToLowerRight(cursor, direction); }
385 virtual void setToIndex(FormulaCursor* cursor)
386 { parent->setToLowerRight(cursor); }
388 {
return parent->hasLowerRight(); }
395 void setMiddleX(
int xOffset,
int middleWidth);
400 int getFromPos(BasicElement* from);
408 void setToContent(FormulaCursor* cursor);
413 SequenceElement* content;
420 SequenceElement* upperLeft;
421 SequenceElement* upperMiddle;
422 SequenceElement* upperRight;
423 SequenceElement* lowerLeft;
424 SequenceElement* lowerMiddle;
425 SequenceElement* lowerRight;
430 SizeType m_subScriptShiftType;
431 double m_subScriptShift;
432 SizeType m_superScriptShiftType;
433 double m_superScriptShift;
435 bool m_customAccentUnder;