Diffstat (limited to 'noncore/apps/opie-write/qtextedit.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-write/qtextedit.h | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/noncore/apps/opie-write/qtextedit.h b/noncore/apps/opie-write/qtextedit.h index b4e5701..64e8f45 100644 --- a/noncore/apps/opie-write/qtextedit.h +++ b/noncore/apps/opie-write/qtextedit.h | |||
@@ -58,15 +58,17 @@ class QPopupMenu; | |||
58 | namespace Qt3 { | 58 | namespace Qt3 { |
59 | 59 | ||
60 | class QTextString; | 60 | class QTextString; |
61 | class QTextDocument; | 61 | class QTextDocument; |
62 | class QTextCursor; | 62 | class QTextCursor; |
63 | class QTextCommand; | 63 | class QTextCommand; |
64 | class QTextParag; | 64 | class QTextParagraph; |
65 | class QTextFormat; | 65 | class QTextFormat; |
66 | class QTextEdit; | ||
66 | class QTextBrowser; | 67 | class QTextBrowser; |
68 | class QTextString; | ||
67 | class QTextEditPrivate; | 69 | class QTextEditPrivate; |
68 | 70 | ||
69 | class Q_EXPORT QTextEdit : public QScrollView | 71 | class Q_EXPORT QTextEdit : public QScrollView |
70 | { | 72 | { |
71 | friend class QTextBrowser; | 73 | friend class QTextBrowser; |
72 | 74 | ||
@@ -193,18 +195,23 @@ public: | |||
193 | QString family() const; | 195 | QString family() const; |
194 | int pointSize() const; | 196 | int pointSize() const; |
195 | QColor color() const; | 197 | QColor color() const; |
196 | QFont font() const; | 198 | QFont font() const; |
197 | int alignment() const; | 199 | int alignment() const; |
198 | int undoDepth() const; | 200 | int undoDepth() const; |
201 | |||
202 | // do not use, will go away | ||
199 | virtual bool getFormat( int para, int index, QFont *font, QColor *color, VerticalAlignment *verticalAlignment ); | 203 | virtual bool getFormat( int para, int index, QFont *font, QColor *color, VerticalAlignment *verticalAlignment ); |
204 | // do not use, will go away | ||
200 | virtual bool getParagraphFormat( int para, QFont *font, QColor *color, | 205 | virtual bool getParagraphFormat( int para, QFont *font, QColor *color, |
201 | VerticalAlignment *verticalAlignment, int *alignment, | 206 | VerticalAlignment *verticalAlignment, int *alignment, |
202 | QStyleSheetItem::DisplayMode *displayMode, | 207 | QStyleSheetItem::DisplayMode *displayMode, |
203 | QStyleSheetItem::ListStyle *listStyle, | 208 | QStyleSheetItem::ListStyle *listStyle, |
204 | int *listDepth ); | 209 | int *listDepth ); |
210 | |||
211 | |||
205 | bool isOverwriteMode() const { return overWrite; } | 212 | bool isOverwriteMode() const { return overWrite; } |
206 | QColor paragraphBackgroundColor( int para ) const; | 213 | QColor paragraphBackgroundColor( int para ) const; |
207 | 214 | ||
208 | bool isUndoRedoEnabled() const; | 215 | bool isUndoRedoEnabled() const; |
209 | bool eventFilter( QObject *o, QEvent *e ); | 216 | bool eventFilter( QObject *o, QEvent *e ); |
210 | 217 | ||
@@ -254,13 +261,16 @@ public slots: | |||
254 | virtual void setFamily( const QString &f ); | 261 | virtual void setFamily( const QString &f ); |
255 | virtual void setPointSize( int s ); | 262 | virtual void setPointSize( int s ); |
256 | virtual void setColor( const QColor &c ); | 263 | virtual void setColor( const QColor &c ); |
257 | virtual void setFont( const QFont &f ); | 264 | virtual void setFont( const QFont &f ); |
258 | virtual void setVerticalAlignment( VerticalAlignment a ); | 265 | virtual void setVerticalAlignment( VerticalAlignment a ); |
259 | virtual void setAlignment( int a ); | 266 | virtual void setAlignment( int a ); |
267 | |||
268 | // do not use, will go away | ||
260 | virtual void setParagType( QStyleSheetItem::DisplayMode dm, QStyleSheetItem::ListStyle listStyle ); | 269 | virtual void setParagType( QStyleSheetItem::DisplayMode dm, QStyleSheetItem::ListStyle listStyle ); |
270 | |||
261 | virtual void setCursorPosition( int parag, int index ); | 271 | virtual void setCursorPosition( int parag, int index ); |
262 | virtual void setSelection( int parag_from, int index_from, int parag_to, int index_to, int selNum = 0 ); | 272 | virtual void setSelection( int parag_from, int index_from, int parag_to, int index_to, int selNum = 0 ); |
263 | virtual void setSelectionAttributes( int selNum, const QColor &back, bool invertText ); | 273 | virtual void setSelectionAttributes( int selNum, const QColor &back, bool invertText ); |
264 | virtual void setModified( bool m ); | 274 | virtual void setModified( bool m ); |
265 | virtual void resetFormat(); | 275 | virtual void resetFormat(); |
266 | virtual void setUndoDepth( int d ); | 276 | virtual void setUndoDepth( int d ); |
@@ -343,13 +353,13 @@ private slots: | |||
343 | void setModified(); | 353 | void setModified(); |
344 | void startDrag(); | 354 | void startDrag(); |
345 | void documentWidthChanged( int w ); | 355 | void documentWidthChanged( int w ); |
346 | 356 | ||
347 | private: | 357 | private: |
348 | struct Q_EXPORT UndoRedoInfo { | 358 | struct Q_EXPORT UndoRedoInfo { |
349 | enum Type { Invalid, Insert, Delete, Backspace, Return, RemoveSelected, Format, Alignment, ParagType }; | 359 | enum Type { Invalid, Insert, Delete, Backspace, Return, RemoveSelected, Format, Style }; |
350 | 360 | ||
351 | UndoRedoInfo( QTextDocument *dc ); | 361 | UndoRedoInfo( QTextDocument *dc ); |
352 | ~UndoRedoInfo(); | 362 | ~UndoRedoInfo(); |
353 | void clear(); | 363 | void clear(); |
354 | bool valid() const; | 364 | bool valid() const; |
355 | 365 | ||
@@ -359,53 +369,49 @@ private: | |||
359 | int eid; | 369 | int eid; |
360 | int eindex; | 370 | int eindex; |
361 | QTextFormat *format; | 371 | QTextFormat *format; |
362 | int flags; | 372 | int flags; |
363 | Type type; | 373 | Type type; |
364 | QTextDocument *doc; | 374 | QTextDocument *doc; |
365 | QMemArray<int> oldAligns; | 375 | QByteArray styleInformation; |
366 | int newAlign; | ||
367 | bool list; | ||
368 | QStyleSheetItem::ListStyle listStyle; | ||
369 | QValueList< QPtrVector<QStyleSheetItem> > oldStyles; | ||
370 | QValueList<QStyleSheetItem::ListStyle> oldListStyles; | ||
371 | }; | 376 | }; |
372 | 377 | ||
373 | private: | 378 | private: |
374 | void updateCursor( const QPoint & pos ); | 379 | void updateCursor( const QPoint & pos ); |
375 | void handleMouseMove( const QPoint& pos ); | 380 | void handleMouseMove( const QPoint& pos ); |
376 | void drawContents( QPainter * ); | 381 | void drawContents( QPainter * ); |
377 | virtual bool linksEnabled() const { return FALSE; } | 382 | virtual bool linksEnabled() const { return FALSE; } |
378 | void init(); | 383 | void init(); |
379 | void checkUndoRedoInfo( UndoRedoInfo::Type t ); | 384 | void checkUndoRedoInfo( UndoRedoInfo::Type t ); |
380 | void updateCurrentFormat(); | 385 | void updateCurrentFormat(); |
381 | bool handleReadOnlyKeyEvent( QKeyEvent *e ); | 386 | bool handleReadOnlyKeyEvent( QKeyEvent *e ); |
382 | void makeParagVisible( QTextParag *p ); | 387 | void makeParagVisible( QTextParagraph *p ); |
383 | #ifndef QT_NO_MIME | 388 | #ifndef QT_NO_MIME |
384 | QCString pickSpecial(QMimeSource* ms, bool always_ask, const QPoint&); | 389 | QCString pickSpecial(QMimeSource* ms, bool always_ask, const QPoint&); |
385 | #endif | 390 | #endif |
386 | #ifndef QT_NO_MIMECLIPBOARD | 391 | #ifndef QT_NO_MIMECLIPBOARD |
387 | void pasteSpecial(const QPoint&); | 392 | void pasteSpecial(const QPoint&); |
388 | #endif | 393 | #endif |
389 | void setFontInternal( const QFont &f ); | 394 | void setFontInternal( const QFont &f ); |
390 | 395 | ||
391 | virtual void emitHighlighted( const QString & ) {} | 396 | virtual void emitHighlighted( const QString & ) {} |
392 | virtual void emitLinkClicked( const QString & ) {} | 397 | virtual void emitLinkClicked( const QString & ) {} |
393 | 398 | ||
394 | void readFormats( QTextCursor &c1, QTextCursor &c2, int oldLen, QTextString &text, bool fillStyles = FALSE ); | 399 | void readFormats( QTextCursor &c1, QTextCursor &c2, QTextString &text, bool fillStyles = FALSE ); |
395 | void clearUndoRedo(); | 400 | void clearUndoRedo(); |
396 | void paintDocument( bool drawAll, QPainter *p, int cx = -1, int cy = -1, int cw = -1, int ch = -1 ); | 401 | void paintDocument( bool drawAll, QPainter *p, int cx = -1, int cy = -1, int cw = -1, int ch = -1 ); |
397 | void moveCursor( CursorAction action ); | 402 | void moveCursor( CursorAction action ); |
398 | void ensureFormatted( QTextParag *p ); | 403 | void ensureFormatted( QTextParagraph *p ); |
399 | void placeCursor( const QPoint &pos, QTextCursor *c, bool link ); | 404 | void placeCursor( const QPoint &pos, QTextCursor *c, bool link ); |
405 | void updateMicroFocusHint(); | ||
400 | 406 | ||
401 | private: | 407 | private: |
402 | QTextDocument *doc; | 408 | QTextDocument *doc; |
403 | QTextCursor *cursor; | 409 | QTextCursor *cursor; |
404 | QTimer *formatTimer, *scrollTimer, *changeIntervalTimer, *blinkTimer, *dragStartTimer; | 410 | QTimer *formatTimer, *scrollTimer, *changeIntervalTimer, *blinkTimer, *dragStartTimer; |
405 | QTextParag *lastFormatted; | 411 | QTextParagraph *lastFormatted; |
406 | int interval; | 412 | int interval; |
407 | UndoRedoInfo undoRedoInfo; | 413 | UndoRedoInfo undoRedoInfo; |
408 | QTextFormat *currentFormat; | 414 | QTextFormat *currentFormat; |
409 | int currentAlignment; | 415 | int currentAlignment; |
410 | QPoint oldMousePos, mousePos; | 416 | QPoint oldMousePos, mousePos; |
411 | QPoint dragStartPos; | 417 | QPoint dragStartPos; |