Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

qrichtext_p.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 ** $Id: qrichtext_p.h,v 1.3 2004/05/31 15:26:50 ar Exp $
00003 **
00004 ** Definition of internal rich text classes
00005 **
00006 ** Created : 990124
00007 **
00008 ** Copyright (C) 1999-2000 Trolltech AS.  All rights reserved.
00009 **
00010 ** This file is part of the kernel module of the Qt GUI Toolkit.
00011 **
00012 ** This file may be distributed under the terms of the Q Public License
00013 ** as defined by Trolltech AS of Norway and appearing in the file
00014 ** LICENSE.QPL included in the packaging of this file.
00015 **
00016 ** This file may be distributed and/or modified under the terms of the
00017 ** GNU General Public License version 2 as published by the Free Software
00018 ** Foundation and appearing in the file LICENSE.GPL included in the
00019 ** packaging of this file.
00020 **
00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00022 ** licenses may use this file in accordance with the Qt Commercial License
00023 ** Agreement provided with the Software.
00024 **
00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00027 **
00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00029 **   information about Qt Commercial License Agreements.
00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00032 **
00033 ** Contact info@trolltech.com if any conditions of this licensing are
00034 ** not clear to you.
00035 **
00036 **********************************************************************/
00037 
00038 #ifndef QRICHTEXT_P_H
00039 #define QRICHTEXT_P_H
00040 
00041 //
00042 //  W A R N I N G
00043 //  -------------
00044 //
00045 // This file is not part of the Qt API.  It exists for the convenience
00046 // of a number of Qt sources files.  This header file may change from
00047 // version to version without notice, or even be removed.
00048 //
00049 // We mean it.
00050 //
00051 //
00052 
00053 #include <opie2/odebug.h>
00054 using namespace Opie::Core;
00055 
00056 #ifndef QT_H
00057 #include "qstring.h"
00058 #include "qlist.h"
00059 #include "qrect.h"
00060 #include "qfontmetrics.h"
00061 #include "qintdict.h"
00062 #include "qmap.h"
00063 #include "qstringlist.h"
00064 #include "qfont.h"
00065 #include "qcolor.h"
00066 #include "qsize.h"
00067 #include "qvaluelist.h"
00068 #include "qvaluestack.h"
00069 #include "qobject.h"
00070 #include "qdict.h"
00071 #include "qtextstream.h"
00072 #include "qpixmap.h"
00073 #include "qstylesheet.h"
00074 #include "qvector.h"
00075 #include "qpainter.h"
00076 #include "qlayout.h"
00077 #include "qobject.h"
00078 #include "qcomplextext_p.h"
00079 #include "qapplication.h"
00080 #include <limits.h>
00081 #endif // QT_H
00082 
00083 namespace Qt3 {
00084 
00085 class QTextDocument;
00086 class QTextString;
00087 class QTextPreProcessor;
00088 class QTextFormat;
00089 class QTextCursor;
00090 class QTextParagraph;
00091 class QTextFormatter;
00092 class QTextIndent;
00093 class QTextFormatCollection;
00094 class QStyleSheetItem;
00095 class QTextCustomItem;
00096 class QTextFlow;
00097 struct QBidiContext;
00098 
00099 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00100 
00101 class Q_EXPORT QTextStringChar
00102 {
00103     friend class QTextString;
00104 
00105 public:
00106     // this is never called, initialize variables in QTextString::insert()!!!
00107     QTextStringChar() : lineStart( 0 ), type( Regular ), startOfRun( 0 ) {d.format=0;}
00108     ~QTextStringChar();
00109 
00110     QChar c;
00111     enum Type { Regular=0, Custom=1, Anchor=2, CustomAnchor=3 };
00112     uint lineStart : 1;
00113     uint rightToLeft : 1;
00114     uint hasCursor : 1;
00115     uint canBreak : 1;
00116     Type type : 2;
00117     uint startOfRun : 1;
00118 
00119     int x;
00120     int height() const;
00121     int ascent() const;
00122     int descent() const;
00123     bool isCustom() const { return (type & Custom) != 0; }
00124     QTextFormat *format() const;
00125     QTextCustomItem *customItem() const;
00126     void setFormat( QTextFormat *f );
00127     void setCustomItem( QTextCustomItem *i );
00128     struct CustomData
00129     {
00130     QTextFormat *format;
00131     QTextCustomItem *custom;
00132     QString anchorName;
00133     QString anchorHref;
00134     };
00135 
00136     void loseCustomItem();
00137 
00138     union {
00139     QTextFormat* format;
00140     CustomData* custom;
00141     } d;
00142 
00143     bool isAnchor() const { return ( type & Anchor) != 0; }
00144     QString anchorName() const;
00145     QString anchorHref() const;
00146     void setAnchor( const QString& name, const QString& href );
00147 
00148 private:
00149     QTextStringChar &operator=( const QTextStringChar & ) {
00150     //abort();
00151     return *this;
00152     }
00153     friend class QComplexText;
00154     friend class QTextParagraph;
00155 };
00156 
00157 #if defined(Q_TEMPLATEDLL)
00158 // MOC_SKIP_BEGIN
00159 Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<QTextStringChar>;
00160 // MOC_SKIP_END
00161 #endif
00162 
00163 class Q_EXPORT QTextString
00164 {
00165 public:
00166 
00167     QTextString();
00168     QTextString( const QTextString &s );
00169     virtual ~QTextString();
00170 
00171     static QString toString( const QMemArray<QTextStringChar> &data );
00172     QString toString() const;
00173 
00174     QTextStringChar &at( int i ) const;
00175     int length() const;
00176 
00177     int width( int idx ) const;
00178 
00179     void insert( int index, const QString &s, QTextFormat *f );
00180     void insert( int index, const QChar *unicode, int len, QTextFormat *f );
00181     void insert( int index, QTextStringChar *c, bool doAddRefFormat = FALSE );
00182     void truncate( int index );
00183     void remove( int index, int len );
00184     void clear();
00185 
00186     void setFormat( int index, QTextFormat *f, bool useCollection );
00187 
00188     void setBidi( bool b ) { bidi = b; }
00189     bool isBidi() const;
00190     bool isRightToLeft() const;
00191     QChar::Direction direction() const;
00192     void setDirection( QChar::Direction d ) { dir = d; bidiDirty = TRUE; }
00193 
00194     QMemArray<QTextStringChar> subString( int start = 0, int len = 0xFFFFFF ) const;
00195     QMemArray<QTextStringChar> rawData() const { return data; }
00196 
00197     void operator=( const QString &s ) { clear(); insert( 0, s, 0 ); }
00198     void operator+=( const QString &s ) {insert( length(), s, 0 ); }
00199     void prepend( const QString &s ) { insert( 0, s, 0 ); }
00200 
00201 private:
00202     void checkBidi() const;
00203 
00204     QMemArray<QTextStringChar> data;
00205     uint bidiDirty : 1;
00206     uint bidi : 1; // true when the paragraph has right to left characters
00207     uint rightToLeft : 1;
00208     uint dir : 5;
00209 };
00210 
00211 inline bool QTextString::isBidi() const
00212 {
00213     if ( bidiDirty )
00214     checkBidi();
00215     return bidi;
00216 }
00217 
00218 inline bool QTextString::isRightToLeft() const
00219 {
00220     if ( bidiDirty )
00221     checkBidi();
00222     return rightToLeft;
00223 }
00224 
00225 inline QChar::Direction QTextString::direction() const
00226 {
00227     return (QChar::Direction) dir;
00228 }
00229 
00230 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00231 
00232 #if defined(Q_TEMPLATEDLL)
00233 // MOC_SKIP_BEGIN
00234 Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<int>;
00235 Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<QTextParagraph*>;
00236 Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<bool>;
00237 // MOC_SKIP_END
00238 #endif
00239 
00240 class Q_EXPORT QTextCursor
00241 {
00242 public:
00243     QTextCursor( QTextDocument *d = 0 );
00244     QTextCursor( const QTextCursor &c );
00245     QTextCursor &operator=( const QTextCursor &c );
00246     virtual ~QTextCursor() {}
00247 
00248     bool operator==( const QTextCursor &c ) const;
00249     bool operator!=( const QTextCursor &c ) const { return !(*this == c); }
00250 
00251     QTextParagraph *paragraph() const;
00252     void setParagraph( QTextParagraph*p ) { gotoPosition(p, 0 ); }
00253     QTextDocument *document() const;
00254     int index() const;
00255     void setIndex( int index ) { gotoPosition(paragraph(), index ); }
00256 
00257     void gotoPosition( QTextParagraph* p, int index = 0);
00258     void gotoLeft();
00259     void gotoRight();
00260     void gotoNextLetter();
00261     void gotoPreviousLetter();
00262     void gotoUp();
00263     void gotoDown();
00264     void gotoLineEnd();
00265     void gotoLineStart();
00266     void gotoHome();
00267     void gotoEnd();
00268     void gotoPageUp( int visibleHeight );
00269     void gotoPageDown( int visibleHeight );
00270     void gotoNextWord();
00271     void gotoPreviousWord();
00272     void gotoWordLeft();
00273     void gotoWordRight();
00274 
00275     void insert( const QString &s, bool checkNewLine, QMemArray<QTextStringChar> *formatting = 0 );
00276     void splitAndInsertEmptyParagraph( bool ind = TRUE, bool updateIds = TRUE );
00277     bool remove();
00278     void indent();
00279 
00280     bool atParagStart();
00281     bool atParagEnd();
00282 
00283     int x() const; // x in current paragraph
00284     int y() const; // y in current paragraph
00285 
00286     int globalX() const;
00287     int globalY() const;
00288 
00289     QTextParagraph *topParagraph() const { return paras.isEmpty() ? para : paras.first(); }
00290     int offsetX() const { return ox; } // inner document  offset
00291     int offsetY() const { return oy; } // inner document offset
00292     int totalOffsetX() const; // total document offset
00293     int totalOffsetY() const; // total document offset
00294 
00295     bool place( const QPoint &pos, QTextParagraph *s ) { return place( pos, s, FALSE ); }
00296     bool place( const QPoint &pos, QTextParagraph *s, bool link );
00297     void restoreState();
00298 
00299 
00300     int nestedDepth() const { return (int)indices.count(); } //### size_t/int cast
00301     void oneUp() { if ( !indices.isEmpty() ) pop(); }
00302     void setValid( bool b ) { valid = b; }
00303     bool isValid() const { return valid; }
00304 
00305 private:
00306     enum Operation { EnterBegin, EnterEnd, Next, Prev, Up, Down };
00307 
00308     void push();
00309     void pop();
00310     void processNesting( Operation op );
00311     void invalidateNested();
00312     void gotoIntoNested( const QPoint &globalPos );
00313 
00314     QTextParagraph *para;
00315     int idx, tmpIndex;
00316     int ox, oy;
00317     QValueStack<int> indices;
00318     QValueStack<QTextParagraph*> paras;
00319     QValueStack<int> xOffsets;
00320     QValueStack<int> yOffsets;
00321     uint valid : 1;
00322 
00323 };
00324 
00325 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00326 
00327 class Q_EXPORT QTextCommand
00328 {
00329 public:
00330     enum Commands { Invalid, Insert, Delete, Format, Style };
00331 
00332     QTextCommand( QTextDocument *d ) : doc( d ), cursor( d ) {}
00333     virtual ~QTextCommand();
00334 
00335     virtual Commands type() const;
00336 
00337     virtual QTextCursor *execute( QTextCursor *c ) = 0;
00338     virtual QTextCursor *unexecute( QTextCursor *c ) = 0;
00339 
00340 protected:
00341     QTextDocument *doc;
00342     QTextCursor cursor;
00343 
00344 };
00345 
00346 #if defined(Q_TEMPLATEDLL)
00347 // MOC_SKIP_BEGIN
00348 Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextCommand>;
00349 // MOC_SKIP_END
00350 #endif
00351 
00352 class Q_EXPORT QTextCommandHistory
00353 {
00354 public:
00355     QTextCommandHistory( int s ) : current( -1 ), steps( s ) { history.setAutoDelete( TRUE ); }
00356     virtual ~QTextCommandHistory();
00357 
00358     void clear() { history.clear(); current = -1; }
00359 
00360     void addCommand( QTextCommand *cmd );
00361     QTextCursor *undo( QTextCursor *c );
00362     QTextCursor *redo( QTextCursor *c );
00363 
00364     bool isUndoAvailable();
00365     bool isRedoAvailable();
00366 
00367     void setUndoDepth( int d ) { steps = d; }
00368     int undoDepth() const { return steps; }
00369 
00370     int historySize() const { return history.count(); }
00371     int currentPosition() const { return current; }
00372 
00373 private:
00374     QPtrList<QTextCommand> history;
00375     int current, steps;
00376 
00377 };
00378 
00379 inline QTextCommandHistory::~QTextCommandHistory()
00380 {
00381     clear();
00382 }
00383 
00384 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00385 
00386 class Q_EXPORT QTextCustomItem
00387 {
00388 public:
00389     QTextCustomItem( QTextDocument *p )
00390     :  xpos(0), ypos(-1), width(-1), height(0), parent( p )
00391     {}
00392     virtual ~QTextCustomItem();
00393     virtual void draw(QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ) = 0;
00394 
00395     virtual void adjustToPainter( QPainter* );
00396 
00397     enum Placement { PlaceInline = 0, PlaceLeft, PlaceRight };
00398     virtual Placement placement() const;
00399     bool placeInline() { return placement() == PlaceInline; }
00400 
00401     virtual bool ownLine() const;
00402     virtual void resize( int nwidth );
00403     virtual void invalidate();
00404     virtual int ascent() const { return height; }
00405 
00406     virtual bool isNested() const;
00407     virtual int minimumWidth() const;
00408 
00409     virtual QString richText() const;
00410 
00411     int xpos; // used for floating items
00412     int ypos; // used for floating items
00413     int width;
00414     int height;
00415 
00416     QRect geometry() const { return QRect( xpos, ypos, width, height ); }
00417 
00418     virtual bool enter( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy, bool atEnd = FALSE );
00419     virtual bool enterAt( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy, const QPoint & );
00420     virtual bool next( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
00421     virtual bool prev( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
00422     virtual bool down( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
00423     virtual bool up( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
00424 
00425     void setParagraph( QTextParagraph *p ) { parag = p; }
00426     QTextParagraph *paragraph() const { return parag; }
00427 
00428     QTextDocument *parent;
00429     QTextParagraph *parag;
00430 
00431     virtual void pageBreak( int  y, QTextFlow* flow );
00432 };
00433 
00434 #if defined(Q_TEMPLATEDLL)
00435 // MOC_SKIP_BEGIN
00436 Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<QString, QString>;
00437 // MOC_SKIP_END
00438 #endif
00439 
00440 class Q_EXPORT QTextImage : public QTextCustomItem
00441 {
00442 public:
00443     QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context,
00444         QMimeSourceFactory &factory );
00445     virtual ~QTextImage();
00446 
00447     Placement placement() const { return place; }
00448     void adjustToPainter( QPainter* );
00449     int minimumWidth() const { return width; }
00450 
00451     QString richText() const;
00452 
00453     void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
00454 
00455 private:
00456     QRegion* reg;
00457     QPixmap pm;
00458     Placement place;
00459     int tmpwidth, tmpheight;
00460     QMap<QString, QString> attributes;
00461     QString imgId;
00462 
00463 };
00464 
00465 class Q_EXPORT QTextHorizontalLine : public QTextCustomItem
00466 {
00467 public:
00468     QTextHorizontalLine( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context,
00469              QMimeSourceFactory &factory );
00470     virtual ~QTextHorizontalLine();
00471 
00472     void adjustToPainter( QPainter* );
00473     void draw(QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
00474     QString richText() const;
00475 
00476     bool ownLine() const { return TRUE; }
00477 
00478 private:
00479     int tmpheight;
00480     QColor color;
00481 
00482 };
00483 
00484 #if defined(Q_TEMPLATEDLL)
00485 // MOC_SKIP_BEGIN
00486 Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextCustomItem>;
00487 // MOC_SKIP_END
00488 #endif
00489 
00490 class Q_EXPORT QTextFlow
00491 {
00492     friend class QTextDocument;
00493     friend class QTextTableCell;
00494 
00495 public:
00496     QTextFlow();
00497     virtual ~QTextFlow();
00498 
00499     virtual void setWidth( int width );
00500     int width() const;
00501 
00502     virtual void setPageSize( int ps );
00503     int pageSize() const { return pagesize; }
00504 
00505     virtual int adjustLMargin( int yp, int h, int margin, int space );
00506     virtual int adjustRMargin( int yp, int h, int margin, int space );
00507 
00508     virtual void registerFloatingItem( QTextCustomItem* item );
00509     virtual void unregisterFloatingItem( QTextCustomItem* item );
00510     virtual QRect boundingRect() const;
00511     virtual void drawFloatingItems(QPainter* p, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
00512 
00513     virtual int adjustFlow( int  y, int w, int h ); // adjusts y according to the defined pagesize. Returns the shift.
00514 
00515     virtual bool isEmpty();
00516 
00517     void clear();
00518 
00519 private:
00520     int w;
00521     int pagesize;
00522 
00523     QPtrList<QTextCustomItem> leftItems;
00524     QPtrList<QTextCustomItem> rightItems;
00525 
00526 };
00527 
00528 inline int QTextFlow::width() const { return w; }
00529 
00530 class QTextTable;
00531 
00532 class Q_EXPORT QTextTableCell : public QLayoutItem
00533 {
00534     friend class QTextTable;
00535 
00536 public:
00537     QTextTableCell( QTextTable* table,
00538             int row, int column,
00539             const QMap<QString, QString> &attr,
00540             const QStyleSheetItem* style,
00541             const QTextFormat& fmt, const QString& context,
00542             QMimeSourceFactory &factory, QStyleSheet *sheet, const QString& doc );
00543     virtual ~QTextTableCell();
00544 
00545     QSize sizeHint() const ;
00546     QSize minimumSize() const ;
00547     QSize maximumSize() const ;
00548     QSizePolicy::ExpandData expanding() const;
00549     bool isEmpty() const;
00550     void setGeometry( const QRect& ) ;
00551     QRect geometry() const;
00552 
00553     bool hasHeightForWidth() const;
00554     int heightForWidth( int ) const;
00555 
00556     void adjustToPainter( QPainter* );
00557 
00558     int row() const { return row_; }
00559     int column() const { return col_; }
00560     int rowspan() const { return rowspan_; }
00561     int colspan() const { return colspan_; }
00562     int stretch() const { return stretch_; }
00563 
00564     QTextDocument* richText()  const { return richtext; }
00565     QTextTable* table() const { return parent; }
00566 
00567     void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
00568 
00569     QBrush *backGround() const { return background; }
00570     virtual void invalidate();
00571 
00572     int verticalAlignmentOffset() const;
00573     int horizontalAlignmentOffset() const;
00574 
00575 private:
00576     QRect geom;
00577     QTextTable* parent;
00578     QTextDocument* richtext;
00579     int row_;
00580     int col_;
00581     int rowspan_;
00582     int colspan_;
00583     int stretch_;
00584     int maxw;
00585     int minw;
00586     bool hasFixedWidth;
00587     QBrush *background;
00588     int cached_width;
00589     int cached_sizehint;
00590     QMap<QString, QString> attributes;
00591     int align;
00592 };
00593 
00594 #if defined(Q_TEMPLATEDLL)
00595 // MOC_SKIP_BEGIN
00596 Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextTableCell>;
00597 Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<QTextCursor*, int>;
00598 // MOC_SKIP_END
00599 #endif
00600 
00601 class Q_EXPORT QTextTable: public QTextCustomItem
00602 {
00603     friend class QTextTableCell;
00604 
00605 public:
00606     QTextTable( QTextDocument *p, const QMap<QString, QString> &attr );
00607     virtual ~QTextTable();
00608 
00609     void adjustToPainter( QPainter *p );
00610     void pageBreak( int  y, QTextFlow* flow );
00611     void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch,
00612            const QColorGroup& cg, bool selected );
00613 
00614     bool noErase() const { return TRUE; }
00615     bool ownLine() const { return TRUE; }
00616     Placement placement() const { return place; }
00617     bool isNested() const { return TRUE; }
00618     void resize( int nwidth );
00619     virtual void invalidate();
00620 
00621     virtual bool enter( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy, bool atEnd = FALSE );
00622     virtual bool enterAt( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy, const QPoint &pos );
00623     virtual bool next( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
00624     virtual bool prev( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
00625     virtual bool down( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
00626     virtual bool up( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
00627 
00628     QString richText() const;
00629 
00630     int minimumWidth() const;
00631 
00632     QPtrList<QTextTableCell> tableCells() const { return cells; }
00633 
00634     bool isStretching() const { return stretch; }
00635 
00636 private:
00637     void format( int w );
00638     void addCell( QTextTableCell* cell );
00639 
00640 private:
00641     QGridLayout* layout;
00642     QPtrList<QTextTableCell> cells;
00643     int cachewidth;
00644     int fixwidth;
00645     int cellpadding;
00646     int cellspacing;
00647     int border;
00648     int outerborder;
00649     int stretch;
00650     int innerborder;
00651     int us_cp, us_ib, us_b, us_ob, us_cs;
00652     QMap<QString, QString> attributes;
00653     QMap<QTextCursor*, int> currCell;
00654     Placement place;
00655     void adjustCells( int y , int shift );
00656     int pageBreakFor;
00657 };
00658 
00659 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00660 
00661 class QTextTableCell;
00662 class QTextParagraph;
00663 
00664 struct Q_EXPORT QTextDocumentSelection
00665 {
00666     QTextCursor startCursor, endCursor;
00667     bool swapped;
00668 };
00669 
00670 #if defined(Q_TEMPLATEDLL)
00671 // MOC_SKIP_BEGIN
00672 Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QColor>;
00673 Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, bool>;
00674 Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextDocumentSelection>;
00675 Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextDocument>;
00676 // MOC_SKIP_END
00677 #endif
00678 
00679 class Q_EXPORT QTextDocument : public QObject
00680 {
00681     Q_OBJECT
00682 
00683     friend class QTextTableCell;
00684     friend class QTextCursor;
00685     friend class QTextEdit;
00686     friend class QTextParagraph;
00687 
00688 public:
00689     enum SelectionIds {
00690     Standard = 0,
00691     Temp = 32000 // This selection must not be drawn, it's used e.g. by undo/redo to
00692     // remove multiple lines with removeSelectedText()
00693     };
00694 
00695     QTextDocument( QTextDocument *p );
00696     QTextDocument( QTextDocument *d, QTextFormatCollection *f );
00697     virtual ~QTextDocument();
00698 
00699     QTextDocument *parent() const { return par; }
00700     QTextParagraph *parentParagraph() const { return parentPar; }
00701 
00702     void setText( const QString &text, const QString &context );
00703     QMap<QString, QString> attributes() const { return attribs; }
00704     void setAttributes( const QMap<QString, QString> &attr ) { attribs = attr; }
00705 
00706     QString text() const;
00707     QString text( int parag ) const;
00708     QString originalText() const;
00709 
00710     int x() const;
00711     int y() const;
00712     int width() const;
00713     int widthUsed() const;
00714     int visibleWidth() const;
00715     int height() const;
00716     void setWidth( int w );
00717     int minimumWidth() const;
00718     bool setMinimumWidth( int needed, int used = -1, QTextParagraph *parag = 0 );
00719 
00720     void setY( int y );
00721     int leftMargin() const;
00722     void setLeftMargin( int lm );
00723     int rightMargin() const;
00724     void setRightMargin( int rm );
00725 
00726     QTextParagraph *firstParagraph() const;
00727     QTextParagraph *lastParagraph() const;
00728     void setFirstParagraph( QTextParagraph *p );
00729     void setLastParagraph( QTextParagraph *p );
00730 
00731     void invalidate();
00732 
00733     void setPreProcessor( QTextPreProcessor *sh );
00734     QTextPreProcessor *preProcessor() const;
00735 
00736     void setFormatter( QTextFormatter *f );
00737     QTextFormatter *formatter() const;
00738 
00739     void setIndent( QTextIndent *i );
00740     QTextIndent *indent() const;
00741 
00742     QColor selectionColor( int id ) const;
00743     bool invertSelectionText( int id ) const;
00744     void setSelectionColor( int id, const QColor &c );
00745     void setInvertSelectionText( int id, bool b );
00746     bool hasSelection( int id, bool visible = FALSE ) const;
00747     void setSelectionStart( int id, const QTextCursor &cursor );
00748     bool setSelectionEnd( int id, const QTextCursor &cursor );
00749     void selectAll( int id );
00750     bool removeSelection( int id );
00751     void selectionStart( int id, int &paragId, int &index );
00752     QTextCursor selectionStartCursor( int id );
00753     QTextCursor selectionEndCursor( int id );
00754     void selectionEnd( int id, int &paragId, int &index );
00755     void setFormat( int id, QTextFormat *f, int flags );
00756     int numSelections() const { return nSelections; }
00757     void addSelection( int id );
00758 
00759     QString selectedText( int id, bool asRichText = FALSE ) const;
00760     void removeSelectedText( int id, QTextCursor *cursor );
00761     void indentSelection( int id );
00762 
00763     QTextParagraph *paragAt( int i ) const;
00764 
00765     void addCommand( QTextCommand *cmd );
00766     QTextCursor *undo( QTextCursor *c = 0 );
00767     QTextCursor *redo( QTextCursor *c  = 0 );
00768     QTextCommandHistory *commands() const { return commandHistory; }
00769 
00770     QTextFormatCollection *formatCollection() const;
00771 
00772     bool find( QTextCursor &cursor, const QString &expr, bool cs, bool wo, bool forward);
00773 
00774     void setTextFormat( Qt::TextFormat f );
00775     Qt::TextFormat textFormat() const;
00776 
00777     bool inSelection( int selId, const QPoint &pos ) const;
00778 
00779     QStyleSheet *styleSheet() const { return sheet_; }
00780     QMimeSourceFactory *mimeSourceFactory() const { return factory_; }
00781     QString context() const { return contxt; }
00782 
00783     void setStyleSheet( QStyleSheet *s );
00784     void setDefaultFormat( const QFont &font, const QColor &color );
00785     void setMimeSourceFactory( QMimeSourceFactory *f ) { if ( f ) factory_ = f; }
00786     void setContext( const QString &c ) { if ( !c.isEmpty() ) contxt = c; }
00787 
00788     void setUnderlineLinks( bool b );
00789     bool underlineLinks() const { return underlLinks; }
00790 
00791     void setPaper( QBrush *brush ) { if ( backBrush ) delete backBrush; backBrush = brush; }
00792     QBrush *paper() const { return backBrush; }
00793 
00794     void doLayout( QPainter *p, int w );
00795     void draw( QPainter *p, const QRect& rect, const QColorGroup &cg, const QBrush *paper = 0 );
00796     void drawParagraph( QPainter *p, QTextParagraph *parag, int cx, int cy, int cw, int ch,
00797             QPixmap *&doubleBuffer, const QColorGroup &cg,
00798             bool drawCursor, QTextCursor *cursor, bool resetChanged = TRUE );
00799     QTextParagraph *draw( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg,
00800               bool onlyChanged = FALSE, bool drawCursor = FALSE, QTextCursor *cursor = 0,
00801               bool resetChanged = TRUE );
00802 
00803     void registerCustomItem( QTextCustomItem *i, QTextParagraph *p );
00804     void unregisterCustomItem( QTextCustomItem *i, QTextParagraph *p );
00805 
00806     void setFlow( QTextFlow *f );
00807     void takeFlow();
00808     QTextFlow *flow() const { return flow_; }
00809     bool isPageBreakEnabled() const { return pages; }
00810     void setPageBreakEnabled( bool b ) { pages = b; }
00811 
00812     void setUseFormatCollection( bool b ) { useFC = b; }
00813     bool useFormatCollection() const { return useFC; }
00814 
00815     QTextTableCell *tableCell() const { return tc; }
00816     void setTableCell( QTextTableCell *c ) { tc = c; }
00817 
00818     void setPlainText( const QString &text );
00819     void setRichText( const QString &text, const QString &context );
00820     QString richText() const;
00821     QString plainText() const;
00822 
00823     bool focusNextPrevChild( bool next );
00824 
00825     int alignment() const;
00826     void setAlignment( int a );
00827 
00828     int *tabArray() const;
00829     int tabStopWidth() const;
00830     void setTabArray( int *a );
00831     void setTabStops( int tw );
00832 
00833     void setUndoDepth( int d ) { commandHistory->setUndoDepth( d ); }
00834     int undoDepth() const { return commandHistory->undoDepth(); }
00835 
00836     int length() const;
00837     void clear( bool createEmptyParag = FALSE );
00838 
00839     virtual QTextParagraph *createParagraph( QTextDocument *d, QTextParagraph *pr = 0, QTextParagraph *nx = 0, bool updateIds = TRUE );
00840     void insertChild( QObject *o ) { QObject::insertChild( o ); }
00841     void removeChild( QObject *o ) { QObject::removeChild( o ); }
00842     void insertChild( QTextDocument *d ) { childList.append( d ); }
00843     void removeChild( QTextDocument *d ) { childList.removeRef( d ); }
00844     QPtrList<QTextDocument> children() const { return childList; }
00845 
00846     bool hasFocusParagraph() const;
00847     QString focusHref() const;
00848 
00849     void invalidateOriginalText() { oTextValid = FALSE; oText = ""; }
00850 
00851     static QString section( QString str, const QString &sep, int start, int end = 0xffffffff );
00852     static bool endsWith( QString str, const QString &s);
00853 
00854 signals:
00855     void minimumWidthChanged( int );
00856 
00857 private:
00858     void init();
00859     QPixmap *bufferPixmap( const QSize &s );
00860     // HTML parser
00861     bool hasPrefix(const QChar* doc, int length, int pos, QChar c);
00862     bool hasPrefix(const QChar* doc, int length, int pos, const QString& s);
00863     QTextCustomItem* parseTable( const QMap<QString, QString> &attr, const QTextFormat &fmt,
00864                  const QChar* doc, int length, int& pos, QTextParagraph *curpar );
00865     bool eatSpace(const QChar* doc, int length, int& pos, bool includeNbsp = FALSE );
00866     bool eat(const QChar* doc, int length, int& pos, QChar c);
00867     QString parseOpenTag(const QChar* doc, int length, int& pos, QMap<QString, QString> &attr, bool& emptyTag);
00868     QString parseCloseTag( const QChar* doc, int length, int& pos );
00869     QChar parseHTMLSpecialChar(const QChar* doc, int length, int& pos);
00870     QString parseWord(const QChar* doc, int length, int& pos, bool lower = TRUE);
00871     QChar parseChar(const QChar* doc, int length, int& pos, QStyleSheetItem::WhiteSpaceMode wsm );
00872     void setRichTextInternal( const QString &text, QTextCursor* cursor = 0 );
00873     void setRichTextMarginsInternal( QPtrList< QPtrVector<QStyleSheetItem> >& styles, QTextParagraph* stylesPar );
00874 
00875 private:
00876     struct Q_EXPORT Focus {
00877     QTextParagraph *parag;
00878     int start, len;
00879     QString href;
00880     };
00881 
00882     int cx, cy, cw, vw;
00883     QTextParagraph *fParag, *lParag;
00884     QTextPreProcessor *pProcessor;
00885     QMap<int, QColor> selectionColors;
00886     QMap<int, QTextDocumentSelection> selections;
00887     QMap<int, bool> selectionText;
00888     QTextCommandHistory *commandHistory;
00889     QTextFormatter *pFormatter;
00890     QTextIndent *indenter;
00891     QTextFormatCollection *fCollection;
00892     Qt::TextFormat txtFormat;
00893     uint preferRichText : 1;
00894     uint pages : 1;
00895     uint useFC : 1;
00896     uint withoutDoubleBuffer : 1;
00897     uint underlLinks : 1;
00898     uint nextDoubleBuffered : 1;
00899     uint oTextValid : 1;
00900     uint mightHaveCustomItems : 1;
00901     int align;
00902     int nSelections;
00903     QTextFlow *flow_;
00904     QTextDocument *par;
00905     QTextParagraph *parentPar;
00906     QTextTableCell *tc;
00907     QBrush *backBrush;
00908     QPixmap *buf_pixmap;
00909     Focus focusIndicator;
00910     int minw;
00911     int wused;
00912     int leftmargin;
00913     int rightmargin;
00914     QTextParagraph *minwParag, *curParag;
00915     QStyleSheet* sheet_;
00916     QMimeSourceFactory* factory_;
00917     QString contxt;
00918     QMap<QString, QString> attribs;
00919     int *tArray;
00920     int tStopWidth;
00921     int uDepth;
00922     QString oText;
00923     QPtrList<QTextDocument> childList;
00924     QColor linkColor;
00925     double scaleFontsFactor;
00926 
00927     short list_tm,list_bm, list_lm, li_tm, li_bm, par_tm, par_bm;
00928 };
00929 
00930 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00931 
00932 
00933 class Q_EXPORT QTextDeleteCommand : public QTextCommand
00934 {
00935 public:
00936     QTextDeleteCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str,
00937             const QByteArray& oldStyle );
00938     QTextDeleteCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str );
00939     virtual ~QTextDeleteCommand();
00940 
00941     Commands type() const { return Delete; }
00942     QTextCursor *execute( QTextCursor *c );
00943     QTextCursor *unexecute( QTextCursor *c );
00944 
00945 protected:
00946     int id, index;
00947     QTextParagraph *parag;
00948     QMemArray<QTextStringChar> text;
00949     QByteArray styleInformation;
00950 
00951 };
00952 
00953 class Q_EXPORT QTextInsertCommand : public QTextDeleteCommand
00954 {
00955 public:
00956     QTextInsertCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str,
00957             const QByteArray& oldStyleInfo )
00958     : QTextDeleteCommand( d, i, idx, str, oldStyleInfo ) {}
00959     QTextInsertCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str )
00960     : QTextDeleteCommand( p, idx, str ) {}
00961     virtual ~QTextInsertCommand() {}
00962 
00963     Commands type() const { return Insert; }
00964     QTextCursor *execute( QTextCursor *c ) { return QTextDeleteCommand::unexecute( c ); }
00965     QTextCursor *unexecute( QTextCursor *c ) { return QTextDeleteCommand::execute( c ); }
00966 
00967 };
00968 
00969 class Q_EXPORT QTextFormatCommand : public QTextCommand
00970 {
00971 public:
00972     QTextFormatCommand( QTextDocument *d, int sid, int sidx, int eid, int eidx, const QMemArray<QTextStringChar> &old, QTextFormat *f, int fl );
00973     virtual ~QTextFormatCommand();
00974 
00975     Commands type() const { return Format; }
00976     QTextCursor *execute( QTextCursor *c );
00977     QTextCursor *unexecute( QTextCursor *c );
00978 
00979 protected:
00980     int startId, startIndex, endId, endIndex;
00981     QTextFormat *format;
00982     QMemArray<QTextStringChar> oldFormats;
00983     int flags;
00984 
00985 };
00986 
00987 class Q_EXPORT QTextStyleCommand : public QTextCommand
00988 {
00989 public:
00990     QTextStyleCommand( QTextDocument *d, int fParag, int lParag, const QByteArray& beforeChange  );
00991     virtual ~QTextStyleCommand() {}
00992 
00993     Commands type() const { return Style; }
00994     QTextCursor *execute( QTextCursor *c );
00995     QTextCursor *unexecute( QTextCursor *c );
00996 
00997     static QByteArray readStyleInformation(  QTextDocument* d, int fParag, int lParag );
00998     static void writeStyleInformation(  QTextDocument* d, int fParag, const QByteArray& style );
00999 
01000 private:
01001     int firstParag, lastParag;
01002     QByteArray before;
01003     QByteArray after;
01004 };
01005 
01006 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01007 
01008 struct Q_EXPORT QTextParagraphSelection
01009 {
01010     int start, end;
01011 };
01012 
01013 struct Q_EXPORT QTextLineStart
01014 {
01015     QTextLineStart() : y( 0 ), baseLine( 0 ), h( 0 )
01016 #ifndef QT_NO_COMPLEXTEXT
01017     , bidicontext( 0 )
01018 #endif
01019     {  }
01020     QTextLineStart( ushort y_, ushort bl, ushort h_ ) : y( y_ ), baseLine( bl ), h( h_ ),
01021     w( 0 )
01022 #ifndef QT_NO_COMPLEXTEXT
01023     , bidicontext( 0 )
01024 #endif
01025     {  }
01026 #ifndef QT_NO_COMPLEXTEXT
01027     QTextLineStart( QBidiContext *c, QBidiStatus s ) : y(0), baseLine(0), h(0),
01028     status( s ), bidicontext( c ) { if ( bidicontext ) bidicontext->ref(); }
01029 #endif
01030 
01031     virtual ~QTextLineStart()
01032     {
01033 #ifndef QT_NO_COMPLEXTEXT
01034     if ( bidicontext && bidicontext->deref() )
01035         delete bidicontext;
01036 #endif
01037     }
01038 
01039 #ifndef QT_NO_COMPLEXTEXT
01040     void setContext( QBidiContext *c ) {
01041     if ( c == bidicontext )
01042         return;
01043     if ( bidicontext && bidicontext->deref() )
01044         delete bidicontext;
01045     bidicontext = c;
01046     if ( bidicontext )
01047         bidicontext->ref();
01048     }
01049     QBidiContext *context() const { return bidicontext; }
01050 #endif
01051 
01052 public:
01053     ushort y, baseLine, h;
01054 #ifndef QT_NO_COMPLEXTEXT
01055     QBidiStatus status;
01056 #endif
01057     int w;
01058 
01059 private:
01060 #ifndef QT_NO_COMPLEXTEXT
01061     QBidiContext *bidicontext;
01062 #endif
01063 };
01064 
01065 #if defined(Q_TEMPLATEDLL)
01066 // MOC_SKIP_BEGIN
01067 Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextParagraphSelection>;
01068 Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextLineStart*>;
01069 // MOC_SKIP_END
01070 #endif
01071 
01072 class Q_EXPORT QTextParagraphData
01073 {
01074 public:
01075     QTextParagraphData() {}
01076     virtual ~QTextParagraphData();
01077     virtual void join( QTextParagraphData * );
01078 };
01079 
01080 class Q_EXPORT QTextParagraphPseudoDocument
01081 {
01082 public:
01083     QTextParagraphPseudoDocument();
01084     ~QTextParagraphPseudoDocument();
01085     QRect docRect;
01086     QTextFormatter *pFormatter;
01087     QTextCommandHistory *commandHistory;
01088     int minw;
01089     int wused;
01090 };
01091 
01092 //nase
01093 class Q_EXPORT QTextParagraph
01094 {
01095     friend class QTextDocument;
01096     friend class QTextCursor;
01097 
01098 public:
01099     QTextParagraph( QTextDocument *d, QTextParagraph *pr = 0, QTextParagraph *nx = 0, bool updateIds = TRUE );
01100     virtual ~QTextParagraph();
01101 
01102     QTextString *string() const;
01103     QTextStringChar *at( int i ) const; // maybe remove later
01104     int leftGap() const;
01105     int length() const; // maybe remove later
01106 
01107     void setListStyle( QStyleSheetItem::ListStyle ls ) { lstyle = ls; changed = TRUE; }
01108     QStyleSheetItem::ListStyle listStyle() const { return lstyle; }
01109     void setListItem( bool li ) { litem = li; changed = TRUE; }
01110     bool isListItem() const { return litem; }
01111     void setListValue( int v ) { list_val = v; }
01112     int listValue() const { return list_val > 0 ? list_val : -1; }
01113 
01114     void setListDepth( int depth );
01115     int listDepth() const { return ldepth; }
01116 
01117 //     void setFormat( QTextFormat *fm );
01118 //     QTextFormat *paragFormat() const;
01119 
01120     QTextDocument *document() const;
01121     QTextParagraphPseudoDocument *pseudoDocument() const;
01122 
01123     QRect rect() const;
01124     void setHeight( int h ) { r.setHeight( h ); }
01125     void show();
01126     void hide();
01127     bool isVisible() const { return visible; }
01128 
01129     QTextParagraph *prev() const;
01130     QTextParagraph *next() const;
01131     void setPrev( QTextParagraph *s );
01132     void setNext( QTextParagraph *s );
01133 
01134     void insert( int index, const QString &s );
01135     void insert( int index, const QChar *unicode, int len );
01136     void append( const QString &s, bool reallyAtEnd = FALSE );
01137     void truncate( int index );
01138     void remove( int index, int len );
01139     void join( QTextParagraph *s );
01140 
01141     void invalidate( int chr );
01142 
01143     void move( int &dy );
01144     void format( int start = -1, bool doMove = TRUE );
01145 
01146     bool isValid() const;
01147     bool hasChanged() const;
01148     void setChanged( bool b, bool recursive = FALSE );
01149 
01150     int lineHeightOfChar( int i, int *bl = 0, int *y = 0 ) const;
01151     QTextStringChar *lineStartOfChar( int i, int *index = 0, int *line = 0 ) const;
01152     int lines() const;
01153     QTextStringChar *lineStartOfLine( int line, int *index = 0 ) const;
01154     int lineY( int l ) const;
01155     int lineBaseLine( int l ) const;
01156     int lineHeight( int l ) const;
01157     void lineInfo( int l, int &y, int &h, int &bl ) const;
01158 
01159     void setSelection( int id, int start, int end );
01160     void removeSelection( int id );
01161     int selectionStart( int id ) const;
01162     int selectionEnd( int id ) const;
01163     bool hasSelection( int id ) const;
01164     bool hasAnySelection() const;
01165     bool fullSelected( int id ) const;
01166 
01167     void setEndState( int s );
01168     int endState() const;
01169 
01170     void setParagId( int i );
01171     int paragId() const;
01172 
01173     bool firstPreProcess() const;
01174     void setFirstPreProcess( bool b );
01175 
01176     void indent( int *oldIndent = 0, int *newIndent = 0 );
01177 
01178     void setExtraData( QTextParagraphData *data );
01179     QTextParagraphData *extraData() const;
01180 
01181     QMap<int, QTextLineStart*> &lineStartList();
01182 
01183     void setFormat( int index, int len, QTextFormat *f, bool useCollection = TRUE, int flags = -1 );
01184 
01185     void setAlignment( int a );
01186     int alignment() const;
01187 
01188     virtual void paint( QPainter &painter, const QColorGroup &cg, QTextCursor *cursor = 0, bool drawSelections = FALSE,
01189             int clipx = -1, int clipy = -1, int clipw = -1, int cliph = -1 );
01190 
01191     virtual int topMargin() const;
01192     virtual int bottomMargin() const;
01193     virtual int leftMargin() const;
01194     virtual int firstLineMargin() const;
01195     virtual int rightMargin() const;
01196     virtual int lineSpacing() const;
01197 
01198     void registerFloatingItem( QTextCustomItem *i );
01199     void unregisterFloatingItem( QTextCustomItem *i );
01200 
01201     void setFullWidth( bool b ) { fullWidth = b; }
01202     bool isFullWidth() const { return fullWidth; }
01203 
01204     QTextTableCell *tableCell() const;
01205 
01206     QBrush *background() const;
01207 
01208     int documentWidth() const;
01209     int documentVisibleWidth() const;
01210     int documentX() const;
01211     int documentY() const;
01212     QTextFormatCollection *formatCollection() const;
01213     QTextFormatter *formatter() const;
01214 
01215     virtual int nextTab( int i, int x );
01216     int *tabArray() const;
01217     void setTabArray( int *a );
01218     void setTabStops( int tw );
01219 
01220     void adjustToPainter( QPainter *p );
01221 
01222     void setNewLinesAllowed( bool b );
01223     bool isNewLinesAllowed() const;
01224 
01225     QString richText() const;
01226 
01227     void addCommand( QTextCommand *cmd );
01228     QTextCursor *undo( QTextCursor *c = 0 );
01229     QTextCursor *redo( QTextCursor *c  = 0 );
01230     QTextCommandHistory *commands() const;
01231     virtual void copyParagData( QTextParagraph *parag );
01232 
01233     void setBreakable( bool b ) { breakable = b; }
01234     bool isBreakable() const { return breakable; }
01235 
01236     void setBackgroundColor( const QColor &c );
01237     QColor *backgroundColor() const { return bgcol; }
01238     void clearBackgroundColor();
01239 
01240     void setMovedDown( bool b ) { movedDown = b; }
01241     bool wasMovedDown() const { return movedDown; }
01242 
01243     void setDirection( QChar::Direction d );
01244     QChar::Direction direction() const;
01245 
01246     void readStyleInformation( QDataStream& stream );
01247     void writeStyleInformation( QDataStream& stream ) const;
01248 
01249 protected:
01250     virtual void drawLabel( QPainter* p, int x, int y, int w, int h, int base, const QColorGroup& cg );
01251     virtual void drawString( QPainter &painter, const QString &str, int start, int len, int xstart,
01252                  int y, int baseLine, int w, int h, int selection,
01253                  QTextStringChar *formatChar, const QColorGroup& cg,
01254                  bool rightToLeft );
01255 
01256 private:
01257     QMap<int, QTextParagraphSelection> &selections() const;
01258     QPtrList<QTextCustomItem> &floatingItems() const;
01259     QBrush backgroundBrush( const QColorGroup&cg ) { if ( bgcol ) return *bgcol; return cg.brush( QColorGroup::Base ); }
01260     void invalidateStyleCache();
01261 
01262     QMap<int, QTextLineStart*> lineStarts;
01263     int invalid;
01264     QRect r;
01265     QTextParagraph *p, *n;
01266     void *docOrPseudo;
01267     uint changed : 1;
01268     uint firstFormat : 1;
01269     uint firstPProcess : 1;
01270     uint needPreProcess : 1;
01271     uint fullWidth : 1;
01272     uint lastInFrame : 1;
01273     uint visible : 1;
01274     uint breakable : 1;
01275     uint movedDown : 1;
01276     uint mightHaveCustomItems : 1;
01277     uint hasdoc : 1;
01278     uint litem : 1; // whether the paragraph is a list item
01279     uint rtext : 1; // whether the paragraph needs rich text margin
01280     int align : 4;
01281     int state, id;
01282     QTextString *str;
01283     QMap<int, QTextParagraphSelection> *mSelections;
01284     QPtrList<QTextCustomItem> *mFloatingItems;
01285     QStyleSheetItem::ListStyle lstyle;
01286     short utm, ubm, ulm, urm, uflm, ulinespacing;
01287     int *tArray;
01288     short tabStopWidth;
01289     QTextParagraphData *eData;
01290     short list_val;
01291     QColor *bgcol;
01292     ushort ldepth;
01293 
01294 };
01295 
01296 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01297 
01298 class Q_EXPORT QTextFormatter
01299 {
01300 public:
01301     QTextFormatter();
01302     virtual ~QTextFormatter();
01303 
01304     virtual int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts ) = 0;
01305     virtual int formatVertically( QTextDocument* doc, QTextParagraph* parag );
01306 
01307     bool isWrapEnabled( QTextParagraph *p ) const { if ( !wrapEnabled ) return FALSE; if ( p && !p->isBreakable() ) return FALSE; return TRUE;}
01308     int wrapAtColumn() const { return wrapColumn;}
01309     virtual void setWrapEnabled( bool b );
01310     virtual void setWrapAtColumn( int c );
01311     virtual void setAllowBreakInWords( bool b ) { biw = b; }
01312     bool allowBreakInWords() const { return biw; }
01313 
01314     int minimumWidth() const { return thisminw; }
01315     int widthUsed() const { return thiswused; }
01316 
01317     static bool isBreakable( QTextString *string, int pos );
01318 
01319 protected:
01320     virtual QTextLineStart *formatLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start,
01321                            QTextStringChar *last, int align = Qt3::AlignAuto, int space = 0 );
01322 #ifndef QT_NO_COMPLEXTEXT
01323     virtual QTextLineStart *bidiReorderLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start,
01324                             QTextStringChar *last, int align, int space );
01325 #endif
01326     void insertLineStart( QTextParagraph *parag, int index, QTextLineStart *ls );
01327 
01328     int thisminw;
01329     int thiswused;
01330 
01331 private:
01332     bool wrapEnabled;
01333     int wrapColumn;
01334     bool biw;
01335 
01336 #ifdef HAVE_THAI_BREAKS
01337     static QCString *thaiCache;
01338     static QTextString *cachedString;
01339     static ThBreakIterator *thaiIt;
01340 #endif
01341 };
01342 
01343 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01344 
01345 class Q_EXPORT QTextFormatterBreakInWords : public QTextFormatter
01346 {
01347 public:
01348     QTextFormatterBreakInWords();
01349     virtual ~QTextFormatterBreakInWords() {}
01350 
01351     int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts );
01352 
01353 };
01354 
01355 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01356 
01357 class Q_EXPORT QTextFormatterBreakWords : public QTextFormatter
01358 {
01359 public:
01360     QTextFormatterBreakWords();
01361     virtual ~QTextFormatterBreakWords() {}
01362 
01363     int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts );
01364 
01365 };
01366 
01367 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01368 
01369 class Q_EXPORT QTextIndent
01370 {
01371 public:
01372     QTextIndent();
01373     virtual ~QTextIndent() {}
01374 
01375     virtual void indent( QTextDocument *doc, QTextParagraph *parag, int *oldIndent = 0, int *newIndent = 0 ) = 0;
01376 
01377 };
01378 
01379 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01380 
01381 class Q_EXPORT QTextPreProcessor
01382 {
01383 public:
01384     enum Ids {
01385     Standard = 0
01386     };
01387 
01388     QTextPreProcessor();
01389     virtual ~QTextPreProcessor() {}
01390 
01391     virtual void process( QTextDocument *doc, QTextParagraph *, int, bool = TRUE ) = 0;
01392     virtual QTextFormat *format( int id ) = 0;
01393 
01394 };
01395 
01396 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01397 
01398 class Q_EXPORT QTextFormat
01399 {
01400     friend class QTextFormatCollection;
01401     friend class QTextDocument;
01402 
01403 public:
01404     enum Flags {
01405     NoFlags,
01406     Bold = 1,
01407     Italic = 2,
01408     Underline = 4,
01409     Family = 8,
01410     Size = 16,
01411     Color = 32,
01412     Misspelled = 64,
01413     VAlign = 128,
01414     StrikeOut= 256,
01415     Font = Bold | Italic | Underline | Family | Size | StrikeOut,
01416     Format = Font | Color | Misspelled | VAlign
01417     };
01418 
01419     enum VerticalAlignment { AlignNormal, AlignSuperScript, AlignSubScript };
01420 
01421     QTextFormat();
01422     virtual ~QTextFormat();
01423 
01424     QTextFormat( const QStyleSheetItem *s );
01425     QTextFormat( const QFont &f, const QColor &c, QTextFormatCollection *parent = 0 );
01426     QTextFormat( const QTextFormat &fm );
01427     QTextFormat makeTextFormat( const QStyleSheetItem *style, const QMap<QString,QString>& attr, double scaleFontsFactor ) const;
01428     QTextFormat& operator=( const QTextFormat &fm );
01429     QColor color() const;
01430     QFont font() const;
01431     bool isMisspelled() const;
01432     VerticalAlignment vAlign() const;
01433     int minLeftBearing() const;
01434     int minRightBearing() const;
01435     int width( const QChar &c ) const;
01436     int width( const QString &str, int pos ) const;
01437     int height() const;
01438     int ascent() const;
01439     int descent() const;
01440     int leading() const;
01441     bool useLinkColor() const;
01442 
01443     void setBold( bool b );
01444     void setItalic( bool b );
01445     void setUnderline( bool b );
01446     void setStrikeOut( bool b );
01447     void setFamily( const QString &f );
01448     void setPointSize( int s );
01449     void setFont( const QFont &f );
01450     void setColor( const QColor &c );
01451     void setMisspelled( bool b );
01452     void setVAlign( VerticalAlignment a );
01453 
01454     bool operator==( const QTextFormat &f ) const;
01455     QTextFormatCollection *parent() const;
01456     QString key() const;
01457 
01458     static QString getKey( const QFont &f, const QColor &c, bool misspelled, VerticalAlignment vAlign );
01459 
01460     void addRef();
01461     void removeRef();
01462 
01463     QString makeFormatChangeTags( QTextFormat* defaultFormat, QTextFormat *f, const QString& oldAnchorHref, const QString& anchorHref ) const;
01464     QString makeFormatEndTags( QTextFormat* defaultFormat, const QString& anchorHref ) const;
01465 
01466     static void setPainter( QPainter *p );
01467     static QPainter* painter();
01468 
01469     bool fontSizesInPixels() { return usePixelSizes; }
01470 
01471 protected:
01472     virtual void generateKey();
01473 
01474 private:
01475     void update();
01476 
01477 private:
01478     QFont fn;
01479     QColor col;
01480     QFontMetrics fm;
01481     uint missp : 1;
01482     uint linkColor : 1;
01483     uint usePixelSizes : 1;
01484     int leftBearing, rightBearing;
01485     VerticalAlignment ha;
01486     uchar widths[ 256 ];
01487     int hei, asc, dsc;
01488     QTextFormatCollection *collection;
01489     int ref;
01490     QString k;
01491     int logicalFontSize;
01492     int stdSize;
01493     static QPainter *pntr;
01494 
01495 };
01496 
01497 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01498 
01499 #if defined(Q_TEMPLATEDLL)
01500 // MOC_SKIP_BEGIN
01501 Q_TEMPLATE_EXTERN template class Q_EXPORT QDict<QTextFormat>;
01502 // MOC_SKIP_END
01503 #endif
01504 
01505 class Q_EXPORT QTextFormatCollection
01506 {
01507     friend class QTextDocument;
01508     friend class QTextFormat;
01509 
01510 public:
01511     QTextFormatCollection();
01512     virtual ~QTextFormatCollection();
01513 
01514     void setDefaultFormat( QTextFormat *f );
01515     QTextFormat *defaultFormat() const;
01516     virtual QTextFormat *format( QTextFormat *f );
01517     virtual QTextFormat *format( QTextFormat *of, QTextFormat *nf, int flags );
01518     virtual QTextFormat *format( const QFont &f, const QColor &c );
01519     virtual void remove( QTextFormat *f );
01520     virtual QTextFormat *createFormat( const QTextFormat &f ) { return new QTextFormat( f ); }
01521     virtual QTextFormat *createFormat( const QFont &f, const QColor &c ) { return new QTextFormat( f, c, this ); }
01522 
01523     void updateDefaultFormat( const QFont &font, const QColor &c, QStyleSheet *sheet );
01524     QDict<QTextFormat> dict() const { return cKey; }
01525 
01526 private:
01527     void updateKeys();
01528 
01529 private:
01530     QTextFormat *defFormat, *lastFormat, *cachedFormat;
01531     QDict<QTextFormat> cKey;
01532     QTextFormat *cres;
01533     QFont cfont;
01534     QColor ccol;
01535     QString kof, knf;
01536     int cflags;
01537 };
01538 
01539 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01540 
01541 inline int QTextString::length() const
01542 {
01543     return data.size();
01544 }
01545 
01546 inline int QTextParagraph::length() const
01547 {
01548     return str->length();
01549 }
01550 
01551 inline QRect QTextParagraph::rect() const
01552 {
01553     return r;
01554 }
01555 
01556 inline QTextParagraph *QTextCursor::paragraph() const
01557 {
01558     return para;
01559 }
01560 
01561 inline int QTextCursor::index() const
01562 {
01563     return idx;
01564 }
01565 
01566 
01567 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01568 
01569 inline int QTextDocument::x() const
01570 {
01571     return cx;
01572 }
01573 
01574 inline int QTextDocument::y() const
01575 {
01576     return cy;
01577 }
01578 
01579 inline int QTextDocument::width() const
01580 {
01581     return QMAX( cw, flow_->width() );
01582 }
01583 
01584 inline int QTextDocument::visibleWidth() const
01585 {
01586     return vw;
01587 }
01588 
01589 inline QTextParagraph *QTextDocument::firstParagraph() const
01590 {
01591     return fParag;
01592 }
01593 
01594 inline QTextParagraph *QTextDocument::lastParagraph() const
01595 {
01596     return lParag;
01597 }
01598 
01599 inline void QTextDocument::setFirstParagraph( QTextParagraph *p )
01600 {
01601     fParag = p;
01602 }
01603 
01604 inline void QTextDocument::setLastParagraph( QTextParagraph *p )
01605 {
01606     lParag = p;
01607 }
01608 
01609 inline void QTextDocument::setWidth( int w )
01610 {
01611     cw = QMAX( w, minw );
01612     flow_->setWidth( cw );
01613     vw = w;
01614 }
01615 
01616 inline int QTextDocument::minimumWidth() const
01617 {
01618     return minw;
01619 }
01620 
01621 inline void QTextDocument::setY( int y )
01622 {
01623     cy = y;
01624 }
01625 
01626 inline int QTextDocument::leftMargin() const
01627 {
01628     return leftmargin;
01629 }
01630 
01631 inline void QTextDocument::setLeftMargin( int lm )
01632 {
01633     leftmargin = lm;
01634 }
01635 
01636 inline int QTextDocument::rightMargin() const
01637 {
01638     return rightmargin;
01639 }
01640 
01641 inline void QTextDocument::setRightMargin( int rm )
01642 {
01643     rightmargin = rm;
01644 }
01645 
01646 inline QTextPreProcessor *QTextDocument::preProcessor() const
01647 {
01648     return pProcessor;
01649 }
01650 
01651 inline void QTextDocument::setPreProcessor( QTextPreProcessor * sh )
01652 {
01653     pProcessor = sh;
01654 }
01655 
01656 inline void QTextDocument::setFormatter( QTextFormatter *f )
01657 {
01658     delete pFormatter;
01659     pFormatter = f;
01660 }
01661 
01662 inline QTextFormatter *QTextDocument::formatter() const
01663 {
01664     return pFormatter;
01665 }
01666 
01667 inline void QTextDocument::setIndent( QTextIndent *i )
01668 {
01669     indenter = i;
01670 }
01671 
01672 inline QTextIndent *QTextDocument::indent() const
01673 {
01674     return indenter;
01675 }
01676 
01677 inline QColor QTextDocument::selectionColor( int id ) const
01678 {
01679     return selectionColors[ id ];
01680 }
01681 
01682 inline bool QTextDocument::invertSelectionText( int id ) const
01683 {
01684     return selectionText[ id ];
01685 }
01686 
01687 inline void QTextDocument::setSelectionColor( int id, const QColor &c )
01688 {
01689     selectionColors[ id ] = c;
01690 }
01691 
01692 inline void QTextDocument::setInvertSelectionText( int id, bool b )
01693 {
01694     selectionText[ id ] = b;
01695 }
01696 
01697 inline QTextFormatCollection *QTextDocument::formatCollection() const
01698 {
01699     return fCollection;
01700 }
01701 
01702 inline int QTextDocument::alignment() const
01703 {
01704     return align;
01705 }
01706 
01707 inline void QTextDocument::setAlignment( int a )
01708 {
01709     align = a;
01710 }
01711 
01712 inline int *QTextDocument::tabArray() const
01713 {
01714     return tArray;
01715 }
01716 
01717 inline int QTextDocument::tabStopWidth() const
01718 {
01719     return tStopWidth;
01720 }
01721 
01722 inline void QTextDocument::setTabArray( int *a )
01723 {
01724     tArray = a;
01725 }
01726 
01727 inline void QTextDocument::setTabStops( int tw )
01728 {
01729     tStopWidth = tw;
01730 }
01731 
01732 inline QString QTextDocument::originalText() const
01733 {
01734     if ( oTextValid )
01735     return oText;
01736     return text();
01737 }
01738 
01739 inline void QTextDocument::setFlow( QTextFlow *f )
01740 {
01741     if ( flow_ )
01742     delete flow_;
01743     flow_ = f;
01744 }
01745 
01746 inline void QTextDocument::takeFlow()
01747 {
01748     flow_ = 0;
01749 }
01750 
01751 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01752 
01753 inline QColor QTextFormat::color() const
01754 {
01755     return col;
01756 }
01757 
01758 inline QFont QTextFormat::font() const
01759 {
01760     return fn;
01761 }
01762 
01763 inline bool QTextFormat::isMisspelled() const
01764 {
01765     return missp;
01766 }
01767 
01768 inline QTextFormat::VerticalAlignment QTextFormat::vAlign() const
01769 {
01770     return ha;
01771 }
01772 
01773 inline bool QTextFormat::operator==( const QTextFormat &f ) const
01774 {
01775     return k == f.k;
01776 }
01777 
01778 inline QTextFormatCollection *QTextFormat::parent() const
01779 {
01780     return collection;
01781 }
01782 
01783 inline void QTextFormat::addRef()
01784 {
01785     ref++;
01786 }
01787 
01788 inline void QTextFormat::removeRef()
01789 {
01790     ref--;
01791     if ( !collection )
01792     return;
01793     if ( this == collection->defFormat )
01794     return;
01795     if ( ref == 0 )
01796     collection->remove( this );
01797 }
01798 
01799 inline QString QTextFormat::key() const
01800 {
01801     return k;
01802 }
01803 
01804 inline bool QTextFormat::useLinkColor() const
01805 {
01806     return linkColor;
01807 }
01808 
01809 
01810 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01811 
01812 inline QTextStringChar &QTextString::at( int i ) const
01813 {
01814     return data[ i ];
01815 }
01816 
01817 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01818 
01819 inline QTextStringChar *QTextParagraph::at( int i ) const
01820 {
01821     return &str->at( i );
01822 }
01823 
01824 inline bool QTextParagraph::isValid() const
01825 {
01826     return invalid == -1;
01827 }
01828 
01829 inline bool QTextParagraph::hasChanged() const
01830 {
01831     return changed;
01832 }
01833 
01834 inline void QTextParagraph::setBackgroundColor( const QColor & c )
01835 {
01836     delete bgcol;
01837     bgcol = new QColor( c );
01838     setChanged( TRUE );
01839 }
01840 
01841 inline void QTextParagraph::clearBackgroundColor()
01842 {
01843     delete bgcol; bgcol = 0; setChanged( TRUE );
01844 }
01845 
01846 inline void QTextParagraph::append( const QString &s, bool reallyAtEnd )
01847 {
01848     if ( reallyAtEnd )
01849     insert( str->length(), s );
01850     else
01851     insert( QMAX( str->length() - 1, 0 ), s );
01852 }
01853 
01854 inline QTextParagraph *QTextParagraph::prev() const
01855 {
01856     return p;
01857 }
01858 
01859 inline QTextParagraph *QTextParagraph::next() const
01860 {
01861     return n;
01862 }
01863 
01864 inline bool QTextParagraph::hasAnySelection() const
01865 {
01866     return mSelections ? !selections().isEmpty() : FALSE;
01867 }
01868 
01869 inline void QTextParagraph::setEndState( int s )
01870 {
01871     if ( s == state )
01872     return;
01873     state = s;
01874 }
01875 
01876 inline int QTextParagraph::endState() const
01877 {
01878     return state;
01879 }
01880 
01881 inline void QTextParagraph::setParagId( int i )
01882 {
01883     id = i;
01884 }
01885 
01886 inline int QTextParagraph::paragId() const
01887 {
01888     if ( id == -1 )
01889     owarn << "invalid parag id!!!!!!!! (" << (void*)this << ")" << oendl;
01890     return id;
01891 }
01892 
01893 inline bool QTextParagraph::firstPreProcess() const
01894 {
01895     return firstPProcess;
01896 }
01897 
01898 inline void QTextParagraph::setFirstPreProcess( bool b )
01899 {
01900     firstPProcess = b;
01901 }
01902 
01903 inline QMap<int, QTextLineStart*> &QTextParagraph::lineStartList()
01904 {
01905     return lineStarts;
01906 }
01907 
01908 inline QTextString *QTextParagraph::string() const
01909 {
01910     return str;
01911 }
01912 
01913 inline QTextDocument *QTextParagraph::document() const
01914 {
01915     if ( hasdoc )
01916     return (QTextDocument*) docOrPseudo;
01917     return 0;
01918 }
01919 
01920 inline QTextParagraphPseudoDocument *QTextParagraph::pseudoDocument() const
01921 {
01922     if ( hasdoc )
01923     return 0;
01924     return (QTextParagraphPseudoDocument*) docOrPseudo;
01925 }
01926 
01927 
01928 inline QTextTableCell *QTextParagraph::tableCell() const
01929 {
01930     return hasdoc ? document()->tableCell () : 0;
01931 }
01932 
01933 inline QTextCommandHistory *QTextParagraph::commands() const
01934 {
01935     return hasdoc ? document()->commands() : pseudoDocument()->commandHistory;
01936 }
01937 
01938 
01939 inline int QTextParagraph::alignment() const
01940 {
01941     return align;
01942 }
01943 
01944 inline void QTextParagraph::registerFloatingItem( QTextCustomItem *i )
01945 {
01946     floatingItems().append( i );
01947 }
01948 
01949 inline void QTextParagraph::unregisterFloatingItem( QTextCustomItem *i )
01950 {
01951     floatingItems().removeRef( i );
01952 }
01953 
01954 inline QBrush *QTextParagraph::background() const
01955 {
01956     return tableCell() ? tableCell()->backGround() : 0;
01957 }
01958 
01959 inline int QTextParagraph::documentWidth() const
01960 {
01961     return hasdoc ? document()->width() : pseudoDocument()->docRect.width();
01962 }
01963 
01964 inline int QTextParagraph::documentVisibleWidth() const
01965 {
01966     return hasdoc ? document()->visibleWidth() : pseudoDocument()->docRect.width();
01967 }
01968 
01969 inline int QTextParagraph::documentX() const
01970 {
01971     return hasdoc ? document()->x() : pseudoDocument()->docRect.x();
01972 }
01973 
01974 inline int QTextParagraph::documentY() const
01975 {
01976     return hasdoc ? document()->y() : pseudoDocument()->docRect.y();
01977 }
01978 
01979 inline void QTextParagraph::setExtraData( QTextParagraphData *data )
01980 {
01981     eData = data;
01982 }
01983 
01984 inline QTextParagraphData *QTextParagraph::extraData() const
01985 {
01986     return eData;
01987 }
01988 
01989 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
01990 
01991 inline void QTextFormatCollection::setDefaultFormat( QTextFormat *f )
01992 {
01993     defFormat = f;
01994 }
01995 
01996 inline QTextFormat *QTextFormatCollection::defaultFormat() const
01997 {
01998     return defFormat;
01999 }
02000 
02001 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
02002 
02003 inline QTextFormat *QTextStringChar::format() const
02004 {
02005     return (type == Regular) ? d.format : d.custom->format;
02006 }
02007 
02008 
02009 inline QTextCustomItem *QTextStringChar::customItem() const
02010 {
02011     return isCustom() ? d.custom->custom : 0;
02012 }
02013 
02014 inline int QTextStringChar::height() const
02015 {
02016     return !isCustom() ? format()->height() : ( customItem()->placement() == QTextCustomItem::PlaceInline ? customItem()->height : 0 );
02017 }
02018 
02019 inline int QTextStringChar::ascent() const
02020 {
02021     return !isCustom() ? format()->ascent() : ( customItem()->placement() == QTextCustomItem::PlaceInline ? customItem()->ascent() : 0 );
02022 }
02023 
02024 inline int QTextStringChar::descent() const
02025 {
02026     return !isCustom() ? format()->descent() : 0;
02027 }
02028 
02029 } // namespace Qt3
02030 
02031 #endif

Generated on Sat Nov 5 16:17:05 2005 for OPIE by  doxygen 1.4.2