-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 @@ -52,2 +52,5 @@ +#include <opie2/odebug.h> +using namespace Opie::Core; + #ifndef QT_H @@ -126,6 +129,6 @@ public: { - QTextFormat *format; - QTextCustomItem *custom; - QString anchorName; - QString anchorHref; + QTextFormat *format; + QTextCustomItem *custom; + QString anchorName; + QString anchorHref; }; @@ -135,4 +138,4 @@ public: union { - QTextFormat* format; - CustomData* custom; + QTextFormat* format; + CustomData* custom; } d; @@ -146,4 +149,4 @@ private: QTextStringChar &operator=( const QTextStringChar & ) { - //abort(); - return *this; + //abort(); + return *this; } @@ -210,3 +213,3 @@ inline bool QTextString::isBidi() const if ( bidiDirty ) - checkBidi(); + checkBidi(); return bidi; @@ -217,3 +220,3 @@ inline bool QTextString::isRightToLeft() const if ( bidiDirty ) - checkBidi(); + checkBidi(); return rightToLeft; @@ -386,3 +389,3 @@ public: QTextCustomItem( QTextDocument *p ) - : xpos(0), ypos(-1), width(-1), height(0), parent( p ) + : xpos(0), ypos(-1), width(-1), height(0), parent( p ) {} @@ -440,3 +443,3 @@ public: QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, - QMimeSourceFactory &factory ); + QMimeSourceFactory &factory ); virtual ~QTextImage(); @@ -465,3 +468,3 @@ public: QTextHorizontalLine( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, - QMimeSourceFactory &factory ); + QMimeSourceFactory &factory ); virtual ~QTextHorizontalLine(); @@ -534,7 +537,7 @@ public: QTextTableCell( QTextTable* table, - int row, int column, - const QMap<QString, QString> &attr, - const QStyleSheetItem* style, - const QTextFormat& fmt, const QString& context, - QMimeSourceFactory &factory, QStyleSheet *sheet, const QString& doc ); + int row, int column, + const QMap<QString, QString> &attr, + const QStyleSheetItem* style, + const QTextFormat& fmt, const QString& context, + QMimeSourceFactory &factory, QStyleSheet *sheet, const QString& doc ); virtual ~QTextTableCell(); @@ -608,3 +611,3 @@ public: void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, - const QColorGroup& cg, bool selected ); + const QColorGroup& cg, bool selected ); @@ -686,5 +689,5 @@ public: enum SelectionIds { - Standard = 0, - Temp = 32000 // This selection must not be drawn, it's used e.g. by undo/redo to - // remove multiple lines with removeSelectedText() + Standard = 0, + Temp = 32000 // This selection must not be drawn, it's used e.g. by undo/redo to + // remove multiple lines with removeSelectedText() }; @@ -793,7 +796,7 @@ public: void drawParagraph( QPainter *p, QTextParagraph *parag, int cx, int cy, int cw, int ch, - QPixmap *&doubleBuffer, const QColorGroup &cg, - bool drawCursor, QTextCursor *cursor, bool resetChanged = TRUE ); + QPixmap *&doubleBuffer, const QColorGroup &cg, + bool drawCursor, QTextCursor *cursor, bool resetChanged = TRUE ); QTextParagraph *draw( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg, - bool onlyChanged = FALSE, bool drawCursor = FALSE, QTextCursor *cursor = 0, - bool resetChanged = TRUE ); + bool onlyChanged = FALSE, bool drawCursor = FALSE, QTextCursor *cursor = 0, + bool resetChanged = TRUE ); @@ -860,3 +863,3 @@ private: QTextCustomItem* parseTable( const QMap<QString, QString> &attr, const QTextFormat &fmt, - const QChar* doc, int length, int& pos, QTextParagraph *curpar ); + const QChar* doc, int length, int& pos, QTextParagraph *curpar ); bool eatSpace(const QChar* doc, int length, int& pos, bool includeNbsp = FALSE ); @@ -873,5 +876,5 @@ private: struct Q_EXPORT Focus { - QTextParagraph *parag; - int start, len; - QString href; + QTextParagraph *parag; + int start, len; + QString href; }; @@ -933,3 +936,3 @@ public: QTextDeleteCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str, - const QByteArray& oldStyle ); + const QByteArray& oldStyle ); QTextDeleteCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str ); @@ -953,6 +956,6 @@ public: QTextInsertCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str, - const QByteArray& oldStyleInfo ) - : QTextDeleteCommand( d, i, idx, str, oldStyleInfo ) {} + const QByteArray& oldStyleInfo ) + : QTextDeleteCommand( d, i, idx, str, oldStyleInfo ) {} QTextInsertCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str ) - : QTextDeleteCommand( p, idx, str ) {} + : QTextDeleteCommand( p, idx, str ) {} virtual ~QTextInsertCommand() {} @@ -1013,3 +1016,3 @@ struct Q_EXPORT QTextLineStart #ifndef QT_NO_COMPLEXTEXT - , bidicontext( 0 ) + , bidicontext( 0 ) #endif @@ -1017,5 +1020,5 @@ struct Q_EXPORT QTextLineStart QTextLineStart( ushort y_, ushort bl, ushort h_ ) : y( y_ ), baseLine( bl ), h( h_ ), - w( 0 ) + w( 0 ) #ifndef QT_NO_COMPLEXTEXT - , bidicontext( 0 ) + , bidicontext( 0 ) #endif @@ -1024,3 +1027,3 @@ struct Q_EXPORT QTextLineStart QTextLineStart( QBidiContext *c, QBidiStatus s ) : y(0), baseLine(0), h(0), - status( s ), bidicontext( c ) { if ( bidicontext ) bidicontext->ref(); } + status( s ), bidicontext( c ) { if ( bidicontext ) bidicontext->ref(); } #endif @@ -1030,4 +1033,4 @@ struct Q_EXPORT QTextLineStart #ifndef QT_NO_COMPLEXTEXT - if ( bidicontext && bidicontext->deref() ) - delete bidicontext; + if ( bidicontext && bidicontext->deref() ) + delete bidicontext; #endif @@ -1037,9 +1040,9 @@ struct Q_EXPORT QTextLineStart void setContext( QBidiContext *c ) { - if ( c == bidicontext ) - return; - if ( bidicontext && bidicontext->deref() ) - delete bidicontext; - bidicontext = c; - if ( bidicontext ) - bidicontext->ref(); + if ( c == bidicontext ) + return; + if ( bidicontext && bidicontext->deref() ) + delete bidicontext; + bidicontext = c; + if ( bidicontext ) + bidicontext->ref(); } @@ -1185,3 +1188,3 @@ public: virtual void paint( QPainter &painter, const QColorGroup &cg, QTextCursor *cursor = 0, bool drawSelections = FALSE, - int clipx = -1, int clipy = -1, int clipw = -1, int cliph = -1 ); + int clipx = -1, int clipy = -1, int clipw = -1, int cliph = -1 ); @@ -1248,5 +1251,5 @@ protected: virtual void drawString( QPainter &painter, const QString &str, int start, int len, int xstart, - int y, int baseLine, int w, int h, int selection, - QTextStringChar *formatChar, const QColorGroup& cg, - bool rightToLeft ); + int y, int baseLine, int w, int h, int selection, + QTextStringChar *formatChar, const QColorGroup& cg, + bool rightToLeft ); @@ -1317,6 +1320,6 @@ protected: virtual QTextLineStart *formatLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start, - QTextStringChar *last, int align = Qt3::AlignAuto, int space = 0 ); + QTextStringChar *last, int align = Qt3::AlignAuto, int space = 0 ); #ifndef QT_NO_COMPLEXTEXT virtual QTextLineStart *bidiReorderLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start, - QTextStringChar *last, int align, int space ); + QTextStringChar *last, int align, int space ); #endif @@ -1381,3 +1384,3 @@ public: enum Ids { - Standard = 0 + Standard = 0 }; @@ -1401,14 +1404,14 @@ public: enum Flags { - NoFlags, - Bold = 1, - Italic = 2, - Underline = 4, - Family = 8, - Size = 16, - Color = 32, - Misspelled = 64, - VAlign = 128, - StrikeOut= 256, - Font = Bold | Italic | Underline | Family | Size | StrikeOut, - Format = Font | Color | Misspelled | VAlign + NoFlags, + Bold = 1, + Italic = 2, + Underline = 4, + Family = 8, + Size = 16, + Color = 32, + Misspelled = 64, + VAlign = 128, + StrikeOut= 256, + Font = Bold | Italic | Underline | Family | Size | StrikeOut, + Format = Font | Color | Misspelled | VAlign }; @@ -1731,3 +1734,3 @@ inline QString QTextDocument::originalText() const if ( oTextValid ) - return oText; + return oText; return text(); @@ -1738,3 +1741,3 @@ inline void QTextDocument::setFlow( QTextFlow *f ) if ( flow_ ) - delete flow_; + delete flow_; flow_ = f; @@ -1788,7 +1791,7 @@ inline void QTextFormat::removeRef() if ( !collection ) - return; + return; if ( this == collection->defFormat ) - return; + return; if ( ref == 0 ) - collection->remove( this ); + collection->remove( this ); } @@ -1845,5 +1848,5 @@ inline void QTextParagraph::append( const QString &s, bool reallyAtEnd ) if ( reallyAtEnd ) - insert( str->length(), s ); + insert( str->length(), s ); else - insert( QMAX( str->length() - 1, 0 ), s ); + insert( QMAX( str->length() - 1, 0 ), s ); } @@ -1868,3 +1871,3 @@ inline void QTextParagraph::setEndState( int s ) if ( s == state ) - return; + return; state = s; @@ -1885,3 +1888,3 @@ inline int QTextParagraph::paragId() const if ( id == -1 ) - qWarning( "invalid parag id!!!!!!!! (%p)", (void*)this ); + owarn << "invalid parag id!!!!!!!! (" << (void*)this << ")" << oendl; return id; @@ -1912,3 +1915,3 @@ inline QTextDocument *QTextParagraph::document() const if ( hasdoc ) - return (QTextDocument*) docOrPseudo; + return (QTextDocument*) docOrPseudo; return 0; @@ -1919,3 +1922,3 @@ inline QTextParagraphPseudoDocument *QTextParagraph::pseudoDocument() const if ( hasdoc ) - return 0; + return 0; return (QTextParagraphPseudoDocument*) docOrPseudo; |