diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kword/KWCanvas.h | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kword/KWCanvas.h')
-rw-r--r-- | kword/KWCanvas.h | 123 |
1 files changed, 62 insertions, 61 deletions
diff --git a/kword/KWCanvas.h b/kword/KWCanvas.h index ffd1e85e..223161f6 100644 --- a/kword/KWCanvas.h +++ b/kword/KWCanvas.h @@ -24,8 +24,8 @@ #include <kprinter.h> #include <KoRect.h> -#include <qscrollview.h> -#include <qstylesheet.h> +#include <tqscrollview.h> +#include <tqstylesheet.h> #include <KoRichText.h> #include <KoQueryTrader.h> #include <KoPicture.h> @@ -47,7 +47,7 @@ class KWFrameViewManager; class KWGUI; class KWTableTemplate; class KoTextParag; -class QTimer; +class TQTimer; class InteractionPolicy; class KWFrameView; @@ -57,12 +57,13 @@ class KWFrameView; * the screen as well as the interaction with the user via mouse * and keyboard. There is one per view. */ -class KWCanvas : public QScrollView +class KWCanvas : public TQScrollView { Q_OBJECT + TQ_OBJECT public: - KWCanvas(const QString& viewMode, QWidget *parent, KWDocument *d, KWGUI *lGui); + KWCanvas(const TQString& viewMode, TQWidget *tqparent, KWDocument *d, KWGUI *lGui); virtual ~KWCanvas(); KWDocument * kWordDocument() const { return m_doc; } @@ -70,25 +71,25 @@ public: KWFrameViewManager* frameViewManager() { return m_frameViewManager; } KWFrameSetEdit *currentFrameSetEdit() const { return m_currentFrameSetEdit; } - void switchViewMode( const QString& newViewMode ); + void switchViewMode( const TQString& newViewMode ); KWViewMode *viewMode() const { return m_viewMode; } - void repaintAll( bool erase = false ); + void tqrepaintAll( bool erase = false ); /** - * Only repaint the frameset @p fs. + * Only tqrepaint the frameset @p fs. * @p resetChanged should only be true for the last view * (see KWFrameSet::drawContents) */ - void repaintChanged( KWFrameSet * fs, bool resetChanged ); + void tqrepaintChanged( KWFrameSet * fs, bool resetChanged ); - /** We need to repaint if the window is resized. */ - void viewportResizeEvent( QResizeEvent * ); + /** We need to tqrepaint if the window is resized. */ + void viewportResizeEvent( TQResizeEvent * ); - void print( QPainter *painter, KPrinter *printer ); - bool eventFilter( QObject *o, QEvent *e ); + void print( TQPainter *painter, KPrinter *printer ); + bool eventFilter( TQObject *o, TQEvent *e ); bool focusNextPrevChild( bool next); - void setFrameBackgroundColor( const QBrush &backColor ); + void setFrameBackgroundColor( const TQBrush &backColor ); void editFrameProperties(); void editFrameProperties( KWFrameSet * frameset ); @@ -96,10 +97,10 @@ public: void pasteFrames(); // Mouse press - void mpCreate( const QPoint& normalPoint, bool noGrid ); - void mpCreatePixmap( const QPoint& normalPoint, bool noGrid ); + void mpCreate( const TQPoint& normalPoint, bool noGrid ); + void mpCreatePixmap( const TQPoint& normalPoint, bool noGrid ); // Mouse move - void mmCreate( const QPoint& normalPoint, bool noGrid ); + void mmCreate( const TQPoint& normalPoint, bool noGrid ); // Mouse release void mrEditFrame(); void mrCreateText(); @@ -120,11 +121,11 @@ public: MouseMode mouseMode()const { return m_mouseMode; } // makes the user draw the rect for inserting the picture - void insertPicture( const KoPicture& newPicture, QSize pixmapSize, bool _keepRatio ); + void insertPicture( const KoPicture& newPicture, TQSize pixmapSize, bool _keepRatio ); void insertPart( const KoDocumentEntry &entry ); - void pasteImage( QMimeSource *e, const KoPoint &docPoint ); + void pasteImage( TQMimeSource *e, const KoPoint &docPoint ); // insert a (non-inline) picture at the given position; used by dnd and dcop - void insertPictureDirect( const KoPicture& picture, const KoPoint& pos, const QSize& sz = QSize() ); + void insertPictureDirect( const KoPicture& picture, const KoPoint& pos, const TQSize& sz = TQSize() ); void updateCurrentFormat(); @@ -142,8 +143,8 @@ public: void setTableFormat(int _nb){ m_table.format=_nb;} - QString tableTemplateName()const { return m_table.tableTemplateName;} - void setTableTemplateName(const QString &_name) { m_table.tableTemplateName=_name;} + TQString tableTemplateName()const { return m_table.tableTemplateName;} + void setTableTemplateName(const TQString &_name) { m_table.tableTemplateName=_name;} void setPictureInline( bool _inline) { m_picture.pictureInline = _inline;} bool pictureInline() const { return m_picture.pictureInline; } @@ -220,35 +221,35 @@ public: bool insertInlinePicture(); protected: - void drawGrid( QPainter &p, const QRect& rect ); + void drawGrid( TQPainter &p, const TQRect& rect ); /** - * Reimplemented from QScrollView, to draw the contents of the canvas + * Reimplemented from TQScrollView, to draw the contents of the canvas */ - virtual void drawContents( QPainter *p, int cx, int cy, int cw, int ch ); + virtual void drawContents( TQPainter *p, int cx, int cy, int cw, int ch ); /** * The main drawing method. * @param painter guess - * @param crect the area to be repainted, in contents coordinates + * @param crect the area to be tqrepainted, in contents coordinates * @param viewMode the view mode to be used (usually m_viewMode, except when printing) */ - void drawDocument( QPainter *painter, const QRect &crect, KWViewMode* viewMode ); + void drawDocument( TQPainter *painter, const TQRect &crect, KWViewMode* viewMode ); /** * Draw page borders, but also clear up the space between the frames and the page borders, * draw the page shadow, and the gray area. */ - void drawPageBorders( QPainter * painter, const QRect & crect, const QRegion & emptySpaceRegion ); - - virtual void keyPressEvent( QKeyEvent *e ); - virtual void contentsMousePressEvent( QMouseEvent *e ); - virtual void contentsMouseMoveEvent( QMouseEvent *e ); - virtual void contentsMouseReleaseEvent( QMouseEvent *e ); - virtual void contentsMouseDoubleClickEvent( QMouseEvent *e ); - virtual void contentsDragEnterEvent( QDragEnterEvent *e ); - virtual void contentsDragMoveEvent( QDragMoveEvent *e ); - virtual void contentsDragLeaveEvent( QDragLeaveEvent *e ); - virtual void contentsDropEvent( QDropEvent *e ); - virtual void resizeEvent( QResizeEvent *e ); + void drawPageBorders( TQPainter * painter, const TQRect & crect, const TQRegion & emptySpaceRegion ); + + virtual void keyPressEvent( TQKeyEvent *e ); + virtual void contentsMousePressEvent( TQMouseEvent *e ); + virtual void contentsMouseMoveEvent( TQMouseEvent *e ); + virtual void contentsMouseReleaseEvent( TQMouseEvent *e ); + virtual void contentsMouseDoubleClickEvent( TQMouseEvent *e ); + virtual void contentsDragEnterEvent( TQDragEnterEvent *e ); + virtual void contentsDragMoveEvent( TQDragMoveEvent *e ); + virtual void contentsDragLeaveEvent( TQDragLeaveEvent *e ); + virtual void contentsDropEvent( TQDropEvent *e ); + virtual void resizeEvent( TQResizeEvent *e ); KWTableFrameSet * createTable(); // uses m_insRect and m_table to create the table @@ -288,10 +289,10 @@ private: * Draw the contents of one frameset * @param resetChanged whether the changed flag should be reset to false while redrawing */ - void drawFrameSet( KWFrameSet * frameset, QPainter * painter, - const QRect & crect, bool onlyChanged, bool resetChanged, KWViewMode* viewMode ); + void drawFrameSet( KWFrameSet * frameset, TQPainter * painter, + const TQRect & crect, bool onlyChanged, bool resetChanged, KWViewMode* viewMode ); - void drawMovingRect( QPainter & p ); + void drawMovingRect( TQPainter & p ); void deleteMovingRect(); /** * make the parag rectangle have the aspect ratio by changing either the height @@ -309,7 +310,7 @@ private: KWDocument *m_doc; KWFrameSetEdit *m_currentFrameSetEdit; KWGUI *m_gui; - QTimer *m_scrollTimer; + TQTimer *m_scrollTimer; bool m_mousePressed; bool m_printing; bool m_imageDrag; @@ -330,7 +331,7 @@ private: KoRect m_insRect; ///< variable updated and painted to represent the to insert frame bool m_deleteMovingRect; KoPicture m_kopicture; // The picture - QSize m_pixmapSize; // size when inserting a picture (not necessarily the size of the picture) + TQSize m_pixmapSize; // size when inserting a picture (not necessarily the size of the picture) bool m_keepRatio;//when inserting a picture KoDocumentEntry m_partEntry; // when inserting a part int m_rowColResized; // when resizing a row or column @@ -349,7 +350,7 @@ private: int /*KWTableFrameSet::CellSize*/ width; int /*KWTableFrameSet::CellSize*/ height; bool floating; - QString tableTemplateName; + TQString tableTemplateName; KWTableTemplate *tt; } m_table; KWTableFrameSet *m_currentTable; @@ -385,7 +386,7 @@ class InteractionPolicy { * @param point the new point where the mouse if at. This is in the document (pt-based) * coordinate system. */ - virtual void handleMouseMove(Qt::ButtonState keyState, const KoPoint &point) = 0; + virtual void handleMouseMove(TQt::ButtonState keyState, const KoPoint &point) = 0; /** * For interactions that are undo-able this method should be implemented to return such * a command. Implementations should return 0 otherwise. @@ -404,13 +405,13 @@ class InteractionPolicy { /** * This instanciates a new policy object and decides which policy is created based on the params. - * @param parent the parent canvas for things like redraw commands. + * @param tqparent the tqparent canvas for things like redraw commands. * @param meaning the mouseMeaning of as it is at 'point' * @param point the place where the mouseDown is registred. * @param buttonState which button is used to click, like Qt::LeftButton - * @param keyState which keys are held down at the click, like Qt::ControlButton + * @param keyState which keys are held down at the click, like TQt::ControlButton */ - static InteractionPolicy* createPolicy(KWCanvas *parent, MouseMeaning meaning, KoPoint &point, Qt::ButtonState buttonState, Qt::ButtonState keyState); + static InteractionPolicy* createPolicy(KWCanvas *tqparent, MouseMeaning meaning, KoPoint &point, TQt::ButtonState buttonState, TQt::ButtonState keyState); void hadDragEvents() { m_gotDragEvents = true; } bool gotDragEvents() { return m_gotDragEvents; } @@ -418,15 +419,15 @@ class InteractionPolicy { protected: /** * Constructor. - * @param parent the parent canvas. + * @param tqparent the tqparent canvas. * @param doInit if true this will initialize the m_frames and m_indexFrame variables. * @param includeInlineFrames if true the m_frames will include inline frames */ - InteractionPolicy(KWCanvas *parent, bool doInit = true, bool includeInlineFrames = false); + InteractionPolicy(KWCanvas *tqparent, bool doInit = true, bool includeInlineFrames = false); - QValueList<FrameIndex> m_indexFrame; + TQValueList<FrameIndex> m_indexFrame; KWCanvas *m_parent; - QValueList<KWFrame*> m_frames; + TQValueList<KWFrame*> m_frames; private: void init(); @@ -440,13 +441,13 @@ class InteractionPolicy { */ class FrameResizePolicy : public InteractionPolicy { public: - FrameResizePolicy(KWCanvas *parent, MouseMeaning meaning, KoPoint &point); - void handleMouseMove(Qt::ButtonState keyState, const KoPoint &point); + FrameResizePolicy(KWCanvas *tqparent, MouseMeaning meaning, KoPoint &point); + void handleMouseMove(TQt::ButtonState keyState, const KoPoint &point); KCommand *createCommand(); void finishInteraction(); private: - QValueList<FrameResizeStruct> m_frameResize; + TQValueList<FrameResizeStruct> m_frameResize; bool m_top, m_bottom, m_left, m_right; KoRect m_boundingRect; KoPoint m_hotSpot; @@ -459,12 +460,12 @@ class FrameResizePolicy : public InteractionPolicy { */ class FrameMovePolicy : public InteractionPolicy { public: - FrameMovePolicy(KWCanvas *parent, KoPoint &point); - void handleMouseMove(Qt::ButtonState keyState, const KoPoint &point); + FrameMovePolicy(KWCanvas *tqparent, KoPoint &point); + void handleMouseMove(TQt::ButtonState keyState, const KoPoint &point); KCommand *createCommand(); void finishInteraction(); private: - QValueList<FrameMoveStruct> m_frameMove; + TQValueList<FrameMoveStruct> m_frameMove; KoPoint m_hotSpot; KoPoint m_startPoint; KoRect m_boundingRect; @@ -475,8 +476,8 @@ class FrameMovePolicy : public InteractionPolicy { */ class FrameSelectPolicy : public InteractionPolicy { public: - FrameSelectPolicy(KWCanvas *parent, MouseMeaning meaning, KoPoint &point, Qt::ButtonState state, Qt::ButtonState keyState); - void handleMouseMove(Qt::ButtonState keyState, const KoPoint &point); + FrameSelectPolicy(KWCanvas *tqparent, MouseMeaning meaning, KoPoint &point, TQt::ButtonState state, TQt::ButtonState keyState); + void handleMouseMove(TQt::ButtonState keyState, const KoPoint &point); KCommand *createCommand(); void finishInteraction(); bool isValid() { return m_validSelection; } |