summaryrefslogtreecommitdiff
path: root/qmake/include/private/qrichtext_p.h
Side-by-side diff
Diffstat (limited to 'qmake/include/private/qrichtext_p.h') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/include/private/qrichtext_p.h59
1 files changed, 41 insertions, 18 deletions
diff --git a/qmake/include/private/qrichtext_p.h b/qmake/include/private/qrichtext_p.h
index 8e29804..9ed87cf 100644
--- a/qmake/include/private/qrichtext_p.h
+++ b/qmake/include/private/qrichtext_p.h
@@ -153,12 +153,14 @@ public:
private:
QTextStringChar &operator=( const QTextStringChar & ) {
//abort();
return *this;
}
+ QTextStringChar( const QTextStringChar & ) {
+ }
friend class QComplexText;
friend class QTextParagraph;
};
#if defined(Q_TEMPLATEDLL)
// MOC_SKIP_BEGIN
@@ -171,14 +173,14 @@ class Q_EXPORT QTextString
public:
QTextString();
QTextString( const QTextString &s );
virtual ~QTextString();
- static QString toString( const QMemArray<QTextStringChar> &data );
- QString toString() const;
+ static QString toString( const QMemArray<QTextStringChar> &data, bool fixspaces = TRUE );
+ QString toString( bool fixspaces = TRUE ) const;
QTextStringChar &at( int i ) const;
#if defined(Q_STRICT_INLINING_RULES)
// This is for the IRIX MIPSpro o32 ABI - it fails, claiming the
// implementation to be a redefinition.
inline int length() const;
@@ -283,14 +285,14 @@ public:
void gotoLineEnd();
void gotoLineStart();
void gotoHome();
void gotoEnd();
void gotoPageUp( int visibleHeight );
void gotoPageDown( int visibleHeight );
- void gotoNextWord();
- void gotoPreviousWord();
+ void gotoNextWord( bool onlySpace = FALSE );
+ void gotoPreviousWord( bool onlySpace = FALSE );
void gotoWordLeft();
void gotoWordRight();
void insert( const QString &s, bool checkNewLine, QMemArray<QTextStringChar> *formatting = 0 );
void splitAndInsertEmptyParagraph( bool ind = TRUE, bool updateIds = TRUE );
bool remove();
@@ -323,13 +325,13 @@ public:
private:
enum Operation { EnterBegin, EnterEnd, Next, Prev, Up, Down };
void push();
void pop();
- void processNesting( Operation op );
+ bool processNesting( Operation op );
void invalidateNested();
void gotoIntoNested( const QPoint &globalPos );
QTextParagraph *para;
int idx, tmpIndex;
int ox, oy;
@@ -700,12 +702,13 @@ class QTextParagraph;
#endif
struct Q_EXPORT QTextDocumentSelection
{
QTextCursor startCursor, endCursor;
bool swapped;
+ Q_DUMMY_COMPARISON_OPERATOR(QTextDocumentSelection)
};
#if defined(Q_TEMPLATEDLL)
// MOC_SKIP_BEGIN
Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QColor>;
Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, bool>;
@@ -836,12 +839,15 @@ public:
void setPaper( QBrush *brush ) { if ( backBrush ) delete backBrush; backBrush = brush; }
QBrush *paper() const { return backBrush; }
void doLayout( QPainter *p, int w );
void draw( QPainter *p, const QRect& rect, const QColorGroup &cg, const QBrush *paper = 0 );
+ void eraseParagraphEmptyArea( QTextParagraph *parag, QPainter *p, const QColorGroup &cg );
+ bool useDoubleBuffer( QTextParagraph *parag, QPainter *p );
+
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 );
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 );
@@ -1064,12 +1070,13 @@ private:
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
struct Q_EXPORT QTextParagraphSelection
{
int start, end;
+ Q_DUMMY_COMPARISON_OPERATOR(QTextParagraphSelection)
};
struct Q_EXPORT QTextLineStart
{
QTextLineStart() : y( 0 ), baseLine( 0 ), h( 0 )
#ifndef QT_NO_COMPLEXTEXT
@@ -1133,29 +1140,21 @@ class Q_EXPORT QTextParagraphData
public:
QTextParagraphData() {}
virtual ~QTextParagraphData();
virtual void join( QTextParagraphData * );
};
-class Q_EXPORT QTextParagraphPseudoDocument
-{
-public:
- QTextParagraphPseudoDocument();
- ~QTextParagraphPseudoDocument();
- QRect docRect;
- QTextFormatter *pFormatter;
- QTextCommandHistory *commandHistory;
- int minw;
- int wused;
-};
+class QTextParagraphPseudoDocument;
+
+class QSyntaxHighlighter;
-//nase
class Q_EXPORT QTextParagraph
{
friend class QTextDocument;
friend class QTextCursor;
+ friend class QSyntaxHighlighter;
public:
QTextParagraph( QTextDocument *d, QTextParagraph *pr = 0, QTextParagraph *nx = 0, bool updateIds = TRUE );
virtual ~QTextParagraph();
QTextString *string() const;
@@ -1173,13 +1172,19 @@ public:
void setListDepth( int depth );
int listDepth() const { return ldepth; }
// void setFormat( QTextFormat *fm );
// QTextFormat *paragFormat() const;
+#if defined(Q_STRICT_INLINING_RULES)
+ // This is for the IRIX MIPSpro o32 ABI - it fails, claiming the
+ // implementation to be a redefinition.
+ inline QTextDocument *document() const;
+#else
QTextDocument *document() const;
+#endif
QTextParagraphPseudoDocument *pseudoDocument() const;
QRect rect() const;
void setHeight( int h ) { r.setHeight( h ); }
void show();
void hide();
@@ -1593,13 +1598,12 @@ public:
virtual QTextFormat *format( const QFont &f, const QColor &c );
virtual void remove( QTextFormat *f );
virtual QTextFormat *createFormat( const QTextFormat &f ) { return new QTextFormat( f ); }
virtual QTextFormat *createFormat( const QFont &f, const QColor &c ) { return new QTextFormat( f, c, this ); }
void updateDefaultFormat( const QFont &font, const QColor &c, QStyleSheet *sheet );
- QDict<QTextFormat> dict() const { return cKey; }
QPaintDevice *paintDevice() const { return paintdevice; }
void setPaintDevice( QPaintDevice * );
private:
void updateKeys();
@@ -1613,12 +1617,25 @@ private:
QString kof, knf;
int cflags;
QPaintDevice *paintdevice;
};
+class Q_EXPORT QTextParagraphPseudoDocument
+{
+public:
+ QTextParagraphPseudoDocument();
+ ~QTextParagraphPseudoDocument();
+ QRect docRect;
+ QTextFormatter *pFormatter;
+ QTextCommandHistory *commandHistory;
+ int minw;
+ int wused;
+ QTextFormatCollection collection;
+};
+
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
inline int QTextString::length() const
{
return data.size();
}
@@ -1825,12 +1842,18 @@ inline void QTextDocument::setFlow( QTextFlow *f )
inline void QTextDocument::takeFlow()
{
flow_ = 0;
}
+inline bool QTextDocument::useDoubleBuffer( QTextParagraph *parag, QPainter *p )
+{
+ return ( !parag->document()->parent() || parag->document()->nextDoubleBuffered ) &&
+ ( !p || !p->device() || p->device()->devType() != QInternal::Printer );
+}
+
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
inline QColor QTextFormat::color() const
{
return col;
}