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 /lib/kofficeui/KoGuides.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 'lib/kofficeui/KoGuides.h')
-rw-r--r-- | lib/kofficeui/KoGuides.h | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/lib/kofficeui/KoGuides.h b/lib/kofficeui/KoGuides.h index c084c013..e3529c72 100644 --- a/lib/kofficeui/KoGuides.h +++ b/lib/kofficeui/KoGuides.h @@ -22,20 +22,21 @@ #ifndef KOGUIDES_H #define KOGUIDES_H -#include <qevent.h> -#include <qobject.h> +#include <tqevent.h> +#include <tqobject.h> #include <koffice_export.h> -class QPaintDevice; +class TQPaintDevice; class KoPoint; class KoRect; class KoView; class KoZoomHandler; -class KOFFICEUI_EXPORT KoGuides : public QObject +class KOFFICEUI_EXPORT KoGuides : public TQObject { Q_OBJECT + TQ_OBJECT public: /** * @brief Constructor @@ -55,10 +56,10 @@ public: * * @param painter with which the guides are painted */ - void paintGuides( QPainter &painter ); + void paintGuides( TQPainter &painter ); - typedef int SnapStatus; - static const SnapStatus SNAP_NONE, SNAP_HORIZ, SNAP_VERT, SNAP_BOTH; + typedef int SnaptqStatus; + static const SnaptqStatus SNAP_NONE, SNAP_HORIZ, SNAP_VERT, SNAP_BOTH; /** * @brief Handle mousePressEvent @@ -70,14 +71,14 @@ public: * gets toggled. * If no guide is under the position all guides get deselected. * - * @param e QMouseEvent + * @param e TQMouseEvent * * @return true if the event was handled * @return false otherwise * The event counts a not handled when only guides where * deselected. */ - bool mousePressEvent( QMouseEvent *e ); + bool mousePressEvent( TQMouseEvent *e ); /** * @brief Handle mouseMoveEvent @@ -86,31 +87,31 @@ public: * selected guides. * If the mouse is moved over a guide line the cursor gets updated. * - * @param e QMouseEvent + * @param e TQMouseEvent * * @return true if the event was handled (guide moved, cursor changed as * guide lies below) * @return false otherwise */ - bool mouseMoveEvent( QMouseEvent *e ); + bool mouseMoveEvent( TQMouseEvent *e ); /** * - * @param e QMouseEvent + * @param e TQMouseEvent * * @return true if the event was handled * @return false otherwise */ - bool mouseReleaseEvent( QMouseEvent *e ); + bool mouseReleaseEvent( TQMouseEvent *e ); /** * - * @param e QKeyEvent + * @param e TQKeyEvent * * @return true if the event was handled * @return false otherwise */ - bool keyPressEvent( QKeyEvent *e ); + bool keyPressEvent( TQKeyEvent *e ); /** * @brief Set the guide lines. @@ -120,7 +121,7 @@ public: * @param horizontalPos A list of the position of the horizontal guide lines. * @param verticalPos A list of the position of the vertical guide lines. */ - void setGuideLines( const QValueList<double> &horizontalPos, const QValueList<double> &verticalPos ); + void setGuideLines( const TQValueList<double> &horizontalPos, const TQValueList<double> &verticalPos ); /** * @brief Set the positions for snapping of auto guide lines @@ -130,7 +131,7 @@ public: * @param horizontalPos A list of the position of the horizontal guide lines. * @param verticalPos A list of the position of the vertical guide lines. */ - void setAutoGuideLines( const QValueList<double> &horizontalPos, const QValueList<double> &verticalPos ); + void setAutoGuideLines( const TQValueList<double> &horizontalPos, const TQValueList<double> &verticalPos ); /** * @brief Get the position of the guide lines @@ -141,23 +142,23 @@ public: * @param horizontalPos A list of the position of the horizontal guide lines. * @param verticalPos A list of the position of the vertical guide lines. */ - void getGuideLines( QValueList<double> &horizontalPos, QValueList<double> &verticalPos ) const; + void getGuideLines( TQValueList<double> &horizontalPos, TQValueList<double> &verticalPos ) const; /** * @brief Snap rect to guidelines * * This looks for a guide which is in reach for the guide as defined in snap. - * This method has the abillity to combine more calls. The snapStatus and diff args are both input and - * output. On first call you should set snapStatus to 0. The return value would then show in which + * This method has the abillity to combine more calls. The snaptqStatus and diff args are both input and + * output. On first call you should set snaptqStatus to 0. The return value would then show in which * directions it has snapped. If you combine several KoGuides you can let these output arguments * be input for the next koGuide. That way you'll always catch the nearest guide. * * @param rect the rect which should be snapped * @param snap the distance within the guide should snap - but always snap if already snapped - * @param snapStatus if horiz,vert or both directions are snapped (both in and out param). + * @param snaptqStatus if horiz,vert or both directions are snapped (both in and out param). * @param diff distance away from guide. Only valid if status is snapping (both in and out param) */ - void snapToGuideLines( KoRect &rect, int snap, SnapStatus &snapStatus, KoPoint &diff ); + void snapToGuideLines( KoRect &rect, int snap, SnaptqStatus &snaptqStatus, KoPoint &diff ); /** * @brief Snap rect to guidelines @@ -166,36 +167,36 @@ public: * * @param pos the position which should be snapped * @param snap the distance wherein the guide should snap - but always snap if already snapped - * @param snapStatus if horiz,vert or both directions are snapped (both in and out param) + * @param snaptqStatus if horiz,vert or both directions are snapped (both in and out param) * @param diff distance away from guide. Only valid if status is snapping (both in and out param) */ - void snapToGuideLines( KoPoint &pos, int snap, SnapStatus &snapStatus, KoPoint &diff ); + void snapToGuideLines( KoPoint &pos, int snap, SnaptqStatus &snaptqStatus, KoPoint &diff ); /** - * @brief repaint guides if any changed snapping status + * @brief tqrepaint guides if any changed snapping status * * This issues a paint request if any guides have changed snapping status. * * @param snappedRect the rect after it has been snapped */ - void repaintSnapping( const KoRect &snappedRect ); + void tqrepaintSnapping( const KoRect &snappedRect ); /** - * @brief repaint guides if any changed snapping status + * @brief tqrepaint guides if any changed snapping status * * This issues a paint request if any guides have changed snapping status. * * @param snappedPoint the point after it has been snapped */ - void repaintSnapping( const KoPoint &snappedPoint, SnapStatus snapStatus ); + void tqrepaintSnapping( const KoPoint &snappedPoint, SnaptqStatus snaptqStatus ); /** - * @brief repaint guides so none is snapped + * @brief tqrepaint guides so none is snapped * * This issues a paint request if any guides have changed snapping status. * It also effectively un-snaps all since it doesn't take an argument */ - void repaintAfterSnapping( ); + void tqrepaintAfterSnapping( ); /** * @brief Find the closesed disance to the next guide within the given distance @@ -210,7 +211,7 @@ public slots: /** * @brief Move Guide * - * This slot can be connected to void KoRuler::moveGuide( const QPoint &, bool, int ); + * This slot can be connected to void KoRuler::moveGuide( const TQPoint &, bool, int ); * It will add a new guide when you move from the ruler to the canvas. After that it * moves the guide. * @@ -218,19 +219,19 @@ public slots: * @param horizontal true if the guide is horizontal, false if vertical * @param rulerWidth The witdth of the ruler as the pos is seen from the ruler widget. */ - void moveGuide( const QPoint &pos, bool horizontal, int rulerWidth ); + void moveGuide( const TQPoint &pos, bool horizontal, int rulerWidth ); /** * @brief Add Guide * - * This slot can be connected to void KoRuler::addGuide( const QPoint &, bool, int ); + * This slot can be connected to void KoRuler::addGuide( const TQPoint &, bool, int ); * It will finish the inserting of a guide from moveGuide(). * * @param pos The pos of the mouse * @param horizontal true if the guide is horizontal, false if vertical * @param rulerWidth The witdth of the ruler as the pos is seen from the ruler widget. */ - void addGuide( const QPoint &pos, bool horizontal, int rulerWidth ); + void addGuide( const TQPoint &pos, bool horizontal, int rulerWidth ); signals: /** @@ -252,9 +253,9 @@ signals: /** * @brief This signal is emitted when guides start/stop painting. * - * With this signal it is possible to only repaint the guides in the paint + * With this signal it is possible to only tqrepaint the guides in the paint * method of the canvas. Just set/unset a flag when this signal is emmited. - * This signal is emitted before and after a repaint is done. + * This signal is emitted before and after a tqrepaint is done. * * @param state true when starting painting guides, false when stopping. */ @@ -300,7 +301,7 @@ private: * @param pos where to insert the guide * @param o orientation of the guide line */ - void add( Qt::Orientation o, QPoint &pos ); + void add( Qt::Orientation o, TQPoint &pos ); /** * @brief Select a guide @@ -350,7 +351,7 @@ private: * @return the fould guide * @return 0 if none is found */ - KoGuideLine * find( KoPoint &p, double diff ); + KoGuideLine * tqfind( KoPoint &p, double diff ); /** * @brief Move selected guides. @@ -360,7 +361,7 @@ private: * * @param pos position of the mouse */ - void moveSelectedBy( QPoint &p ); + void moveSelectedBy( TQPoint &p ); /** * @brief Map pos from screen @@ -369,7 +370,7 @@ private: * * @return pos in document */ - KoPoint mapFromScreen( const QPoint & pos ); + KoPoint mapFromScreen( const TQPoint & pos ); /** * @brief Map pos to screen @@ -378,7 +379,7 @@ private: * * @return pos on screen */ - QPoint mapToScreen( const KoPoint & pos ); + TQPoint mapToScreen( const KoPoint & pos ); /** * @brief Check if the both values are nearly the same. @@ -389,7 +390,7 @@ private: * @return true if they are the same * @return false otherwise */ - bool virtuallyEqual( double a, double b ) { return QABS( a - b ) < 1E-4; } + bool virtuallyEqual( double a, double b ) { return TQABS( a - b ) < 1E-4; } /// view KoView * m_view; @@ -405,10 +406,10 @@ private: }; /// array of list of the different guide line types - QValueList<KoGuideLine *> m_guideLines[GL_END]; + TQValueList<KoGuideLine *> m_guideLines[GL_END]; /// used to save the last mouse position - QPoint m_lastPoint; + TQPoint m_lastPoint; /// true if a guide is selected at the moment bool m_mouseSelected; /// true if a guide is inserted at the moment |