Diffstat (limited to 'noncore/apps/opie-write/qrichtext_p.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-write/qrichtext_p.h | 157 |
1 files changed, 80 insertions, 77 deletions
diff --git a/noncore/apps/opie-write/qrichtext_p.h b/noncore/apps/opie-write/qrichtext_p.h index e368edb..3778feb 100644 --- a/noncore/apps/opie-write/qrichtext_p.h +++ b/noncore/apps/opie-write/qrichtext_p.h | |||
@@ -29,48 +29,51 @@ | |||
29 | ** information about Qt Commercial License Agreements. | 29 | ** information about Qt Commercial License Agreements. |
30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | 30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. |
31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
32 | ** | 32 | ** |
33 | ** Contact info@trolltech.com if any conditions of this licensing are | 33 | ** Contact info@trolltech.com if any conditions of this licensing are |
34 | ** not clear to you. | 34 | ** not clear to you. |
35 | ** | 35 | ** |
36 | **********************************************************************/ | 36 | **********************************************************************/ |
37 | 37 | ||
38 | #ifndef QRICHTEXT_P_H | 38 | #ifndef QRICHTEXT_P_H |
39 | #define QRICHTEXT_P_H | 39 | #define QRICHTEXT_P_H |
40 | 40 | ||
41 | // | 41 | // |
42 | // W A R N I N G | 42 | // W A R N I N G |
43 | // ------------- | 43 | // ------------- |
44 | // | 44 | // |
45 | // This file is not part of the Qt API. It exists for the convenience | 45 | // This file is not part of the Qt API. It exists for the convenience |
46 | // of a number of Qt sources files. This header file may change from | 46 | // of a number of Qt sources files. This header file may change from |
47 | // version to version without notice, or even be removed. | 47 | // version to version without notice, or even be removed. |
48 | // | 48 | // |
49 | // We mean it. | 49 | // We mean it. |
50 | // | 50 | // |
51 | // | 51 | // |
52 | 52 | ||
53 | #include <opie2/odebug.h> | ||
54 | using namespace Opie::Core; | ||
55 | |||
53 | #ifndef QT_H | 56 | #ifndef QT_H |
54 | #include "qstring.h" | 57 | #include "qstring.h" |
55 | #include "qlist.h" | 58 | #include "qlist.h" |
56 | #include "qrect.h" | 59 | #include "qrect.h" |
57 | #include "qfontmetrics.h" | 60 | #include "qfontmetrics.h" |
58 | #include "qintdict.h" | 61 | #include "qintdict.h" |
59 | #include "qmap.h" | 62 | #include "qmap.h" |
60 | #include "qstringlist.h" | 63 | #include "qstringlist.h" |
61 | #include "qfont.h" | 64 | #include "qfont.h" |
62 | #include "qcolor.h" | 65 | #include "qcolor.h" |
63 | #include "qsize.h" | 66 | #include "qsize.h" |
64 | #include "qvaluelist.h" | 67 | #include "qvaluelist.h" |
65 | #include "qvaluestack.h" | 68 | #include "qvaluestack.h" |
66 | #include "qobject.h" | 69 | #include "qobject.h" |
67 | #include "qdict.h" | 70 | #include "qdict.h" |
68 | #include "qtextstream.h" | 71 | #include "qtextstream.h" |
69 | #include "qpixmap.h" | 72 | #include "qpixmap.h" |
70 | #include "qstylesheet.h" | 73 | #include "qstylesheet.h" |
71 | #include "qvector.h" | 74 | #include "qvector.h" |
72 | #include "qpainter.h" | 75 | #include "qpainter.h" |
73 | #include "qlayout.h" | 76 | #include "qlayout.h" |
74 | #include "qobject.h" | 77 | #include "qobject.h" |
75 | #include "qcomplextext_p.h" | 78 | #include "qcomplextext_p.h" |
76 | #include "qapplication.h" | 79 | #include "qapplication.h" |
@@ -103,70 +106,70 @@ public: | |||
103 | // this is never called, initialize variables in QTextString::insert()!!! | 106 | // this is never called, initialize variables in QTextString::insert()!!! |
104 | QTextStringChar() : lineStart( 0 ), type( Regular ), startOfRun( 0 ) {d.format=0;} | 107 | QTextStringChar() : lineStart( 0 ), type( Regular ), startOfRun( 0 ) {d.format=0;} |
105 | ~QTextStringChar(); | 108 | ~QTextStringChar(); |
106 | 109 | ||
107 | QChar c; | 110 | QChar c; |
108 | enum Type { Regular=0, Custom=1, Anchor=2, CustomAnchor=3 }; | 111 | enum Type { Regular=0, Custom=1, Anchor=2, CustomAnchor=3 }; |
109 | uint lineStart : 1; | 112 | uint lineStart : 1; |
110 | uint rightToLeft : 1; | 113 | uint rightToLeft : 1; |
111 | uint hasCursor : 1; | 114 | uint hasCursor : 1; |
112 | uint canBreak : 1; | 115 | uint canBreak : 1; |
113 | Type type : 2; | 116 | Type type : 2; |
114 | uint startOfRun : 1; | 117 | uint startOfRun : 1; |
115 | 118 | ||
116 | int x; | 119 | int x; |
117 | int height() const; | 120 | int height() const; |
118 | int ascent() const; | 121 | int ascent() const; |
119 | int descent() const; | 122 | int descent() const; |
120 | bool isCustom() const { return (type & Custom) != 0; } | 123 | bool isCustom() const { return (type & Custom) != 0; } |
121 | QTextFormat *format() const; | 124 | QTextFormat *format() const; |
122 | QTextCustomItem *customItem() const; | 125 | QTextCustomItem *customItem() const; |
123 | void setFormat( QTextFormat *f ); | 126 | void setFormat( QTextFormat *f ); |
124 | void setCustomItem( QTextCustomItem *i ); | 127 | void setCustomItem( QTextCustomItem *i ); |
125 | struct CustomData | 128 | struct CustomData |
126 | { | 129 | { |
127 | QTextFormat *format; | 130 | QTextFormat *format; |
128 | QTextCustomItem *custom; | 131 | QTextCustomItem *custom; |
129 | QString anchorName; | 132 | QString anchorName; |
130 | QString anchorHref; | 133 | QString anchorHref; |
131 | }; | 134 | }; |
132 | 135 | ||
133 | void loseCustomItem(); | 136 | void loseCustomItem(); |
134 | 137 | ||
135 | union { | 138 | union { |
136 | QTextFormat* format; | 139 | QTextFormat* format; |
137 | CustomData* custom; | 140 | CustomData* custom; |
138 | } d; | 141 | } d; |
139 | 142 | ||
140 | bool isAnchor() const { return ( type & Anchor) != 0; } | 143 | bool isAnchor() const { return ( type & Anchor) != 0; } |
141 | QString anchorName() const; | 144 | QString anchorName() const; |
142 | QString anchorHref() const; | 145 | QString anchorHref() const; |
143 | void setAnchor( const QString& name, const QString& href ); | 146 | void setAnchor( const QString& name, const QString& href ); |
144 | 147 | ||
145 | private: | 148 | private: |
146 | QTextStringChar &operator=( const QTextStringChar & ) { | 149 | QTextStringChar &operator=( const QTextStringChar & ) { |
147 | //abort(); | 150 | //abort(); |
148 | return *this; | 151 | return *this; |
149 | } | 152 | } |
150 | friend class QComplexText; | 153 | friend class QComplexText; |
151 | friend class QTextParagraph; | 154 | friend class QTextParagraph; |
152 | }; | 155 | }; |
153 | 156 | ||
154 | #if defined(Q_TEMPLATEDLL) | 157 | #if defined(Q_TEMPLATEDLL) |
155 | // MOC_SKIP_BEGIN | 158 | // MOC_SKIP_BEGIN |
156 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<QTextStringChar>; | 159 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<QTextStringChar>; |
157 | // MOC_SKIP_END | 160 | // MOC_SKIP_END |
158 | #endif | 161 | #endif |
159 | 162 | ||
160 | class Q_EXPORT QTextString | 163 | class Q_EXPORT QTextString |
161 | { | 164 | { |
162 | public: | 165 | public: |
163 | 166 | ||
164 | QTextString(); | 167 | QTextString(); |
165 | QTextString( const QTextString &s ); | 168 | QTextString( const QTextString &s ); |
166 | virtual ~QTextString(); | 169 | virtual ~QTextString(); |
167 | 170 | ||
168 | static QString toString( const QMemArray<QTextStringChar> &data ); | 171 | static QString toString( const QMemArray<QTextStringChar> &data ); |
169 | QString toString() const; | 172 | QString toString() const; |
170 | 173 | ||
171 | QTextStringChar &at( int i ) const; | 174 | QTextStringChar &at( int i ) const; |
172 | int length() const; | 175 | int length() const; |
@@ -187,56 +190,56 @@ public: | |||
187 | bool isRightToLeft() const; | 190 | bool isRightToLeft() const; |
188 | QChar::Direction direction() const; | 191 | QChar::Direction direction() const; |
189 | void setDirection( QChar::Direction d ) { dir = d; bidiDirty = TRUE; } | 192 | void setDirection( QChar::Direction d ) { dir = d; bidiDirty = TRUE; } |
190 | 193 | ||
191 | QMemArray<QTextStringChar> subString( int start = 0, int len = 0xFFFFFF ) const; | 194 | QMemArray<QTextStringChar> subString( int start = 0, int len = 0xFFFFFF ) const; |
192 | QMemArray<QTextStringChar> rawData() const { return data; } | 195 | QMemArray<QTextStringChar> rawData() const { return data; } |
193 | 196 | ||
194 | void operator=( const QString &s ) { clear(); insert( 0, s, 0 ); } | 197 | void operator=( const QString &s ) { clear(); insert( 0, s, 0 ); } |
195 | void operator+=( const QString &s ) {insert( length(), s, 0 ); } | 198 | void operator+=( const QString &s ) {insert( length(), s, 0 ); } |
196 | void prepend( const QString &s ) { insert( 0, s, 0 ); } | 199 | void prepend( const QString &s ) { insert( 0, s, 0 ); } |
197 | 200 | ||
198 | private: | 201 | private: |
199 | void checkBidi() const; | 202 | void checkBidi() const; |
200 | 203 | ||
201 | QMemArray<QTextStringChar> data; | 204 | QMemArray<QTextStringChar> data; |
202 | uint bidiDirty : 1; | 205 | uint bidiDirty : 1; |
203 | uint bidi : 1; // true when the paragraph has right to left characters | 206 | uint bidi : 1; // true when the paragraph has right to left characters |
204 | uint rightToLeft : 1; | 207 | uint rightToLeft : 1; |
205 | uint dir : 5; | 208 | uint dir : 5; |
206 | }; | 209 | }; |
207 | 210 | ||
208 | inline bool QTextString::isBidi() const | 211 | inline bool QTextString::isBidi() const |
209 | { | 212 | { |
210 | if ( bidiDirty ) | 213 | if ( bidiDirty ) |
211 | checkBidi(); | 214 | checkBidi(); |
212 | return bidi; | 215 | return bidi; |
213 | } | 216 | } |
214 | 217 | ||
215 | inline bool QTextString::isRightToLeft() const | 218 | inline bool QTextString::isRightToLeft() const |
216 | { | 219 | { |
217 | if ( bidiDirty ) | 220 | if ( bidiDirty ) |
218 | checkBidi(); | 221 | checkBidi(); |
219 | return rightToLeft; | 222 | return rightToLeft; |
220 | } | 223 | } |
221 | 224 | ||
222 | inline QChar::Direction QTextString::direction() const | 225 | inline QChar::Direction QTextString::direction() const |
223 | { | 226 | { |
224 | return (QChar::Direction) dir; | 227 | return (QChar::Direction) dir; |
225 | } | 228 | } |
226 | 229 | ||
227 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 230 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
228 | 231 | ||
229 | #if defined(Q_TEMPLATEDLL) | 232 | #if defined(Q_TEMPLATEDLL) |
230 | // MOC_SKIP_BEGIN | 233 | // MOC_SKIP_BEGIN |
231 | Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<int>; | 234 | Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<int>; |
232 | Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<QTextParagraph*>; | 235 | Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<QTextParagraph*>; |
233 | Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<bool>; | 236 | Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<bool>; |
234 | // MOC_SKIP_END | 237 | // MOC_SKIP_END |
235 | #endif | 238 | #endif |
236 | 239 | ||
237 | class Q_EXPORT QTextCursor | 240 | class Q_EXPORT QTextCursor |
238 | { | 241 | { |
239 | public: | 242 | public: |
240 | QTextCursor( QTextDocument *d = 0 ); | 243 | QTextCursor( QTextDocument *d = 0 ); |
241 | QTextCursor( const QTextCursor &c ); | 244 | QTextCursor( const QTextCursor &c ); |
242 | QTextCursor &operator=( const QTextCursor &c ); | 245 | QTextCursor &operator=( const QTextCursor &c ); |
@@ -363,49 +366,49 @@ public: | |||
363 | 366 | ||
364 | void setUndoDepth( int d ) { steps = d; } | 367 | void setUndoDepth( int d ) { steps = d; } |
365 | int undoDepth() const { return steps; } | 368 | int undoDepth() const { return steps; } |
366 | 369 | ||
367 | int historySize() const { return history.count(); } | 370 | int historySize() const { return history.count(); } |
368 | int currentPosition() const { return current; } | 371 | int currentPosition() const { return current; } |
369 | 372 | ||
370 | private: | 373 | private: |
371 | QPtrList<QTextCommand> history; | 374 | QPtrList<QTextCommand> history; |
372 | int current, steps; | 375 | int current, steps; |
373 | 376 | ||
374 | }; | 377 | }; |
375 | 378 | ||
376 | inline QTextCommandHistory::~QTextCommandHistory() | 379 | inline QTextCommandHistory::~QTextCommandHistory() |
377 | { | 380 | { |
378 | clear(); | 381 | clear(); |
379 | } | 382 | } |
380 | 383 | ||
381 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 384 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
382 | 385 | ||
383 | class Q_EXPORT QTextCustomItem | 386 | class Q_EXPORT QTextCustomItem |
384 | { | 387 | { |
385 | public: | 388 | public: |
386 | QTextCustomItem( QTextDocument *p ) | 389 | QTextCustomItem( QTextDocument *p ) |
387 | : xpos(0), ypos(-1), width(-1), height(0), parent( p ) | 390 | : xpos(0), ypos(-1), width(-1), height(0), parent( p ) |
388 | {} | 391 | {} |
389 | virtual ~QTextCustomItem(); | 392 | virtual ~QTextCustomItem(); |
390 | virtual void draw(QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ) = 0; | 393 | virtual void draw(QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ) = 0; |
391 | 394 | ||
392 | virtual void adjustToPainter( QPainter* ); | 395 | virtual void adjustToPainter( QPainter* ); |
393 | 396 | ||
394 | enum Placement { PlaceInline = 0, PlaceLeft, PlaceRight }; | 397 | enum Placement { PlaceInline = 0, PlaceLeft, PlaceRight }; |
395 | virtual Placement placement() const; | 398 | virtual Placement placement() const; |
396 | bool placeInline() { return placement() == PlaceInline; } | 399 | bool placeInline() { return placement() == PlaceInline; } |
397 | 400 | ||
398 | virtual bool ownLine() const; | 401 | virtual bool ownLine() const; |
399 | virtual void resize( int nwidth ); | 402 | virtual void resize( int nwidth ); |
400 | virtual void invalidate(); | 403 | virtual void invalidate(); |
401 | virtual int ascent() const { return height; } | 404 | virtual int ascent() const { return height; } |
402 | 405 | ||
403 | virtual bool isNested() const; | 406 | virtual bool isNested() const; |
404 | virtual int minimumWidth() const; | 407 | virtual int minimumWidth() const; |
405 | 408 | ||
406 | virtual QString richText() const; | 409 | virtual QString richText() const; |
407 | 410 | ||
408 | int xpos; // used for floating items | 411 | int xpos; // used for floating items |
409 | int ypos; // used for floating items | 412 | int ypos; // used for floating items |
410 | int width; | 413 | int width; |
411 | int height; | 414 | int height; |
@@ -417,74 +420,74 @@ public: | |||
417 | virtual bool next( QTextCursor *, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); | 420 | virtual bool next( QTextCursor *, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); |
418 | virtual bool prev( QTextCursor *, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); | 421 | virtual bool prev( QTextCursor *, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); |
419 | virtual bool down( QTextCursor *, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); | 422 | virtual bool down( QTextCursor *, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); |
420 | virtual bool up( QTextCursor *, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); | 423 | virtual bool up( QTextCursor *, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); |
421 | 424 | ||
422 | void setParagraph( QTextParagraph *p ) { parag = p; } | 425 | void setParagraph( QTextParagraph *p ) { parag = p; } |
423 | QTextParagraph *paragraph() const { return parag; } | 426 | QTextParagraph *paragraph() const { return parag; } |
424 | 427 | ||
425 | QTextDocument *parent; | 428 | QTextDocument *parent; |
426 | QTextParagraph *parag; | 429 | QTextParagraph *parag; |
427 | 430 | ||
428 | virtual void pageBreak( int y, QTextFlow* flow ); | 431 | virtual void pageBreak( int y, QTextFlow* flow ); |
429 | }; | 432 | }; |
430 | 433 | ||
431 | #if defined(Q_TEMPLATEDLL) | 434 | #if defined(Q_TEMPLATEDLL) |
432 | // MOC_SKIP_BEGIN | 435 | // MOC_SKIP_BEGIN |
433 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<QString, QString>; | 436 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<QString, QString>; |
434 | // MOC_SKIP_END | 437 | // MOC_SKIP_END |
435 | #endif | 438 | #endif |
436 | 439 | ||
437 | class Q_EXPORT QTextImage : public QTextCustomItem | 440 | class Q_EXPORT QTextImage : public QTextCustomItem |
438 | { | 441 | { |
439 | public: | 442 | public: |
440 | QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, | 443 | QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, |
441 | QMimeSourceFactory &factory ); | 444 | QMimeSourceFactory &factory ); |
442 | virtual ~QTextImage(); | 445 | virtual ~QTextImage(); |
443 | 446 | ||
444 | Placement placement() const { return place; } | 447 | Placement placement() const { return place; } |
445 | void adjustToPainter( QPainter* ); | 448 | void adjustToPainter( QPainter* ); |
446 | int minimumWidth() const { return width; } | 449 | int minimumWidth() const { return width; } |
447 | 450 | ||
448 | QString richText() const; | 451 | QString richText() const; |
449 | 452 | ||
450 | void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ); | 453 | void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ); |
451 | 454 | ||
452 | private: | 455 | private: |
453 | QRegion* reg; | 456 | QRegion* reg; |
454 | QPixmap pm; | 457 | QPixmap pm; |
455 | Placement place; | 458 | Placement place; |
456 | int tmpwidth, tmpheight; | 459 | int tmpwidth, tmpheight; |
457 | QMap<QString, QString> attributes; | 460 | QMap<QString, QString> attributes; |
458 | QString imgId; | 461 | QString imgId; |
459 | 462 | ||
460 | }; | 463 | }; |
461 | 464 | ||
462 | class Q_EXPORT QTextHorizontalLine : public QTextCustomItem | 465 | class Q_EXPORT QTextHorizontalLine : public QTextCustomItem |
463 | { | 466 | { |
464 | public: | 467 | public: |
465 | QTextHorizontalLine( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, | 468 | QTextHorizontalLine( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, |
466 | QMimeSourceFactory &factory ); | 469 | QMimeSourceFactory &factory ); |
467 | virtual ~QTextHorizontalLine(); | 470 | virtual ~QTextHorizontalLine(); |
468 | 471 | ||
469 | void adjustToPainter( QPainter* ); | 472 | void adjustToPainter( QPainter* ); |
470 | void draw(QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ); | 473 | void draw(QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ); |
471 | QString richText() const; | 474 | QString richText() const; |
472 | 475 | ||
473 | bool ownLine() const { return TRUE; } | 476 | bool ownLine() const { return TRUE; } |
474 | 477 | ||
475 | private: | 478 | private: |
476 | int tmpheight; | 479 | int tmpheight; |
477 | QColor color; | 480 | QColor color; |
478 | 481 | ||
479 | }; | 482 | }; |
480 | 483 | ||
481 | #if defined(Q_TEMPLATEDLL) | 484 | #if defined(Q_TEMPLATEDLL) |
482 | // MOC_SKIP_BEGIN | 485 | // MOC_SKIP_BEGIN |
483 | Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextCustomItem>; | 486 | Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextCustomItem>; |
484 | // MOC_SKIP_END | 487 | // MOC_SKIP_END |
485 | #endif | 488 | #endif |
486 | 489 | ||
487 | class Q_EXPORT QTextFlow | 490 | class Q_EXPORT QTextFlow |
488 | { | 491 | { |
489 | friend class QTextDocument; | 492 | friend class QTextDocument; |
490 | friend class QTextTableCell; | 493 | friend class QTextTableCell; |
@@ -511,53 +514,53 @@ public: | |||
511 | 514 | ||
512 | virtual bool isEmpty(); | 515 | virtual bool isEmpty(); |
513 | 516 | ||
514 | void clear(); | 517 | void clear(); |
515 | 518 | ||
516 | private: | 519 | private: |
517 | int w; | 520 | int w; |
518 | int pagesize; | 521 | int pagesize; |
519 | 522 | ||
520 | QPtrList<QTextCustomItem> leftItems; | 523 | QPtrList<QTextCustomItem> leftItems; |
521 | QPtrList<QTextCustomItem> rightItems; | 524 | QPtrList<QTextCustomItem> rightItems; |
522 | 525 | ||
523 | }; | 526 | }; |
524 | 527 | ||
525 | inline int QTextFlow::width() const { return w; } | 528 | inline int QTextFlow::width() const { return w; } |
526 | 529 | ||
527 | class QTextTable; | 530 | class QTextTable; |
528 | 531 | ||
529 | class Q_EXPORT QTextTableCell : public QLayoutItem | 532 | class Q_EXPORT QTextTableCell : public QLayoutItem |
530 | { | 533 | { |
531 | friend class QTextTable; | 534 | friend class QTextTable; |
532 | 535 | ||
533 | public: | 536 | public: |
534 | QTextTableCell( QTextTable* table, | 537 | QTextTableCell( QTextTable* table, |
535 | int row, int column, | 538 | int row, int column, |
536 | const QMap<QString, QString> &attr, | 539 | const QMap<QString, QString> &attr, |
537 | const QStyleSheetItem* style, | 540 | const QStyleSheetItem* style, |
538 | const QTextFormat& fmt, const QString& context, | 541 | const QTextFormat& fmt, const QString& context, |
539 | QMimeSourceFactory &factory, QStyleSheet *sheet, const QString& doc ); | 542 | QMimeSourceFactory &factory, QStyleSheet *sheet, const QString& doc ); |
540 | virtual ~QTextTableCell(); | 543 | virtual ~QTextTableCell(); |
541 | 544 | ||
542 | QSize sizeHint() const ; | 545 | QSize sizeHint() const ; |
543 | QSize minimumSize() const ; | 546 | QSize minimumSize() const ; |
544 | QSize maximumSize() const ; | 547 | QSize maximumSize() const ; |
545 | QSizePolicy::ExpandData expanding() const; | 548 | QSizePolicy::ExpandData expanding() const; |
546 | bool isEmpty() const; | 549 | bool isEmpty() const; |
547 | void setGeometry( const QRect& ) ; | 550 | void setGeometry( const QRect& ) ; |
548 | QRect geometry() const; | 551 | QRect geometry() const; |
549 | 552 | ||
550 | bool hasHeightForWidth() const; | 553 | bool hasHeightForWidth() const; |
551 | int heightForWidth( int ) const; | 554 | int heightForWidth( int ) const; |
552 | 555 | ||
553 | void adjustToPainter( QPainter* ); | 556 | void adjustToPainter( QPainter* ); |
554 | 557 | ||
555 | int row() const { return row_; } | 558 | int row() const { return row_; } |
556 | int column() const { return col_; } | 559 | int column() const { return col_; } |
557 | int rowspan() const { return rowspan_; } | 560 | int rowspan() const { return rowspan_; } |
558 | int colspan() const { return colspan_; } | 561 | int colspan() const { return colspan_; } |
559 | int stretch() const { return stretch_; } | 562 | int stretch() const { return stretch_; } |
560 | 563 | ||
561 | QTextDocument* richText() const { return richtext; } | 564 | QTextDocument* richText() const { return richtext; } |
562 | QTextTable* table() const { return parent; } | 565 | QTextTable* table() const { return parent; } |
563 | 566 | ||
@@ -585,49 +588,49 @@ private: | |||
585 | int cached_width; | 588 | int cached_width; |
586 | int cached_sizehint; | 589 | int cached_sizehint; |
587 | QMap<QString, QString> attributes; | 590 | QMap<QString, QString> attributes; |
588 | int align; | 591 | int align; |
589 | }; | 592 | }; |
590 | 593 | ||
591 | #if defined(Q_TEMPLATEDLL) | 594 | #if defined(Q_TEMPLATEDLL) |
592 | // MOC_SKIP_BEGIN | 595 | // MOC_SKIP_BEGIN |
593 | Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextTableCell>; | 596 | Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextTableCell>; |
594 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<QTextCursor*, int>; | 597 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<QTextCursor*, int>; |
595 | // MOC_SKIP_END | 598 | // MOC_SKIP_END |
596 | #endif | 599 | #endif |
597 | 600 | ||
598 | class Q_EXPORT QTextTable: public QTextCustomItem | 601 | class Q_EXPORT QTextTable: public QTextCustomItem |
599 | { | 602 | { |
600 | friend class QTextTableCell; | 603 | friend class QTextTableCell; |
601 | 604 | ||
602 | public: | 605 | public: |
603 | QTextTable( QTextDocument *p, const QMap<QString, QString> &attr ); | 606 | QTextTable( QTextDocument *p, const QMap<QString, QString> &attr ); |
604 | virtual ~QTextTable(); | 607 | virtual ~QTextTable(); |
605 | 608 | ||
606 | void adjustToPainter( QPainter *p ); | 609 | void adjustToPainter( QPainter *p ); |
607 | void pageBreak( int y, QTextFlow* flow ); | 610 | void pageBreak( int y, QTextFlow* flow ); |
608 | void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, | 611 | void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, |
609 | const QColorGroup& cg, bool selected ); | 612 | const QColorGroup& cg, bool selected ); |
610 | 613 | ||
611 | bool noErase() const { return TRUE; } | 614 | bool noErase() const { return TRUE; } |
612 | bool ownLine() const { return TRUE; } | 615 | bool ownLine() const { return TRUE; } |
613 | Placement placement() const { return place; } | 616 | Placement placement() const { return place; } |
614 | bool isNested() const { return TRUE; } | 617 | bool isNested() const { return TRUE; } |
615 | void resize( int nwidth ); | 618 | void resize( int nwidth ); |
616 | virtual void invalidate(); | 619 | virtual void invalidate(); |
617 | 620 | ||
618 | virtual bool enter( QTextCursor *c, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy, bool atEnd = FALSE ); | 621 | virtual bool enter( QTextCursor *c, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy, bool atEnd = FALSE ); |
619 | virtual bool enterAt( QTextCursor *c, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy, const QPoint &pos ); | 622 | virtual bool enterAt( QTextCursor *c, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy, const QPoint &pos ); |
620 | virtual bool next( QTextCursor *c, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); | 623 | virtual bool next( QTextCursor *c, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); |
621 | virtual bool prev( QTextCursor *c, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); | 624 | virtual bool prev( QTextCursor *c, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); |
622 | virtual bool down( QTextCursor *c, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); | 625 | virtual bool down( QTextCursor *c, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); |
623 | virtual bool up( QTextCursor *c, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); | 626 | virtual bool up( QTextCursor *c, QTextDocument *&doc, QTextParagraph *¶g, int &idx, int &ox, int &oy ); |
624 | 627 | ||
625 | QString richText() const; | 628 | QString richText() const; |
626 | 629 | ||
627 | int minimumWidth() const; | 630 | int minimumWidth() const; |
628 | 631 | ||
629 | QPtrList<QTextTableCell> tableCells() const { return cells; } | 632 | QPtrList<QTextTableCell> tableCells() const { return cells; } |
630 | 633 | ||
631 | bool isStretching() const { return stretch; } | 634 | bool isStretching() const { return stretch; } |
632 | 635 | ||
633 | private: | 636 | private: |
@@ -663,51 +666,51 @@ struct Q_EXPORT QTextDocumentSelection | |||
663 | QTextCursor startCursor, endCursor; | 666 | QTextCursor startCursor, endCursor; |
664 | bool swapped; | 667 | bool swapped; |
665 | }; | 668 | }; |
666 | 669 | ||
667 | #if defined(Q_TEMPLATEDLL) | 670 | #if defined(Q_TEMPLATEDLL) |
668 | // MOC_SKIP_BEGIN | 671 | // MOC_SKIP_BEGIN |
669 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QColor>; | 672 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QColor>; |
670 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, bool>; | 673 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, bool>; |
671 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextDocumentSelection>; | 674 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextDocumentSelection>; |
672 | Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextDocument>; | 675 | Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextDocument>; |
673 | // MOC_SKIP_END | 676 | // MOC_SKIP_END |
674 | #endif | 677 | #endif |
675 | 678 | ||
676 | class Q_EXPORT QTextDocument : public QObject | 679 | class Q_EXPORT QTextDocument : public QObject |
677 | { | 680 | { |
678 | Q_OBJECT | 681 | Q_OBJECT |
679 | 682 | ||
680 | friend class QTextTableCell; | 683 | friend class QTextTableCell; |
681 | friend class QTextCursor; | 684 | friend class QTextCursor; |
682 | friend class QTextEdit; | 685 | friend class QTextEdit; |
683 | friend class QTextParagraph; | 686 | friend class QTextParagraph; |
684 | 687 | ||
685 | public: | 688 | public: |
686 | enum SelectionIds { | 689 | enum SelectionIds { |
687 | Standard = 0, | 690 | Standard = 0, |
688 | Temp = 32000 // This selection must not be drawn, it's used e.g. by undo/redo to | 691 | Temp = 32000 // This selection must not be drawn, it's used e.g. by undo/redo to |
689 | // remove multiple lines with removeSelectedText() | 692 | // remove multiple lines with removeSelectedText() |
690 | }; | 693 | }; |
691 | 694 | ||
692 | QTextDocument( QTextDocument *p ); | 695 | QTextDocument( QTextDocument *p ); |
693 | QTextDocument( QTextDocument *d, QTextFormatCollection *f ); | 696 | QTextDocument( QTextDocument *d, QTextFormatCollection *f ); |
694 | virtual ~QTextDocument(); | 697 | virtual ~QTextDocument(); |
695 | 698 | ||
696 | QTextDocument *parent() const { return par; } | 699 | QTextDocument *parent() const { return par; } |
697 | QTextParagraph *parentParagraph() const { return parentPar; } | 700 | QTextParagraph *parentParagraph() const { return parentPar; } |
698 | 701 | ||
699 | void setText( const QString &text, const QString &context ); | 702 | void setText( const QString &text, const QString &context ); |
700 | QMap<QString, QString> attributes() const { return attribs; } | 703 | QMap<QString, QString> attributes() const { return attribs; } |
701 | void setAttributes( const QMap<QString, QString> &attr ) { attribs = attr; } | 704 | void setAttributes( const QMap<QString, QString> &attr ) { attribs = attr; } |
702 | 705 | ||
703 | QString text() const; | 706 | QString text() const; |
704 | QString text( int parag ) const; | 707 | QString text( int parag ) const; |
705 | QString originalText() const; | 708 | QString originalText() const; |
706 | 709 | ||
707 | int x() const; | 710 | int x() const; |
708 | int y() const; | 711 | int y() const; |
709 | int width() const; | 712 | int width() const; |
710 | int widthUsed() const; | 713 | int widthUsed() const; |
711 | int visibleWidth() const; | 714 | int visibleWidth() const; |
712 | int height() const; | 715 | int height() const; |
713 | void setWidth( int w ); | 716 | void setWidth( int w ); |
@@ -770,53 +773,53 @@ public: | |||
770 | 773 | ||
771 | void setTextFormat( Qt::TextFormat f ); | 774 | void setTextFormat( Qt::TextFormat f ); |
772 | Qt::TextFormat textFormat() const; | 775 | Qt::TextFormat textFormat() const; |
773 | 776 | ||
774 | bool inSelection( int selId, const QPoint &pos ) const; | 777 | bool inSelection( int selId, const QPoint &pos ) const; |
775 | 778 | ||
776 | QStyleSheet *styleSheet() const { return sheet_; } | 779 | QStyleSheet *styleSheet() const { return sheet_; } |
777 | QMimeSourceFactory *mimeSourceFactory() const { return factory_; } | 780 | QMimeSourceFactory *mimeSourceFactory() const { return factory_; } |
778 | QString context() const { return contxt; } | 781 | QString context() const { return contxt; } |
779 | 782 | ||
780 | void setStyleSheet( QStyleSheet *s ); | 783 | void setStyleSheet( QStyleSheet *s ); |
781 | void setDefaultFormat( const QFont &font, const QColor &color ); | 784 | void setDefaultFormat( const QFont &font, const QColor &color ); |
782 | void setMimeSourceFactory( QMimeSourceFactory *f ) { if ( f ) factory_ = f; } | 785 | void setMimeSourceFactory( QMimeSourceFactory *f ) { if ( f ) factory_ = f; } |
783 | void setContext( const QString &c ) { if ( !c.isEmpty() ) contxt = c; } | 786 | void setContext( const QString &c ) { if ( !c.isEmpty() ) contxt = c; } |
784 | 787 | ||
785 | void setUnderlineLinks( bool b ); | 788 | void setUnderlineLinks( bool b ); |
786 | bool underlineLinks() const { return underlLinks; } | 789 | bool underlineLinks() const { return underlLinks; } |
787 | 790 | ||
788 | void setPaper( QBrush *brush ) { if ( backBrush ) delete backBrush; backBrush = brush; } | 791 | void setPaper( QBrush *brush ) { if ( backBrush ) delete backBrush; backBrush = brush; } |
789 | QBrush *paper() const { return backBrush; } | 792 | QBrush *paper() const { return backBrush; } |
790 | 793 | ||
791 | void doLayout( QPainter *p, int w ); | 794 | void doLayout( QPainter *p, int w ); |
792 | void draw( QPainter *p, const QRect& rect, const QColorGroup &cg, const QBrush *paper = 0 ); | 795 | void draw( QPainter *p, const QRect& rect, const QColorGroup &cg, const QBrush *paper = 0 ); |
793 | void drawParagraph( QPainter *p, QTextParagraph *parag, int cx, int cy, int cw, int ch, | 796 | void drawParagraph( QPainter *p, QTextParagraph *parag, int cx, int cy, int cw, int ch, |
794 | QPixmap *&doubleBuffer, const QColorGroup &cg, | 797 | QPixmap *&doubleBuffer, const QColorGroup &cg, |
795 | bool drawCursor, QTextCursor *cursor, bool resetChanged = TRUE ); | 798 | bool drawCursor, QTextCursor *cursor, bool resetChanged = TRUE ); |
796 | QTextParagraph *draw( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg, | 799 | QTextParagraph *draw( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg, |
797 | bool onlyChanged = FALSE, bool drawCursor = FALSE, QTextCursor *cursor = 0, | 800 | bool onlyChanged = FALSE, bool drawCursor = FALSE, QTextCursor *cursor = 0, |
798 | bool resetChanged = TRUE ); | 801 | bool resetChanged = TRUE ); |
799 | 802 | ||
800 | void registerCustomItem( QTextCustomItem *i, QTextParagraph *p ); | 803 | void registerCustomItem( QTextCustomItem *i, QTextParagraph *p ); |
801 | void unregisterCustomItem( QTextCustomItem *i, QTextParagraph *p ); | 804 | void unregisterCustomItem( QTextCustomItem *i, QTextParagraph *p ); |
802 | 805 | ||
803 | void setFlow( QTextFlow *f ); | 806 | void setFlow( QTextFlow *f ); |
804 | void takeFlow(); | 807 | void takeFlow(); |
805 | QTextFlow *flow() const { return flow_; } | 808 | QTextFlow *flow() const { return flow_; } |
806 | bool isPageBreakEnabled() const { return pages; } | 809 | bool isPageBreakEnabled() const { return pages; } |
807 | void setPageBreakEnabled( bool b ) { pages = b; } | 810 | void setPageBreakEnabled( bool b ) { pages = b; } |
808 | 811 | ||
809 | void setUseFormatCollection( bool b ) { useFC = b; } | 812 | void setUseFormatCollection( bool b ) { useFC = b; } |
810 | bool useFormatCollection() const { return useFC; } | 813 | bool useFormatCollection() const { return useFC; } |
811 | 814 | ||
812 | QTextTableCell *tableCell() const { return tc; } | 815 | QTextTableCell *tableCell() const { return tc; } |
813 | void setTableCell( QTextTableCell *c ) { tc = c; } | 816 | void setTableCell( QTextTableCell *c ) { tc = c; } |
814 | 817 | ||
815 | void setPlainText( const QString &text ); | 818 | void setPlainText( const QString &text ); |
816 | void setRichText( const QString &text, const QString &context ); | 819 | void setRichText( const QString &text, const QString &context ); |
817 | QString richText() const; | 820 | QString richText() const; |
818 | QString plainText() const; | 821 | QString plainText() const; |
819 | 822 | ||
820 | bool focusNextPrevChild( bool next ); | 823 | bool focusNextPrevChild( bool next ); |
821 | 824 | ||
822 | int alignment() const; | 825 | int alignment() const; |
@@ -837,64 +840,64 @@ public: | |||
837 | void insertChild( QObject *o ) { QObject::insertChild( o ); } | 840 | void insertChild( QObject *o ) { QObject::insertChild( o ); } |
838 | void removeChild( QObject *o ) { QObject::removeChild( o ); } | 841 | void removeChild( QObject *o ) { QObject::removeChild( o ); } |
839 | void insertChild( QTextDocument *d ) { childList.append( d ); } | 842 | void insertChild( QTextDocument *d ) { childList.append( d ); } |
840 | void removeChild( QTextDocument *d ) { childList.removeRef( d ); } | 843 | void removeChild( QTextDocument *d ) { childList.removeRef( d ); } |
841 | QPtrList<QTextDocument> children() const { return childList; } | 844 | QPtrList<QTextDocument> children() const { return childList; } |
842 | 845 | ||
843 | bool hasFocusParagraph() const; | 846 | bool hasFocusParagraph() const; |
844 | QString focusHref() const; | 847 | QString focusHref() const; |
845 | 848 | ||
846 | void invalidateOriginalText() { oTextValid = FALSE; oText = ""; } | 849 | void invalidateOriginalText() { oTextValid = FALSE; oText = ""; } |
847 | 850 | ||
848 | static QString section( QString str, const QString &sep, int start, int end = 0xffffffff ); | 851 | static QString section( QString str, const QString &sep, int start, int end = 0xffffffff ); |
849 | static bool endsWith( QString str, const QString &s); | 852 | static bool endsWith( QString str, const QString &s); |
850 | 853 | ||
851 | signals: | 854 | signals: |
852 | void minimumWidthChanged( int ); | 855 | void minimumWidthChanged( int ); |
853 | 856 | ||
854 | private: | 857 | private: |
855 | void init(); | 858 | void init(); |
856 | QPixmap *bufferPixmap( const QSize &s ); | 859 | QPixmap *bufferPixmap( const QSize &s ); |
857 | // HTML parser | 860 | // HTML parser |
858 | bool hasPrefix(const QChar* doc, int length, int pos, QChar c); | 861 | bool hasPrefix(const QChar* doc, int length, int pos, QChar c); |
859 | bool hasPrefix(const QChar* doc, int length, int pos, const QString& s); | 862 | bool hasPrefix(const QChar* doc, int length, int pos, const QString& s); |
860 | QTextCustomItem* parseTable( const QMap<QString, QString> &attr, const QTextFormat &fmt, | 863 | QTextCustomItem* parseTable( const QMap<QString, QString> &attr, const QTextFormat &fmt, |
861 | const QChar* doc, int length, int& pos, QTextParagraph *curpar ); | 864 | const QChar* doc, int length, int& pos, QTextParagraph *curpar ); |
862 | bool eatSpace(const QChar* doc, int length, int& pos, bool includeNbsp = FALSE ); | 865 | bool eatSpace(const QChar* doc, int length, int& pos, bool includeNbsp = FALSE ); |
863 | bool eat(const QChar* doc, int length, int& pos, QChar c); | 866 | bool eat(const QChar* doc, int length, int& pos, QChar c); |
864 | QString parseOpenTag(const QChar* doc, int length, int& pos, QMap<QString, QString> &attr, bool& emptyTag); | 867 | QString parseOpenTag(const QChar* doc, int length, int& pos, QMap<QString, QString> &attr, bool& emptyTag); |
865 | QString parseCloseTag( const QChar* doc, int length, int& pos ); | 868 | QString parseCloseTag( const QChar* doc, int length, int& pos ); |
866 | QChar parseHTMLSpecialChar(const QChar* doc, int length, int& pos); | 869 | QChar parseHTMLSpecialChar(const QChar* doc, int length, int& pos); |
867 | QString parseWord(const QChar* doc, int length, int& pos, bool lower = TRUE); | 870 | QString parseWord(const QChar* doc, int length, int& pos, bool lower = TRUE); |
868 | QChar parseChar(const QChar* doc, int length, int& pos, QStyleSheetItem::WhiteSpaceMode wsm ); | 871 | QChar parseChar(const QChar* doc, int length, int& pos, QStyleSheetItem::WhiteSpaceMode wsm ); |
869 | void setRichTextInternal( const QString &text, QTextCursor* cursor = 0 ); | 872 | void setRichTextInternal( const QString &text, QTextCursor* cursor = 0 ); |
870 | void setRichTextMarginsInternal( QPtrList< QPtrVector<QStyleSheetItem> >& styles, QTextParagraph* stylesPar ); | 873 | void setRichTextMarginsInternal( QPtrList< QPtrVector<QStyleSheetItem> >& styles, QTextParagraph* stylesPar ); |
871 | 874 | ||
872 | private: | 875 | private: |
873 | struct Q_EXPORT Focus { | 876 | struct Q_EXPORT Focus { |
874 | QTextParagraph *parag; | 877 | QTextParagraph *parag; |
875 | int start, len; | 878 | int start, len; |
876 | QString href; | 879 | QString href; |
877 | }; | 880 | }; |
878 | 881 | ||
879 | int cx, cy, cw, vw; | 882 | int cx, cy, cw, vw; |
880 | QTextParagraph *fParag, *lParag; | 883 | QTextParagraph *fParag, *lParag; |
881 | QTextPreProcessor *pProcessor; | 884 | QTextPreProcessor *pProcessor; |
882 | QMap<int, QColor> selectionColors; | 885 | QMap<int, QColor> selectionColors; |
883 | QMap<int, QTextDocumentSelection> selections; | 886 | QMap<int, QTextDocumentSelection> selections; |
884 | QMap<int, bool> selectionText; | 887 | QMap<int, bool> selectionText; |
885 | QTextCommandHistory *commandHistory; | 888 | QTextCommandHistory *commandHistory; |
886 | QTextFormatter *pFormatter; | 889 | QTextFormatter *pFormatter; |
887 | QTextIndent *indenter; | 890 | QTextIndent *indenter; |
888 | QTextFormatCollection *fCollection; | 891 | QTextFormatCollection *fCollection; |
889 | Qt::TextFormat txtFormat; | 892 | Qt::TextFormat txtFormat; |
890 | uint preferRichText : 1; | 893 | uint preferRichText : 1; |
891 | uint pages : 1; | 894 | uint pages : 1; |
892 | uint useFC : 1; | 895 | uint useFC : 1; |
893 | uint withoutDoubleBuffer : 1; | 896 | uint withoutDoubleBuffer : 1; |
894 | uint underlLinks : 1; | 897 | uint underlLinks : 1; |
895 | uint nextDoubleBuffered : 1; | 898 | uint nextDoubleBuffered : 1; |
896 | uint oTextValid : 1; | 899 | uint oTextValid : 1; |
897 | uint mightHaveCustomItems : 1; | 900 | uint mightHaveCustomItems : 1; |
898 | int align; | 901 | int align; |
899 | int nSelections; | 902 | int nSelections; |
900 | QTextFlow *flow_; | 903 | QTextFlow *flow_; |
@@ -910,72 +913,72 @@ private: | |||
910 | int rightmargin; | 913 | int rightmargin; |
911 | QTextParagraph *minwParag, *curParag; | 914 | QTextParagraph *minwParag, *curParag; |
912 | QStyleSheet* sheet_; | 915 | QStyleSheet* sheet_; |
913 | QMimeSourceFactory* factory_; | 916 | QMimeSourceFactory* factory_; |
914 | QString contxt; | 917 | QString contxt; |
915 | QMap<QString, QString> attribs; | 918 | QMap<QString, QString> attribs; |
916 | int *tArray; | 919 | int *tArray; |
917 | int tStopWidth; | 920 | int tStopWidth; |
918 | int uDepth; | 921 | int uDepth; |
919 | QString oText; | 922 | QString oText; |
920 | QPtrList<QTextDocument> childList; | 923 | QPtrList<QTextDocument> childList; |
921 | QColor linkColor; | 924 | QColor linkColor; |
922 | double scaleFontsFactor; | 925 | double scaleFontsFactor; |
923 | 926 | ||
924 | short list_tm,list_bm, list_lm, li_tm, li_bm, par_tm, par_bm; | 927 | short list_tm,list_bm, list_lm, li_tm, li_bm, par_tm, par_bm; |
925 | }; | 928 | }; |
926 | 929 | ||
927 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 930 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
928 | 931 | ||
929 | 932 | ||
930 | class Q_EXPORT QTextDeleteCommand : public QTextCommand | 933 | class Q_EXPORT QTextDeleteCommand : public QTextCommand |
931 | { | 934 | { |
932 | public: | 935 | public: |
933 | QTextDeleteCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str, | 936 | QTextDeleteCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str, |
934 | const QByteArray& oldStyle ); | 937 | const QByteArray& oldStyle ); |
935 | QTextDeleteCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str ); | 938 | QTextDeleteCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str ); |
936 | virtual ~QTextDeleteCommand(); | 939 | virtual ~QTextDeleteCommand(); |
937 | 940 | ||
938 | Commands type() const { return Delete; } | 941 | Commands type() const { return Delete; } |
939 | QTextCursor *execute( QTextCursor *c ); | 942 | QTextCursor *execute( QTextCursor *c ); |
940 | QTextCursor *unexecute( QTextCursor *c ); | 943 | QTextCursor *unexecute( QTextCursor *c ); |
941 | 944 | ||
942 | protected: | 945 | protected: |
943 | int id, index; | 946 | int id, index; |
944 | QTextParagraph *parag; | 947 | QTextParagraph *parag; |
945 | QMemArray<QTextStringChar> text; | 948 | QMemArray<QTextStringChar> text; |
946 | QByteArray styleInformation; | 949 | QByteArray styleInformation; |
947 | 950 | ||
948 | }; | 951 | }; |
949 | 952 | ||
950 | class Q_EXPORT QTextInsertCommand : public QTextDeleteCommand | 953 | class Q_EXPORT QTextInsertCommand : public QTextDeleteCommand |
951 | { | 954 | { |
952 | public: | 955 | public: |
953 | QTextInsertCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str, | 956 | QTextInsertCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str, |
954 | const QByteArray& oldStyleInfo ) | 957 | const QByteArray& oldStyleInfo ) |
955 | : QTextDeleteCommand( d, i, idx, str, oldStyleInfo ) {} | 958 | : QTextDeleteCommand( d, i, idx, str, oldStyleInfo ) {} |
956 | QTextInsertCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str ) | 959 | QTextInsertCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str ) |
957 | : QTextDeleteCommand( p, idx, str ) {} | 960 | : QTextDeleteCommand( p, idx, str ) {} |
958 | virtual ~QTextInsertCommand() {} | 961 | virtual ~QTextInsertCommand() {} |
959 | 962 | ||
960 | Commands type() const { return Insert; } | 963 | Commands type() const { return Insert; } |
961 | QTextCursor *execute( QTextCursor *c ) { return QTextDeleteCommand::unexecute( c ); } | 964 | QTextCursor *execute( QTextCursor *c ) { return QTextDeleteCommand::unexecute( c ); } |
962 | QTextCursor *unexecute( QTextCursor *c ) { return QTextDeleteCommand::execute( c ); } | 965 | QTextCursor *unexecute( QTextCursor *c ) { return QTextDeleteCommand::execute( c ); } |
963 | 966 | ||
964 | }; | 967 | }; |
965 | 968 | ||
966 | class Q_EXPORT QTextFormatCommand : public QTextCommand | 969 | class Q_EXPORT QTextFormatCommand : public QTextCommand |
967 | { | 970 | { |
968 | public: | 971 | public: |
969 | QTextFormatCommand( QTextDocument *d, int sid, int sidx, int eid, int eidx, const QMemArray<QTextStringChar> &old, QTextFormat *f, int fl ); | 972 | QTextFormatCommand( QTextDocument *d, int sid, int sidx, int eid, int eidx, const QMemArray<QTextStringChar> &old, QTextFormat *f, int fl ); |
970 | virtual ~QTextFormatCommand(); | 973 | virtual ~QTextFormatCommand(); |
971 | 974 | ||
972 | Commands type() const { return Format; } | 975 | Commands type() const { return Format; } |
973 | QTextCursor *execute( QTextCursor *c ); | 976 | QTextCursor *execute( QTextCursor *c ); |
974 | QTextCursor *unexecute( QTextCursor *c ); | 977 | QTextCursor *unexecute( QTextCursor *c ); |
975 | 978 | ||
976 | protected: | 979 | protected: |
977 | int startId, startIndex, endId, endIndex; | 980 | int startId, startIndex, endId, endIndex; |
978 | QTextFormat *format; | 981 | QTextFormat *format; |
979 | QMemArray<QTextStringChar> oldFormats; | 982 | QMemArray<QTextStringChar> oldFormats; |
980 | int flags; | 983 | int flags; |
981 | 984 | ||
@@ -990,79 +993,79 @@ public: | |||
990 | Commands type() const { return Style; } | 993 | Commands type() const { return Style; } |
991 | QTextCursor *execute( QTextCursor *c ); | 994 | QTextCursor *execute( QTextCursor *c ); |
992 | QTextCursor *unexecute( QTextCursor *c ); | 995 | QTextCursor *unexecute( QTextCursor *c ); |
993 | 996 | ||
994 | static QByteArray readStyleInformation( QTextDocument* d, int fParag, int lParag ); | 997 | static QByteArray readStyleInformation( QTextDocument* d, int fParag, int lParag ); |
995 | static void writeStyleInformation( QTextDocument* d, int fParag, const QByteArray& style ); | 998 | static void writeStyleInformation( QTextDocument* d, int fParag, const QByteArray& style ); |
996 | 999 | ||
997 | private: | 1000 | private: |
998 | int firstParag, lastParag; | 1001 | int firstParag, lastParag; |
999 | QByteArray before; | 1002 | QByteArray before; |
1000 | QByteArray after; | 1003 | QByteArray after; |
1001 | }; | 1004 | }; |
1002 | 1005 | ||
1003 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 1006 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1004 | 1007 | ||
1005 | struct Q_EXPORT QTextParagraphSelection | 1008 | struct Q_EXPORT QTextParagraphSelection |
1006 | { | 1009 | { |
1007 | int start, end; | 1010 | int start, end; |
1008 | }; | 1011 | }; |
1009 | 1012 | ||
1010 | struct Q_EXPORT QTextLineStart | 1013 | struct Q_EXPORT QTextLineStart |
1011 | { | 1014 | { |
1012 | QTextLineStart() : y( 0 ), baseLine( 0 ), h( 0 ) | 1015 | QTextLineStart() : y( 0 ), baseLine( 0 ), h( 0 ) |
1013 | #ifndef QT_NO_COMPLEXTEXT | 1016 | #ifndef QT_NO_COMPLEXTEXT |
1014 | , bidicontext( 0 ) | 1017 | , bidicontext( 0 ) |
1015 | #endif | 1018 | #endif |
1016 | { } | 1019 | { } |
1017 | QTextLineStart( ushort y_, ushort bl, ushort h_ ) : y( y_ ), baseLine( bl ), h( h_ ), | 1020 | QTextLineStart( ushort y_, ushort bl, ushort h_ ) : y( y_ ), baseLine( bl ), h( h_ ), |
1018 | w( 0 ) | 1021 | w( 0 ) |
1019 | #ifndef QT_NO_COMPLEXTEXT | 1022 | #ifndef QT_NO_COMPLEXTEXT |
1020 | , bidicontext( 0 ) | 1023 | , bidicontext( 0 ) |
1021 | #endif | 1024 | #endif |
1022 | { } | 1025 | { } |
1023 | #ifndef QT_NO_COMPLEXTEXT | 1026 | #ifndef QT_NO_COMPLEXTEXT |
1024 | QTextLineStart( QBidiContext *c, QBidiStatus s ) : y(0), baseLine(0), h(0), | 1027 | QTextLineStart( QBidiContext *c, QBidiStatus s ) : y(0), baseLine(0), h(0), |
1025 | status( s ), bidicontext( c ) { if ( bidicontext ) bidicontext->ref(); } | 1028 | status( s ), bidicontext( c ) { if ( bidicontext ) bidicontext->ref(); } |
1026 | #endif | 1029 | #endif |
1027 | 1030 | ||
1028 | virtual ~QTextLineStart() | 1031 | virtual ~QTextLineStart() |
1029 | { | 1032 | { |
1030 | #ifndef QT_NO_COMPLEXTEXT | 1033 | #ifndef QT_NO_COMPLEXTEXT |
1031 | if ( bidicontext && bidicontext->deref() ) | 1034 | if ( bidicontext && bidicontext->deref() ) |
1032 | delete bidicontext; | 1035 | delete bidicontext; |
1033 | #endif | 1036 | #endif |
1034 | } | 1037 | } |
1035 | 1038 | ||
1036 | #ifndef QT_NO_COMPLEXTEXT | 1039 | #ifndef QT_NO_COMPLEXTEXT |
1037 | void setContext( QBidiContext *c ) { | 1040 | void setContext( QBidiContext *c ) { |
1038 | if ( c == bidicontext ) | 1041 | if ( c == bidicontext ) |
1039 | return; | 1042 | return; |
1040 | if ( bidicontext && bidicontext->deref() ) | 1043 | if ( bidicontext && bidicontext->deref() ) |
1041 | delete bidicontext; | 1044 | delete bidicontext; |
1042 | bidicontext = c; | 1045 | bidicontext = c; |
1043 | if ( bidicontext ) | 1046 | if ( bidicontext ) |
1044 | bidicontext->ref(); | 1047 | bidicontext->ref(); |
1045 | } | 1048 | } |
1046 | QBidiContext *context() const { return bidicontext; } | 1049 | QBidiContext *context() const { return bidicontext; } |
1047 | #endif | 1050 | #endif |
1048 | 1051 | ||
1049 | public: | 1052 | public: |
1050 | ushort y, baseLine, h; | 1053 | ushort y, baseLine, h; |
1051 | #ifndef QT_NO_COMPLEXTEXT | 1054 | #ifndef QT_NO_COMPLEXTEXT |
1052 | QBidiStatus status; | 1055 | QBidiStatus status; |
1053 | #endif | 1056 | #endif |
1054 | int w; | 1057 | int w; |
1055 | 1058 | ||
1056 | private: | 1059 | private: |
1057 | #ifndef QT_NO_COMPLEXTEXT | 1060 | #ifndef QT_NO_COMPLEXTEXT |
1058 | QBidiContext *bidicontext; | 1061 | QBidiContext *bidicontext; |
1059 | #endif | 1062 | #endif |
1060 | }; | 1063 | }; |
1061 | 1064 | ||
1062 | #if defined(Q_TEMPLATEDLL) | 1065 | #if defined(Q_TEMPLATEDLL) |
1063 | // MOC_SKIP_BEGIN | 1066 | // MOC_SKIP_BEGIN |
1064 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextParagraphSelection>; | 1067 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextParagraphSelection>; |
1065 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextLineStart*>; | 1068 | Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextLineStart*>; |
1066 | // MOC_SKIP_END | 1069 | // MOC_SKIP_END |
1067 | #endif | 1070 | #endif |
1068 | 1071 | ||
@@ -1162,49 +1165,49 @@ public: | |||
1162 | bool fullSelected( int id ) const; | 1165 | bool fullSelected( int id ) const; |
1163 | 1166 | ||
1164 | void setEndState( int s ); | 1167 | void setEndState( int s ); |
1165 | int endState() const; | 1168 | int endState() const; |
1166 | 1169 | ||
1167 | void setParagId( int i ); | 1170 | void setParagId( int i ); |
1168 | int paragId() const; | 1171 | int paragId() const; |
1169 | 1172 | ||
1170 | bool firstPreProcess() const; | 1173 | bool firstPreProcess() const; |
1171 | void setFirstPreProcess( bool b ); | 1174 | void setFirstPreProcess( bool b ); |
1172 | 1175 | ||
1173 | void indent( int *oldIndent = 0, int *newIndent = 0 ); | 1176 | void indent( int *oldIndent = 0, int *newIndent = 0 ); |
1174 | 1177 | ||
1175 | void setExtraData( QTextParagraphData *data ); | 1178 | void setExtraData( QTextParagraphData *data ); |
1176 | QTextParagraphData *extraData() const; | 1179 | QTextParagraphData *extraData() const; |
1177 | 1180 | ||
1178 | QMap<int, QTextLineStart*> &lineStartList(); | 1181 | QMap<int, QTextLineStart*> &lineStartList(); |
1179 | 1182 | ||
1180 | void setFormat( int index, int len, QTextFormat *f, bool useCollection = TRUE, int flags = -1 ); | 1183 | void setFormat( int index, int len, QTextFormat *f, bool useCollection = TRUE, int flags = -1 ); |
1181 | 1184 | ||
1182 | void setAlignment( int a ); | 1185 | void setAlignment( int a ); |
1183 | int alignment() const; | 1186 | int alignment() const; |
1184 | 1187 | ||
1185 | virtual void paint( QPainter &painter, const QColorGroup &cg, QTextCursor *cursor = 0, bool drawSelections = FALSE, | 1188 | virtual void paint( QPainter &painter, const QColorGroup &cg, QTextCursor *cursor = 0, bool drawSelections = FALSE, |
1186 | int clipx = -1, int clipy = -1, int clipw = -1, int cliph = -1 ); | 1189 | int clipx = -1, int clipy = -1, int clipw = -1, int cliph = -1 ); |
1187 | 1190 | ||
1188 | virtual int topMargin() const; | 1191 | virtual int topMargin() const; |
1189 | virtual int bottomMargin() const; | 1192 | virtual int bottomMargin() const; |
1190 | virtual int leftMargin() const; | 1193 | virtual int leftMargin() const; |
1191 | virtual int firstLineMargin() const; | 1194 | virtual int firstLineMargin() const; |
1192 | virtual int rightMargin() const; | 1195 | virtual int rightMargin() const; |
1193 | virtual int lineSpacing() const; | 1196 | virtual int lineSpacing() const; |
1194 | 1197 | ||
1195 | void registerFloatingItem( QTextCustomItem *i ); | 1198 | void registerFloatingItem( QTextCustomItem *i ); |
1196 | void unregisterFloatingItem( QTextCustomItem *i ); | 1199 | void unregisterFloatingItem( QTextCustomItem *i ); |
1197 | 1200 | ||
1198 | void setFullWidth( bool b ) { fullWidth = b; } | 1201 | void setFullWidth( bool b ) { fullWidth = b; } |
1199 | bool isFullWidth() const { return fullWidth; } | 1202 | bool isFullWidth() const { return fullWidth; } |
1200 | 1203 | ||
1201 | QTextTableCell *tableCell() const; | 1204 | QTextTableCell *tableCell() const; |
1202 | 1205 | ||
1203 | QBrush *background() const; | 1206 | QBrush *background() const; |
1204 | 1207 | ||
1205 | int documentWidth() const; | 1208 | int documentWidth() const; |
1206 | int documentVisibleWidth() const; | 1209 | int documentVisibleWidth() const; |
1207 | int documentX() const; | 1210 | int documentX() const; |
1208 | int documentY() const; | 1211 | int documentY() const; |
1209 | QTextFormatCollection *formatCollection() const; | 1212 | QTextFormatCollection *formatCollection() const; |
1210 | QTextFormatter *formatter() const; | 1213 | QTextFormatter *formatter() const; |
@@ -1225,51 +1228,51 @@ public: | |||
1225 | QTextCursor *undo( QTextCursor *c = 0 ); | 1228 | QTextCursor *undo( QTextCursor *c = 0 ); |
1226 | QTextCursor *redo( QTextCursor *c = 0 ); | 1229 | QTextCursor *redo( QTextCursor *c = 0 ); |
1227 | QTextCommandHistory *commands() const; | 1230 | QTextCommandHistory *commands() const; |
1228 | virtual void copyParagData( QTextParagraph *parag ); | 1231 | virtual void copyParagData( QTextParagraph *parag ); |
1229 | 1232 | ||
1230 | void setBreakable( bool b ) { breakable = b; } | 1233 | void setBreakable( bool b ) { breakable = b; } |
1231 | bool isBreakable() const { return breakable; } | 1234 | bool isBreakable() const { return breakable; } |
1232 | 1235 | ||
1233 | void setBackgroundColor( const QColor &c ); | 1236 | void setBackgroundColor( const QColor &c ); |
1234 | QColor *backgroundColor() const { return bgcol; } | 1237 | QColor *backgroundColor() const { return bgcol; } |
1235 | void clearBackgroundColor(); | 1238 | void clearBackgroundColor(); |
1236 | 1239 | ||
1237 | void setMovedDown( bool b ) { movedDown = b; } | 1240 | void setMovedDown( bool b ) { movedDown = b; } |
1238 | bool wasMovedDown() const { return movedDown; } | 1241 | bool wasMovedDown() const { return movedDown; } |
1239 | 1242 | ||
1240 | void setDirection( QChar::Direction d ); | 1243 | void setDirection( QChar::Direction d ); |
1241 | QChar::Direction direction() const; | 1244 | QChar::Direction direction() const; |
1242 | 1245 | ||
1243 | void readStyleInformation( QDataStream& stream ); | 1246 | void readStyleInformation( QDataStream& stream ); |
1244 | void writeStyleInformation( QDataStream& stream ) const; | 1247 | void writeStyleInformation( QDataStream& stream ) const; |
1245 | 1248 | ||
1246 | protected: | 1249 | protected: |
1247 | virtual void drawLabel( QPainter* p, int x, int y, int w, int h, int base, const QColorGroup& cg ); | 1250 | virtual void drawLabel( QPainter* p, int x, int y, int w, int h, int base, const QColorGroup& cg ); |
1248 | virtual void drawString( QPainter &painter, const QString &str, int start, int len, int xstart, | 1251 | virtual void drawString( QPainter &painter, const QString &str, int start, int len, int xstart, |
1249 | int y, int baseLine, int w, int h, int selection, | 1252 | int y, int baseLine, int w, int h, int selection, |
1250 | QTextStringChar *formatChar, const QColorGroup& cg, | 1253 | QTextStringChar *formatChar, const QColorGroup& cg, |
1251 | bool rightToLeft ); | 1254 | bool rightToLeft ); |
1252 | 1255 | ||
1253 | private: | 1256 | private: |
1254 | QMap<int, QTextParagraphSelection> &selections() const; | 1257 | QMap<int, QTextParagraphSelection> &selections() const; |
1255 | QPtrList<QTextCustomItem> &floatingItems() const; | 1258 | QPtrList<QTextCustomItem> &floatingItems() const; |
1256 | QBrush backgroundBrush( const QColorGroup&cg ) { if ( bgcol ) return *bgcol; return cg.brush( QColorGroup::Base ); } | 1259 | QBrush backgroundBrush( const QColorGroup&cg ) { if ( bgcol ) return *bgcol; return cg.brush( QColorGroup::Base ); } |
1257 | void invalidateStyleCache(); | 1260 | void invalidateStyleCache(); |
1258 | 1261 | ||
1259 | QMap<int, QTextLineStart*> lineStarts; | 1262 | QMap<int, QTextLineStart*> lineStarts; |
1260 | int invalid; | 1263 | int invalid; |
1261 | QRect r; | 1264 | QRect r; |
1262 | QTextParagraph *p, *n; | 1265 | QTextParagraph *p, *n; |
1263 | void *docOrPseudo; | 1266 | void *docOrPseudo; |
1264 | uint changed : 1; | 1267 | uint changed : 1; |
1265 | uint firstFormat : 1; | 1268 | uint firstFormat : 1; |
1266 | uint firstPProcess : 1; | 1269 | uint firstPProcess : 1; |
1267 | uint needPreProcess : 1; | 1270 | uint needPreProcess : 1; |
1268 | uint fullWidth : 1; | 1271 | uint fullWidth : 1; |
1269 | uint lastInFrame : 1; | 1272 | uint lastInFrame : 1; |
1270 | uint visible : 1; | 1273 | uint visible : 1; |
1271 | uint breakable : 1; | 1274 | uint breakable : 1; |
1272 | uint movedDown : 1; | 1275 | uint movedDown : 1; |
1273 | uint mightHaveCustomItems : 1; | 1276 | uint mightHaveCustomItems : 1; |
1274 | uint hasdoc : 1; | 1277 | uint hasdoc : 1; |
1275 | uint litem : 1; // whether the paragraph is a list item | 1278 | uint litem : 1; // whether the paragraph is a list item |
@@ -1294,52 +1297,52 @@ private: | |||
1294 | 1297 | ||
1295 | class Q_EXPORT QTextFormatter | 1298 | class Q_EXPORT QTextFormatter |
1296 | { | 1299 | { |
1297 | public: | 1300 | public: |
1298 | QTextFormatter(); | 1301 | QTextFormatter(); |
1299 | virtual ~QTextFormatter(); | 1302 | virtual ~QTextFormatter(); |
1300 | 1303 | ||
1301 | virtual int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts ) = 0; | 1304 | virtual int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts ) = 0; |
1302 | virtual int formatVertically( QTextDocument* doc, QTextParagraph* parag ); | 1305 | virtual int formatVertically( QTextDocument* doc, QTextParagraph* parag ); |
1303 | 1306 | ||
1304 | bool isWrapEnabled( QTextParagraph *p ) const { if ( !wrapEnabled ) return FALSE; if ( p && !p->isBreakable() ) return FALSE; return TRUE;} | 1307 | bool isWrapEnabled( QTextParagraph *p ) const { if ( !wrapEnabled ) return FALSE; if ( p && !p->isBreakable() ) return FALSE; return TRUE;} |
1305 | int wrapAtColumn() const { return wrapColumn;} | 1308 | int wrapAtColumn() const { return wrapColumn;} |
1306 | virtual void setWrapEnabled( bool b ); | 1309 | virtual void setWrapEnabled( bool b ); |
1307 | virtual void setWrapAtColumn( int c ); | 1310 | virtual void setWrapAtColumn( int c ); |
1308 | virtual void setAllowBreakInWords( bool b ) { biw = b; } | 1311 | virtual void setAllowBreakInWords( bool b ) { biw = b; } |
1309 | bool allowBreakInWords() const { return biw; } | 1312 | bool allowBreakInWords() const { return biw; } |
1310 | 1313 | ||
1311 | int minimumWidth() const { return thisminw; } | 1314 | int minimumWidth() const { return thisminw; } |
1312 | int widthUsed() const { return thiswused; } | 1315 | int widthUsed() const { return thiswused; } |
1313 | 1316 | ||
1314 | static bool isBreakable( QTextString *string, int pos ); | 1317 | static bool isBreakable( QTextString *string, int pos ); |
1315 | 1318 | ||
1316 | protected: | 1319 | protected: |
1317 | virtual QTextLineStart *formatLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start, | 1320 | virtual QTextLineStart *formatLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start, |
1318 | QTextStringChar *last, int align = Qt3::AlignAuto, int space = 0 ); | 1321 | QTextStringChar *last, int align = Qt3::AlignAuto, int space = 0 ); |
1319 | #ifndef QT_NO_COMPLEXTEXT | 1322 | #ifndef QT_NO_COMPLEXTEXT |
1320 | virtual QTextLineStart *bidiReorderLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start, | 1323 | virtual QTextLineStart *bidiReorderLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start, |
1321 | QTextStringChar *last, int align, int space ); | 1324 | QTextStringChar *last, int align, int space ); |
1322 | #endif | 1325 | #endif |
1323 | void insertLineStart( QTextParagraph *parag, int index, QTextLineStart *ls ); | 1326 | void insertLineStart( QTextParagraph *parag, int index, QTextLineStart *ls ); |
1324 | 1327 | ||
1325 | int thisminw; | 1328 | int thisminw; |
1326 | int thiswused; | 1329 | int thiswused; |
1327 | 1330 | ||
1328 | private: | 1331 | private: |
1329 | bool wrapEnabled; | 1332 | bool wrapEnabled; |
1330 | int wrapColumn; | 1333 | int wrapColumn; |
1331 | bool biw; | 1334 | bool biw; |
1332 | 1335 | ||
1333 | #ifdef HAVE_THAI_BREAKS | 1336 | #ifdef HAVE_THAI_BREAKS |
1334 | static QCString *thaiCache; | 1337 | static QCString *thaiCache; |
1335 | static QTextString *cachedString; | 1338 | static QTextString *cachedString; |
1336 | static ThBreakIterator *thaiIt; | 1339 | static ThBreakIterator *thaiIt; |
1337 | #endif | 1340 | #endif |
1338 | }; | 1341 | }; |
1339 | 1342 | ||
1340 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 1343 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1341 | 1344 | ||
1342 | class Q_EXPORT QTextFormatterBreakInWords : public QTextFormatter | 1345 | class Q_EXPORT QTextFormatterBreakInWords : public QTextFormatter |
1343 | { | 1346 | { |
1344 | public: | 1347 | public: |
1345 | QTextFormatterBreakInWords(); | 1348 | QTextFormatterBreakInWords(); |
@@ -1358,80 +1361,80 @@ public: | |||
1358 | virtual ~QTextFormatterBreakWords() {} | 1361 | virtual ~QTextFormatterBreakWords() {} |
1359 | 1362 | ||
1360 | int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts ); | 1363 | int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts ); |
1361 | 1364 | ||
1362 | }; | 1365 | }; |
1363 | 1366 | ||
1364 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 1367 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1365 | 1368 | ||
1366 | class Q_EXPORT QTextIndent | 1369 | class Q_EXPORT QTextIndent |
1367 | { | 1370 | { |
1368 | public: | 1371 | public: |
1369 | QTextIndent(); | 1372 | QTextIndent(); |
1370 | virtual ~QTextIndent() {} | 1373 | virtual ~QTextIndent() {} |
1371 | 1374 | ||
1372 | virtual void indent( QTextDocument *doc, QTextParagraph *parag, int *oldIndent = 0, int *newIndent = 0 ) = 0; | 1375 | virtual void indent( QTextDocument *doc, QTextParagraph *parag, int *oldIndent = 0, int *newIndent = 0 ) = 0; |
1373 | 1376 | ||
1374 | }; | 1377 | }; |
1375 | 1378 | ||
1376 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 1379 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1377 | 1380 | ||
1378 | class Q_EXPORT QTextPreProcessor | 1381 | class Q_EXPORT QTextPreProcessor |
1379 | { | 1382 | { |
1380 | public: | 1383 | public: |
1381 | enum Ids { | 1384 | enum Ids { |
1382 | Standard = 0 | 1385 | Standard = 0 |
1383 | }; | 1386 | }; |
1384 | 1387 | ||
1385 | QTextPreProcessor(); | 1388 | QTextPreProcessor(); |
1386 | virtual ~QTextPreProcessor() {} | 1389 | virtual ~QTextPreProcessor() {} |
1387 | 1390 | ||
1388 | virtual void process( QTextDocument *doc, QTextParagraph *, int, bool = TRUE ) = 0; | 1391 | virtual void process( QTextDocument *doc, QTextParagraph *, int, bool = TRUE ) = 0; |
1389 | virtual QTextFormat *format( int id ) = 0; | 1392 | virtual QTextFormat *format( int id ) = 0; |
1390 | 1393 | ||
1391 | }; | 1394 | }; |
1392 | 1395 | ||
1393 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 1396 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1394 | 1397 | ||
1395 | class Q_EXPORT QTextFormat | 1398 | class Q_EXPORT QTextFormat |
1396 | { | 1399 | { |
1397 | friend class QTextFormatCollection; | 1400 | friend class QTextFormatCollection; |
1398 | friend class QTextDocument; | 1401 | friend class QTextDocument; |
1399 | 1402 | ||
1400 | public: | 1403 | public: |
1401 | enum Flags { | 1404 | enum Flags { |
1402 | NoFlags, | 1405 | NoFlags, |
1403 | Bold = 1, | 1406 | Bold = 1, |
1404 | Italic = 2, | 1407 | Italic = 2, |
1405 | Underline = 4, | 1408 | Underline = 4, |
1406 | Family = 8, | 1409 | Family = 8, |
1407 | Size = 16, | 1410 | Size = 16, |
1408 | Color = 32, | 1411 | Color = 32, |
1409 | Misspelled = 64, | 1412 | Misspelled = 64, |
1410 | VAlign = 128, | 1413 | VAlign = 128, |
1411 | StrikeOut= 256, | 1414 | StrikeOut= 256, |
1412 | Font = Bold | Italic | Underline | Family | Size | StrikeOut, | 1415 | Font = Bold | Italic | Underline | Family | Size | StrikeOut, |
1413 | Format = Font | Color | Misspelled | VAlign | 1416 | Format = Font | Color | Misspelled | VAlign |
1414 | }; | 1417 | }; |
1415 | 1418 | ||
1416 | enum VerticalAlignment { AlignNormal, AlignSuperScript, AlignSubScript }; | 1419 | enum VerticalAlignment { AlignNormal, AlignSuperScript, AlignSubScript }; |
1417 | 1420 | ||
1418 | QTextFormat(); | 1421 | QTextFormat(); |
1419 | virtual ~QTextFormat(); | 1422 | virtual ~QTextFormat(); |
1420 | 1423 | ||
1421 | QTextFormat( const QStyleSheetItem *s ); | 1424 | QTextFormat( const QStyleSheetItem *s ); |
1422 | QTextFormat( const QFont &f, const QColor &c, QTextFormatCollection *parent = 0 ); | 1425 | QTextFormat( const QFont &f, const QColor &c, QTextFormatCollection *parent = 0 ); |
1423 | QTextFormat( const QTextFormat &fm ); | 1426 | QTextFormat( const QTextFormat &fm ); |
1424 | QTextFormat makeTextFormat( const QStyleSheetItem *style, const QMap<QString,QString>& attr, double scaleFontsFactor ) const; | 1427 | QTextFormat makeTextFormat( const QStyleSheetItem *style, const QMap<QString,QString>& attr, double scaleFontsFactor ) const; |
1425 | QTextFormat& operator=( const QTextFormat &fm ); | 1428 | QTextFormat& operator=( const QTextFormat &fm ); |
1426 | QColor color() const; | 1429 | QColor color() const; |
1427 | QFont font() const; | 1430 | QFont font() const; |
1428 | bool isMisspelled() const; | 1431 | bool isMisspelled() const; |
1429 | VerticalAlignment vAlign() const; | 1432 | VerticalAlignment vAlign() const; |
1430 | int minLeftBearing() const; | 1433 | int minLeftBearing() const; |
1431 | int minRightBearing() const; | 1434 | int minRightBearing() const; |
1432 | int width( const QChar &c ) const; | 1435 | int width( const QChar &c ) const; |
1433 | int width( const QString &str, int pos ) const; | 1436 | int width( const QString &str, int pos ) const; |
1434 | int height() const; | 1437 | int height() const; |
1435 | int ascent() const; | 1438 | int ascent() const; |
1436 | int descent() const; | 1439 | int descent() const; |
1437 | int leading() const; | 1440 | int leading() const; |
@@ -1708,56 +1711,56 @@ inline void QTextDocument::setAlignment( int a ) | |||
1708 | 1711 | ||
1709 | inline int *QTextDocument::tabArray() const | 1712 | inline int *QTextDocument::tabArray() const |
1710 | { | 1713 | { |
1711 | return tArray; | 1714 | return tArray; |
1712 | } | 1715 | } |
1713 | 1716 | ||
1714 | inline int QTextDocument::tabStopWidth() const | 1717 | inline int QTextDocument::tabStopWidth() const |
1715 | { | 1718 | { |
1716 | return tStopWidth; | 1719 | return tStopWidth; |
1717 | } | 1720 | } |
1718 | 1721 | ||
1719 | inline void QTextDocument::setTabArray( int *a ) | 1722 | inline void QTextDocument::setTabArray( int *a ) |
1720 | { | 1723 | { |
1721 | tArray = a; | 1724 | tArray = a; |
1722 | } | 1725 | } |
1723 | 1726 | ||
1724 | inline void QTextDocument::setTabStops( int tw ) | 1727 | inline void QTextDocument::setTabStops( int tw ) |
1725 | { | 1728 | { |
1726 | tStopWidth = tw; | 1729 | tStopWidth = tw; |
1727 | } | 1730 | } |
1728 | 1731 | ||
1729 | inline QString QTextDocument::originalText() const | 1732 | inline QString QTextDocument::originalText() const |
1730 | { | 1733 | { |
1731 | if ( oTextValid ) | 1734 | if ( oTextValid ) |
1732 | return oText; | 1735 | return oText; |
1733 | return text(); | 1736 | return text(); |
1734 | } | 1737 | } |
1735 | 1738 | ||
1736 | inline void QTextDocument::setFlow( QTextFlow *f ) | 1739 | inline void QTextDocument::setFlow( QTextFlow *f ) |
1737 | { | 1740 | { |
1738 | if ( flow_ ) | 1741 | if ( flow_ ) |
1739 | delete flow_; | 1742 | delete flow_; |
1740 | flow_ = f; | 1743 | flow_ = f; |
1741 | } | 1744 | } |
1742 | 1745 | ||
1743 | inline void QTextDocument::takeFlow() | 1746 | inline void QTextDocument::takeFlow() |
1744 | { | 1747 | { |
1745 | flow_ = 0; | 1748 | flow_ = 0; |
1746 | } | 1749 | } |
1747 | 1750 | ||
1748 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 1751 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1749 | 1752 | ||
1750 | inline QColor QTextFormat::color() const | 1753 | inline QColor QTextFormat::color() const |
1751 | { | 1754 | { |
1752 | return col; | 1755 | return col; |
1753 | } | 1756 | } |
1754 | 1757 | ||
1755 | inline QFont QTextFormat::font() const | 1758 | inline QFont QTextFormat::font() const |
1756 | { | 1759 | { |
1757 | return fn; | 1760 | return fn; |
1758 | } | 1761 | } |
1759 | 1762 | ||
1760 | inline bool QTextFormat::isMisspelled() const | 1763 | inline bool QTextFormat::isMisspelled() const |
1761 | { | 1764 | { |
1762 | return missp; | 1765 | return missp; |
1763 | } | 1766 | } |
@@ -1765,53 +1768,53 @@ inline bool QTextFormat::isMisspelled() const | |||
1765 | inline QTextFormat::VerticalAlignment QTextFormat::vAlign() const | 1768 | inline QTextFormat::VerticalAlignment QTextFormat::vAlign() const |
1766 | { | 1769 | { |
1767 | return ha; | 1770 | return ha; |
1768 | } | 1771 | } |
1769 | 1772 | ||
1770 | inline bool QTextFormat::operator==( const QTextFormat &f ) const | 1773 | inline bool QTextFormat::operator==( const QTextFormat &f ) const |
1771 | { | 1774 | { |
1772 | return k == f.k; | 1775 | return k == f.k; |
1773 | } | 1776 | } |
1774 | 1777 | ||
1775 | inline QTextFormatCollection *QTextFormat::parent() const | 1778 | inline QTextFormatCollection *QTextFormat::parent() const |
1776 | { | 1779 | { |
1777 | return collection; | 1780 | return collection; |
1778 | } | 1781 | } |
1779 | 1782 | ||
1780 | inline void QTextFormat::addRef() | 1783 | inline void QTextFormat::addRef() |
1781 | { | 1784 | { |
1782 | ref++; | 1785 | ref++; |
1783 | } | 1786 | } |
1784 | 1787 | ||
1785 | inline void QTextFormat::removeRef() | 1788 | inline void QTextFormat::removeRef() |
1786 | { | 1789 | { |
1787 | ref--; | 1790 | ref--; |
1788 | if ( !collection ) | 1791 | if ( !collection ) |
1789 | return; | 1792 | return; |
1790 | if ( this == collection->defFormat ) | 1793 | if ( this == collection->defFormat ) |
1791 | return; | 1794 | return; |
1792 | if ( ref == 0 ) | 1795 | if ( ref == 0 ) |
1793 | collection->remove( this ); | 1796 | collection->remove( this ); |
1794 | } | 1797 | } |
1795 | 1798 | ||
1796 | inline QString QTextFormat::key() const | 1799 | inline QString QTextFormat::key() const |
1797 | { | 1800 | { |
1798 | return k; | 1801 | return k; |
1799 | } | 1802 | } |
1800 | 1803 | ||
1801 | inline bool QTextFormat::useLinkColor() const | 1804 | inline bool QTextFormat::useLinkColor() const |
1802 | { | 1805 | { |
1803 | return linkColor; | 1806 | return linkColor; |
1804 | } | 1807 | } |
1805 | 1808 | ||
1806 | 1809 | ||
1807 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 1810 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1808 | 1811 | ||
1809 | inline QTextStringChar &QTextString::at( int i ) const | 1812 | inline QTextStringChar &QTextString::at( int i ) const |
1810 | { | 1813 | { |
1811 | return data[ i ]; | 1814 | return data[ i ]; |
1812 | } | 1815 | } |
1813 | 1816 | ||
1814 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 1817 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1815 | 1818 | ||
1816 | inline QTextStringChar *QTextParagraph::at( int i ) const | 1819 | inline QTextStringChar *QTextParagraph::at( int i ) const |
1817 | { | 1820 | { |
@@ -1822,123 +1825,123 @@ inline bool QTextParagraph::isValid() const | |||
1822 | { | 1825 | { |
1823 | return invalid == -1; | 1826 | return invalid == -1; |
1824 | } | 1827 | } |
1825 | 1828 | ||
1826 | inline bool QTextParagraph::hasChanged() const | 1829 | inline bool QTextParagraph::hasChanged() const |
1827 | { | 1830 | { |
1828 | return changed; | 1831 | return changed; |
1829 | } | 1832 | } |
1830 | 1833 | ||
1831 | inline void QTextParagraph::setBackgroundColor( const QColor & c ) | 1834 | inline void QTextParagraph::setBackgroundColor( const QColor & c ) |
1832 | { | 1835 | { |
1833 | delete bgcol; | 1836 | delete bgcol; |
1834 | bgcol = new QColor( c ); | 1837 | bgcol = new QColor( c ); |
1835 | setChanged( TRUE ); | 1838 | setChanged( TRUE ); |
1836 | } | 1839 | } |
1837 | 1840 | ||
1838 | inline void QTextParagraph::clearBackgroundColor() | 1841 | inline void QTextParagraph::clearBackgroundColor() |
1839 | { | 1842 | { |
1840 | delete bgcol; bgcol = 0; setChanged( TRUE ); | 1843 | delete bgcol; bgcol = 0; setChanged( TRUE ); |
1841 | } | 1844 | } |
1842 | 1845 | ||
1843 | inline void QTextParagraph::append( const QString &s, bool reallyAtEnd ) | 1846 | inline void QTextParagraph::append( const QString &s, bool reallyAtEnd ) |
1844 | { | 1847 | { |
1845 | if ( reallyAtEnd ) | 1848 | if ( reallyAtEnd ) |
1846 | insert( str->length(), s ); | 1849 | insert( str->length(), s ); |
1847 | else | 1850 | else |
1848 | insert( QMAX( str->length() - 1, 0 ), s ); | 1851 | insert( QMAX( str->length() - 1, 0 ), s ); |
1849 | } | 1852 | } |
1850 | 1853 | ||
1851 | inline QTextParagraph *QTextParagraph::prev() const | 1854 | inline QTextParagraph *QTextParagraph::prev() const |
1852 | { | 1855 | { |
1853 | return p; | 1856 | return p; |
1854 | } | 1857 | } |
1855 | 1858 | ||
1856 | inline QTextParagraph *QTextParagraph::next() const | 1859 | inline QTextParagraph *QTextParagraph::next() const |
1857 | { | 1860 | { |
1858 | return n; | 1861 | return n; |
1859 | } | 1862 | } |
1860 | 1863 | ||
1861 | inline bool QTextParagraph::hasAnySelection() const | 1864 | inline bool QTextParagraph::hasAnySelection() const |
1862 | { | 1865 | { |
1863 | return mSelections ? !selections().isEmpty() : FALSE; | 1866 | return mSelections ? !selections().isEmpty() : FALSE; |
1864 | } | 1867 | } |
1865 | 1868 | ||
1866 | inline void QTextParagraph::setEndState( int s ) | 1869 | inline void QTextParagraph::setEndState( int s ) |
1867 | { | 1870 | { |
1868 | if ( s == state ) | 1871 | if ( s == state ) |
1869 | return; | 1872 | return; |
1870 | state = s; | 1873 | state = s; |
1871 | } | 1874 | } |
1872 | 1875 | ||
1873 | inline int QTextParagraph::endState() const | 1876 | inline int QTextParagraph::endState() const |
1874 | { | 1877 | { |
1875 | return state; | 1878 | return state; |
1876 | } | 1879 | } |
1877 | 1880 | ||
1878 | inline void QTextParagraph::setParagId( int i ) | 1881 | inline void QTextParagraph::setParagId( int i ) |
1879 | { | 1882 | { |
1880 | id = i; | 1883 | id = i; |
1881 | } | 1884 | } |
1882 | 1885 | ||
1883 | inline int QTextParagraph::paragId() const | 1886 | inline int QTextParagraph::paragId() const |
1884 | { | 1887 | { |
1885 | if ( id == -1 ) | 1888 | if ( id == -1 ) |
1886 | qWarning( "invalid parag id!!!!!!!! (%p)", (void*)this ); | 1889 | owarn << "invalid parag id!!!!!!!! (" << (void*)this << ")" << oendl; |
1887 | return id; | 1890 | return id; |
1888 | } | 1891 | } |
1889 | 1892 | ||
1890 | inline bool QTextParagraph::firstPreProcess() const | 1893 | inline bool QTextParagraph::firstPreProcess() const |
1891 | { | 1894 | { |
1892 | return firstPProcess; | 1895 | return firstPProcess; |
1893 | } | 1896 | } |
1894 | 1897 | ||
1895 | inline void QTextParagraph::setFirstPreProcess( bool b ) | 1898 | inline void QTextParagraph::setFirstPreProcess( bool b ) |
1896 | { | 1899 | { |
1897 | firstPProcess = b; | 1900 | firstPProcess = b; |
1898 | } | 1901 | } |
1899 | 1902 | ||
1900 | inline QMap<int, QTextLineStart*> &QTextParagraph::lineStartList() | 1903 | inline QMap<int, QTextLineStart*> &QTextParagraph::lineStartList() |
1901 | { | 1904 | { |
1902 | return lineStarts; | 1905 | return lineStarts; |
1903 | } | 1906 | } |
1904 | 1907 | ||
1905 | inline QTextString *QTextParagraph::string() const | 1908 | inline QTextString *QTextParagraph::string() const |
1906 | { | 1909 | { |
1907 | return str; | 1910 | return str; |
1908 | } | 1911 | } |
1909 | 1912 | ||
1910 | inline QTextDocument *QTextParagraph::document() const | 1913 | inline QTextDocument *QTextParagraph::document() const |
1911 | { | 1914 | { |
1912 | if ( hasdoc ) | 1915 | if ( hasdoc ) |
1913 | return (QTextDocument*) docOrPseudo; | 1916 | return (QTextDocument*) docOrPseudo; |
1914 | return 0; | 1917 | return 0; |
1915 | } | 1918 | } |
1916 | 1919 | ||
1917 | inline QTextParagraphPseudoDocument *QTextParagraph::pseudoDocument() const | 1920 | inline QTextParagraphPseudoDocument *QTextParagraph::pseudoDocument() const |
1918 | { | 1921 | { |
1919 | if ( hasdoc ) | 1922 | if ( hasdoc ) |
1920 | return 0; | 1923 | return 0; |
1921 | return (QTextParagraphPseudoDocument*) docOrPseudo; | 1924 | return (QTextParagraphPseudoDocument*) docOrPseudo; |
1922 | } | 1925 | } |
1923 | 1926 | ||
1924 | 1927 | ||
1925 | inline QTextTableCell *QTextParagraph::tableCell() const | 1928 | inline QTextTableCell *QTextParagraph::tableCell() const |
1926 | { | 1929 | { |
1927 | return hasdoc ? document()->tableCell () : 0; | 1930 | return hasdoc ? document()->tableCell () : 0; |
1928 | } | 1931 | } |
1929 | 1932 | ||
1930 | inline QTextCommandHistory *QTextParagraph::commands() const | 1933 | inline QTextCommandHistory *QTextParagraph::commands() const |
1931 | { | 1934 | { |
1932 | return hasdoc ? document()->commands() : pseudoDocument()->commandHistory; | 1935 | return hasdoc ? document()->commands() : pseudoDocument()->commandHistory; |
1933 | } | 1936 | } |
1934 | 1937 | ||
1935 | 1938 | ||
1936 | inline int QTextParagraph::alignment() const | 1939 | inline int QTextParagraph::alignment() const |
1937 | { | 1940 | { |
1938 | return align; | 1941 | return align; |
1939 | } | 1942 | } |
1940 | 1943 | ||
1941 | inline void QTextParagraph::registerFloatingItem( QTextCustomItem *i ) | 1944 | inline void QTextParagraph::registerFloatingItem( QTextCustomItem *i ) |
1942 | { | 1945 | { |
1943 | floatingItems().append( i ); | 1946 | floatingItems().append( i ); |
1944 | } | 1947 | } |