34#define KFORMULA_NAMESPACE_BEGIN namespace KFormula {
35#define KFORMULA_NAMESPACE_END }
37KFORMULA_NAMESPACE_BEGIN
39const int DEBUGID = 40000;
57typedef TQPoint PixelPoint;
58typedef TQRect PixelRect;
66typedef TQPoint LuPtPoint;
67typedef TQRect LuPtRect;
68typedef TQSize LuPtSize;
71typedef TQPoint LuPixelPoint;
72typedef TQRect LuPixelRect;
73typedef TQSize LuPixelSize;
80 LeftSquareBracket = '[',
81 RightSquareBracket = ']',
82 LeftCurlyBracket = '{',
83 RightCurlyBracket = '}',
84 LeftCornerBracket = '<',
85 RightCornerBracket = '>',
86 LeftRoundBracket = '(',
87 RightRoundBracket = ')',
89 BackSlashBracket = '\\',
90 LeftLineBracket = 256,
104enum MoveFlag { NormalMovement = 0, SelectMovement = 1, WordMovement = 2 };
106inline MoveFlag movementFlag( int state )
108 int flag = NormalMovement;
109 if ( state & TQt::ControlButton )
110 flag |= WordMovement;
111 if ( state & TQt::ShiftButton )
112 flag |= SelectMovement;
113 return static_cast<MoveFlag >( flag );
127 NUMBER, NAME, ELEMENT, INNER, BRACKET, SEQUENCE, SEPARATOR, END
130typedef CharClass TokenType;
154enum TokenElementType {
166 unsigned short unicode;
178enum Direction { beforeCursor, afterCursor };
183enum SpaceWidth { THIN, MEDIUM, THICK, QUAD, NEGTHIN };
196 NegativeVeryVeryThinMathSpace,
197 NegativeVeryThinMathSpace,
198 NegativeThinMathSpace,
199 NegativeMediumMathSpace,
200 NegativeThickMathSpace,
201 NegativeVeryThickMathSpace,
202 NegativeVeryVeryThickMathSpace,
203 VeryVeryThinMathSpace,
209 VeryVeryThickMathSpace
215enum HorizontalAlign {
218 CenterHorizontalAlign,
225enum FormType { NoForm, PrefixForm, InfixForm, PostfixForm };
279typedef std::unique_ptr<ElementIndex> ElementIndexPtr;
291 req_addOneByTwoMatrix,
303 req_compactExpression,
317 req_formatTokenElement
324 Request( RequestID _id ) : id( _id ) {}
325 virtual ~Request() {}
326 operator RequestID() const { return id;}
330class BracketRequest : public Request {
331 SymbolType m_left, m_right;
333 BracketRequest( SymbolType l, SymbolType r ) : Request( req_addBracket ), m_left( l ), m_right( r ) {}
334 SymbolType left() const { return m_left; }
335 SymbolType right() const { return m_right; }
338class SymbolRequest : public Request {
341 SymbolRequest( SymbolType t ) : Request( req_addSymbol ), m_type( t ) {}
342 SymbolType type() const { return m_type; }
345class IndexRequest : public Request {
346 IndexPosition m_index;
348 IndexRequest( IndexPosition i ) : Request( req_addIndex ), m_index( i ) {}
349 IndexPosition index() const { return m_index; }
352class SpaceRequest : public Request {
355 SpaceRequest( SpaceWidth s ) : Request( req_addSpace ), m_space( s ) {}
356 SpaceWidth space() const { return m_space; }
359class DirectedRemove : public Request {
360 Direction m_direction;
362 DirectedRemove( RequestID id, Direction d ) : Request( id ), m_direction( d ) {}
363 Direction direction() const { return m_direction; }
366class TextCharRequest : public Request {
370 TextCharRequest( TQChar ch, bool isSymbol= false ) : Request( req_addTextChar ), m_ch( ch ), m_isSymbol( isSymbol ) {}
371 TQChar ch() const { return m_ch; }
372 bool isSymbol() const { return m_isSymbol; }
375class OperatorRequest: public Request {
378 OperatorRequest( TQChar ch ) : Request( req_addOperator ), m_ch( ch ) {}
379 TQChar ch() const { return m_ch; }
382class NumberRequest: public Request {
385 NumberRequest( TQChar ch ) : Request( req_addNumber ), m_ch( ch ) {}
386 TQChar ch() const { return m_ch; }
389class TextRequest : public Request {
392 TextRequest( TQString text ) : Request( req_addText ), m_text( text ) {}
393 TQString text() const { return m_text; }
396class MatrixRequest : public Request {
397 uint m_rows, m_columns;
399 MatrixRequest( uint rows, uint columns ) : Request( req_addMatrix ), m_rows( rows ), m_columns( columns ) {}
400 uint rows() const { return m_rows; }
401 uint columns() const { return m_columns; }
404class CharStyleRequest : public Request {
408 CharStyleRequest( RequestID id, bool bold, bool italic ) : Request( id ), m_bold( bold ), m_italic( italic ) {}
409 bool bold() const { return m_bold; }
410 bool italic() const { return m_italic; }
413class CharFamilyRequest : public Request {
414 CharFamily m_charFamily;
416 CharFamilyRequest( CharFamily cf ) : Request( req_formatFamily ), m_charFamily( cf ) {}
417 CharFamily charFamily() const { return m_charFamily; }
420class TokenElementRequest : public Request {
421 TokenElementType m_tokenElement;
423 TokenElementRequest( TokenElementType te ) : Request( req_formatTokenElement ), m_tokenElement( te ) {}
424 TokenElementType tokenElement() const { return m_tokenElement; }
428KFORMULA_NAMESPACE_END
Basis of every formula element.
A type that describes an index.
virtual void setToIndex(FormulaCursor *)=0 Sets the cursor to point to the place where the index normaly is.
virtual void moveToIndex(FormulaCursor *, Direction)=0 Moves the cursor inside the index.
virtual BasicElement * getElement()=0 Tells to which element the index belongs.
virtual bool hasIndex() const =0 Tells whether we own those indexes.
A point whose coordinates are floating-point values ( "double"s ).
A rect whose coordinates are floating-point values ( "double"s ).
The struct used to store static font data.
|