Diffstat (limited to 'noncore/apps/opie-write/qtextedit.h') (more/less context) (show 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 @@ -52,27 +52,29 @@ class QMouseEvent; class QTimer; class QFont; class QColor; struct QUndoRedoInfoPrivate; class QPopupMenu; namespace Qt3 { class QTextString; class QTextDocument; class QTextCursor; class QTextCommand; -class QTextParag; +class QTextParagraph; class QTextFormat; +class QTextEdit; class QTextBrowser; +class QTextString; class QTextEditPrivate; class Q_EXPORT QTextEdit : public QScrollView { friend class QTextBrowser; Q_OBJECT Q_ENUMS( WordWrap WrapPolicy ) Q_PROPERTY( TextFormat textFormat READ textFormat WRITE setTextFormat ) Q_PROPERTY( QString text READ text WRITE setText ) Q_PROPERTY( QBrush paper READ paper WRITE setPaper ) Q_PROPERTY( bool linkUnderline READ linkUnderline WRITE setLinkUnderline ) @@ -187,30 +189,35 @@ public: void getCursorPosition( int *parag, int *index ) const; bool isModified() const; bool italic() const; bool bold() const; bool underline() const; QString family() const; int pointSize() const; QColor color() const; QFont font() const; int alignment() const; int undoDepth() const; + + // do not use, will go away virtual bool getFormat( int para, int index, QFont *font, QColor *color, VerticalAlignment *verticalAlignment ); + // do not use, will go away virtual bool getParagraphFormat( int para, QFont *font, QColor *color, VerticalAlignment *verticalAlignment, int *alignment, QStyleSheetItem::DisplayMode *displayMode, QStyleSheetItem::ListStyle *listStyle, int *listDepth ); + + bool isOverwriteMode() const { return overWrite; } QColor paragraphBackgroundColor( int para ) const; bool isUndoRedoEnabled() const; bool eventFilter( QObject *o, QEvent *e ); public slots: void setEnabled( bool ); virtual void setMimeSourceFactory( QMimeSourceFactory* factory ); virtual void setStyleSheet( QStyleSheet* styleSheet ); virtual void scrollToAnchor( const QString& name ); virtual void setPaper( const QBrush& pap ); @@ -248,25 +255,28 @@ public slots: virtual void clear(); virtual void del(); virtual void indent(); virtual void setItalic( bool b ); virtual void setBold( bool b ); virtual void setUnderline( bool b ); virtual void setFamily( const QString &f ); virtual void setPointSize( int s ); virtual void setColor( const QColor &c ); virtual void setFont( const QFont &f ); virtual void setVerticalAlignment( VerticalAlignment a ); virtual void setAlignment( int a ); + + // do not use, will go away virtual void setParagType( QStyleSheetItem::DisplayMode dm, QStyleSheetItem::ListStyle listStyle ); + virtual void setCursorPosition( int parag, int index ); virtual void setSelection( int parag_from, int index_from, int parag_to, int index_to, int selNum = 0 ); virtual void setSelectionAttributes( int selNum, const QColor &back, bool invertText ); virtual void setModified( bool m ); virtual void resetFormat(); virtual void setUndoDepth( int d ); virtual void setFormat( QTextFormat *f, int flags ); virtual void ensureCursorVisible(); virtual void placeCursor( const QPoint &pos, QTextCursor *c = 0 ); virtual void moveCursor( CursorAction action, bool select ); virtual void doKeyboardAction( KeyboardAction action ); virtual void removeSelectedText( int selNum = 0 ); @@ -337,81 +347,77 @@ protected slots: private slots: void formatMore(); void doResize(); void autoScrollTimerDone(); void blinkCursor(); void setModified(); void startDrag(); void documentWidthChanged( int w ); private: struct Q_EXPORT UndoRedoInfo { - enum Type { Invalid, Insert, Delete, Backspace, Return, RemoveSelected, Format, Alignment, ParagType }; + enum Type { Invalid, Insert, Delete, Backspace, Return, RemoveSelected, Format, Style }; UndoRedoInfo( QTextDocument *dc ); ~UndoRedoInfo(); void clear(); bool valid() const; QUndoRedoInfoPrivate *d; int id; int index; int eid; int eindex; QTextFormat *format; int flags; Type type; QTextDocument *doc; - QMemArray<int> oldAligns; - int newAlign; - bool list; - QStyleSheetItem::ListStyle listStyle; - QValueList< QPtrVector<QStyleSheetItem> > oldStyles; - QValueList<QStyleSheetItem::ListStyle> oldListStyles; + QByteArray styleInformation; }; private: void updateCursor( const QPoint & pos ); void handleMouseMove( const QPoint& pos ); void drawContents( QPainter * ); virtual bool linksEnabled() const { return FALSE; } void init(); void checkUndoRedoInfo( UndoRedoInfo::Type t ); void updateCurrentFormat(); bool handleReadOnlyKeyEvent( QKeyEvent *e ); - void makeParagVisible( QTextParag *p ); + void makeParagVisible( QTextParagraph *p ); #ifndef QT_NO_MIME QCString pickSpecial(QMimeSource* ms, bool always_ask, const QPoint&); #endif #ifndef QT_NO_MIMECLIPBOARD void pasteSpecial(const QPoint&); #endif void setFontInternal( const QFont &f ); virtual void emitHighlighted( const QString & ) {} virtual void emitLinkClicked( const QString & ) {} - void readFormats( QTextCursor &c1, QTextCursor &c2, int oldLen, QTextString &text, bool fillStyles = FALSE ); + void readFormats( QTextCursor &c1, QTextCursor &c2, QTextString &text, bool fillStyles = FALSE ); void clearUndoRedo(); void paintDocument( bool drawAll, QPainter *p, int cx = -1, int cy = -1, int cw = -1, int ch = -1 ); void moveCursor( CursorAction action ); - void ensureFormatted( QTextParag *p ); + void ensureFormatted( QTextParagraph *p ); void placeCursor( const QPoint &pos, QTextCursor *c, bool link ); + void updateMicroFocusHint(); private: QTextDocument *doc; QTextCursor *cursor; QTimer *formatTimer, *scrollTimer, *changeIntervalTimer, *blinkTimer, *dragStartTimer; - QTextParag *lastFormatted; + QTextParagraph *lastFormatted; int interval; UndoRedoInfo undoRedoInfo; QTextFormat *currentFormat; int currentAlignment; QPoint oldMousePos, mousePos; QPoint dragStartPos; QString onLink; WordWrap wrapMode; WrapPolicy wPolicy; int wrapWidth; QString pressedLink; QTextEditPrivate *d; |