summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-write/qrichtext_p.h
Side-by-side diff
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.h157
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
@@ -51,4 +51,7 @@
//
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
#ifndef QT_H
#include "qstring.h"
@@ -125,8 +128,8 @@ public:
struct CustomData
{
- QTextFormat *format;
- QTextCustomItem *custom;
- QString anchorName;
- QString anchorHref;
+ QTextFormat *format;
+ QTextCustomItem *custom;
+ QString anchorName;
+ QString anchorHref;
};
@@ -134,6 +137,6 @@ public:
union {
- QTextFormat* format;
- CustomData* custom;
+ QTextFormat* format;
+ CustomData* custom;
} d;
@@ -145,6 +148,6 @@ public:
private:
QTextStringChar &operator=( const QTextStringChar & ) {
- //abort();
- return *this;
+ //abort();
+ return *this;
}
friend class QComplexText;
@@ -209,5 +212,5 @@ inline bool QTextString::isBidi() const
{
if ( bidiDirty )
- checkBidi();
+ checkBidi();
return bidi;
}
@@ -216,5 +219,5 @@ inline bool QTextString::isRightToLeft() const
{
if ( bidiDirty )
- checkBidi();
+ checkBidi();
return rightToLeft;
}
@@ -385,5 +388,5 @@ class Q_EXPORT QTextCustomItem
public:
QTextCustomItem( QTextDocument *p )
- : xpos(0), ypos(-1), width(-1), height(0), parent( p )
+ : xpos(0), ypos(-1), width(-1), height(0), parent( p )
{}
virtual ~QTextCustomItem();
@@ -439,5 +442,5 @@ class Q_EXPORT QTextImage : public QTextCustomItem
public:
QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context,
- QMimeSourceFactory &factory );
+ QMimeSourceFactory &factory );
virtual ~QTextImage();
@@ -464,5 +467,5 @@ class Q_EXPORT QTextHorizontalLine : public QTextCustomItem
public:
QTextHorizontalLine( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context,
- QMimeSourceFactory &factory );
+ QMimeSourceFactory &factory );
virtual ~QTextHorizontalLine();
@@ -533,9 +536,9 @@ class Q_EXPORT QTextTableCell : public QLayoutItem
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();
@@ -607,5 +610,5 @@ public:
void pageBreak( int y, QTextFlow* flow );
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 );
bool noErase() const { return TRUE; }
@@ -685,7 +688,7 @@ class Q_EXPORT QTextDocument : public QObject
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()
};
@@ -792,9 +795,9 @@ public:
void draw( QPainter *p, const QRect& rect, const QColorGroup &cg, const QBrush *paper = 0 );
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 );
void registerCustomItem( QTextCustomItem *i, QTextParagraph *p );
@@ -859,5 +862,5 @@ private:
bool hasPrefix(const QChar* doc, int length, int pos, const QString& s);
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 );
bool eat(const QChar* doc, int length, int& pos, QChar c);
@@ -872,7 +875,7 @@ private:
private:
struct Q_EXPORT Focus {
- QTextParagraph *parag;
- int start, len;
- QString href;
+ QTextParagraph *parag;
+ int start, len;
+ QString href;
};
@@ -932,5 +935,5 @@ class Q_EXPORT QTextDeleteCommand : public QTextCommand
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 );
virtual ~QTextDeleteCommand();
@@ -952,8 +955,8 @@ class Q_EXPORT QTextInsertCommand : public QTextDeleteCommand
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() {}
@@ -1012,16 +1015,16 @@ struct Q_EXPORT QTextLineStart
QTextLineStart() : y( 0 ), baseLine( 0 ), h( 0 )
#ifndef QT_NO_COMPLEXTEXT
- , bidicontext( 0 )
+ , bidicontext( 0 )
#endif
{ }
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
{ }
#ifndef QT_NO_COMPLEXTEXT
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
@@ -1029,6 +1032,6 @@ struct Q_EXPORT QTextLineStart
{
#ifndef QT_NO_COMPLEXTEXT
- if ( bidicontext && bidicontext->deref() )
- delete bidicontext;
+ if ( bidicontext && bidicontext->deref() )
+ delete bidicontext;
#endif
}
@@ -1036,11 +1039,11 @@ struct Q_EXPORT QTextLineStart
#ifndef QT_NO_COMPLEXTEXT
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();
}
QBidiContext *context() const { return bidicontext; }
@@ -1184,5 +1187,5 @@ 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 );
virtual int topMargin() const;
@@ -1247,7 +1250,7 @@ protected:
virtual void drawLabel( QPainter* p, int x, int y, int w, int h, int base, const QColorGroup& cg );
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 );
private:
@@ -1316,8 +1319,8 @@ public:
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
void insertLineStart( QTextParagraph *parag, int index, QTextLineStart *ls );
@@ -1380,5 +1383,5 @@ class Q_EXPORT QTextPreProcessor
public:
enum Ids {
- Standard = 0
+ Standard = 0
};
@@ -1400,16 +1403,16 @@ class Q_EXPORT QTextFormat
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
};
@@ -1730,5 +1733,5 @@ inline QString QTextDocument::originalText() const
{
if ( oTextValid )
- return oText;
+ return oText;
return text();
}
@@ -1737,5 +1740,5 @@ inline void QTextDocument::setFlow( QTextFlow *f )
{
if ( flow_ )
- delete flow_;
+ delete flow_;
flow_ = f;
}
@@ -1787,9 +1790,9 @@ inline void QTextFormat::removeRef()
ref--;
if ( !collection )
- return;
+ return;
if ( this == collection->defFormat )
- return;
+ return;
if ( ref == 0 )
- collection->remove( this );
+ collection->remove( this );
}
@@ -1844,7 +1847,7 @@ 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 );
}
@@ -1867,5 +1870,5 @@ inline void QTextParagraph::setEndState( int s )
{
if ( s == state )
- return;
+ return;
state = s;
}
@@ -1884,5 +1887,5 @@ inline int QTextParagraph::paragId() const
{
if ( id == -1 )
- qWarning( "invalid parag id!!!!!!!! (%p)", (void*)this );
+ owarn << "invalid parag id!!!!!!!! (" << (void*)this << ")" << oendl;
return id;
}
@@ -1911,5 +1914,5 @@ inline QTextDocument *QTextParagraph::document() const
{
if ( hasdoc )
- return (QTextDocument*) docOrPseudo;
+ return (QTextDocument*) docOrPseudo;
return 0;
}
@@ -1918,5 +1921,5 @@ inline QTextParagraphPseudoDocument *QTextParagraph::pseudoDocument() const
{
if ( hasdoc )
- return 0;
+ return 0;
return (QTextParagraphPseudoDocument*) docOrPseudo;
}