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 /kspread/kspread_canvas.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 'kspread/kspread_canvas.h')
-rw-r--r-- | kspread/kspread_canvas.h | 201 |
1 files changed, 102 insertions, 99 deletions
diff --git a/kspread/kspread_canvas.h b/kspread/kspread_canvas.h index f6f18758..ce18e157 100644 --- a/kspread/kspread_canvas.h +++ b/kspread/kspread_canvas.h @@ -35,9 +35,9 @@ #include <vector> -#include <qlineedit.h> -#include <qtooltip.h> -#include <qpen.h> +#include <tqlineedit.h> +#include <tqtooltip.h> +#include <tqpen.h> #include <ksharedptr.h> @@ -48,12 +48,12 @@ #define YBORDER_WIDTH 50 #define XBORDER_HEIGHT 20 -class QWidget; -class QTimer; -class QButton; -class QPainter; -class QLabel; -class QScrollBar; +class TQWidget; +class TQTimer; +class TQButton; +class TQPainter; +class TQLabel; +class TQScrollBar; class KoRect; class KoPoint; @@ -86,13 +86,14 @@ class EmbeddedObject; * That means that this class knows what to do when a key is pressed * or if the mouse button was clicked. */ -class KSPREAD_EXPORT Canvas : public QWidget +class KSPREAD_EXPORT Canvas : public TQWidget { friend class HBorder; friend class VBorder; friend class View; Q_OBJECT + TQ_OBJECT public: /** * The current action associated with the mouse. @@ -137,13 +138,13 @@ public: * @see Selection::lastRange() * @see Selection::activeElement() */ - QRect selection() const; + TQRect selection() const; /** * convenience function. * @return selection's marker * @see Selection::marker() */ - QPoint marker() const; + TQPoint marker() const; /** * convenience function. * @return selection's marker's column @@ -160,7 +161,7 @@ public: /** * @return the pen, the default grid is painted with (light gray) */ - const QPen& defaultGridPen() const; + const TQPen& defaultGridPen() const; /** * convenience function @@ -188,7 +189,7 @@ public: /** * @return a rect indicating which cell range is currently visible onscreen */ - QRect visibleCells() const; + TQRect visibleCells() const; /** * @return a pointer to the active sheet @@ -198,7 +199,7 @@ public: * convenience function * @see Map::findSheet() */ - Sheet* findSheet( const QString& _name ) const; + Sheet* findSheet( const TQString& _name ) const; /** @@ -218,7 +219,7 @@ public: * * @param location the cell coordinates to scroll to */ - void scrollToCell(QPoint location) const; + void scrollToCell(TQPoint location) const; /** * Chooses the correct EditorType by looking at * the current cells value. By default CellEditor is chosen. @@ -254,7 +255,7 @@ public: /** * Switches to choose mode and sets the initial @p selection. */ - void startChoose( const QRect& selection ); + void startChoose( const TQRect& selection ); /** * Switches to selection mode. * Clear the choice. @@ -283,7 +284,7 @@ public: */ void closeEditor(); - // Created by the view since it's layout is managed there, + // Created by the view since it's tqlayout is managed there, // but is in fact a sibling of the canvas, which needs to know about it. void setEditWidget( KSpread::EditWidget * ew ); @@ -305,7 +306,7 @@ public: double autoScrollAccelerationY( int offset ); //TODO: These embedded-object related methods need API documentation! - EmbeddedObject* getObject( const QPoint &pos, Sheet *_sheet ); + EmbeddedObject* getObject( const TQPoint &pos, Sheet *_sheet ); void selectAllObjects(); void deselectAllObjects(); void selectObject( EmbeddedObject* ); @@ -325,7 +326,7 @@ public: /// resize the m_resizeObject void resizeObject( ModifyType _modType, const KoPoint & point, bool keepRatio ); /// create KPrResizeCmd - void finishResizeObject( const QString &name, bool layout = true ); + void finishResizeObject( const TQString &name, bool tqlayout = true ); /** * @brief Display object above the other objects in editiong mode @@ -349,11 +350,11 @@ public: * * @return List of objects */ - void displayObjectList( QPtrList<EmbeddedObject> &list ); + void displayObjectList( TQPtrList<EmbeddedObject> &list ); KoRect objectRect( bool all ) const; - void repaintObject( EmbeddedObject *obj ); + void tqrepaintObject( EmbeddedObject *obj ); /** * This is intended to copy the selected objects to the clipboard so that they can be pasted into other @@ -376,19 +377,19 @@ signals: void objectSizeChanged(); protected: - virtual void keyPressEvent ( QKeyEvent* _ev ); - virtual void paintEvent ( QPaintEvent* _ev ); - virtual void mousePressEvent( QMouseEvent* _ev ); - virtual void mouseReleaseEvent( QMouseEvent* _ev ); - virtual void mouseMoveEvent( QMouseEvent* _ev ); - virtual void mouseDoubleClickEvent( QMouseEvent* ); - virtual void wheelEvent( QWheelEvent* ); - virtual void focusInEvent( QFocusEvent* ); - virtual void focusOutEvent( QFocusEvent* ); - virtual void resizeEvent( QResizeEvent * _ev ); - virtual void dragMoveEvent(QDragMoveEvent * _ev); - virtual void dropEvent(QDropEvent * _ev); - virtual void dragLeaveEvent(QDragLeaveEvent * _ev); + virtual void keyPressEvent ( TQKeyEvent* _ev ); + virtual void paintEvent ( TQPaintEvent* _ev ); + virtual void mousePressEvent( TQMouseEvent* _ev ); + virtual void mouseReleaseEvent( TQMouseEvent* _ev ); + virtual void mouseMoveEvent( TQMouseEvent* _ev ); + virtual void mouseDoubleClickEvent( TQMouseEvent* ); + virtual void wheelEvent( TQWheelEvent* ); + virtual void focusInEvent( TQFocusEvent* ); + virtual void focusOutEvent( TQFocusEvent* ); + virtual void resizeEvent( TQResizeEvent * _ev ); + virtual void dragMoveEvent(TQDragMoveEvent * _ev); + virtual void dropEvent(TQDropEvent * _ev); + virtual void dragLeaveEvent(TQDragLeaveEvent * _ev); /** * Checks to see if there is a size grip for a highlight range at a given position. @@ -406,18 +407,18 @@ private slots: /** * Scroll canvas when receiving this signal */ - void slotAutoScroll(const QPoint &scrollDist); + void slotAutoScroll(const TQPoint &scrollDist); void doAutoScroll(); - void speakCell(QWidget* w, const QPoint& p, uint flags); + void speakCell(TQWidget* w, const TQPoint& p, uint flags); private: - virtual bool eventFilter( QObject *o, QEvent *e ); + virtual bool eventFilter( TQObject *o, TQEvent *e ); HBorder* hBorderWidget() const; VBorder* vBorderWidget() const; - QScrollBar* horzScrollBar() const; - QScrollBar* vertScrollBar() const; + TQScrollBar* horzScrollBar() const; + TQScrollBar* vertScrollBar() const; /** * Returns the area of the document currently visible in a painter's @@ -425,27 +426,27 @@ private: * translating it by the current x and y offset of the Canvas (taking * the zoom level into account) */ - QRect painterWindowGeometry( const QPainter& painter ) const; + TQRect painterWindowGeometry( const TQPainter& painter ) const; /** * Enables clipping and removes the areas on the canvas widget occupied by embedded objects from * the clip region. This ensures that subsequent drawing operations using the given painter * don't paint over the area occupied by embedded objects */ - void clipoutChildren( QPainter& painter ) const; + void clipoutChildren( TQPainter& painter ) const; /** * Returns the range of cells which appear in the specified area of the Canvas widget - * For example, cellsInArea( QRect(0,0,width(),height()) ) returns a range containing all visible cells + * For example, cellsInArea( TQRect(0,0,width(),height()) ) returns a range containing all visible cells * * @param area The area (in pixels) on the Canvas widget */ - QRect cellsInArea( const QRect area ) const; + TQRect cellsInArea( const TQRect area ) const; /** - * Paints the children + * Paints the tqchildren */ - void paintChildren( QPainter& painter, QWMatrix& matrix ); + void paintChildren( TQPainter& painter, TQWMatrix& matrix ); /** * @see #setLastEditorWithFocus @@ -458,7 +459,7 @@ private: void startTheDrag(); /* helpers for the paintUpdates function */ - void paintNormalMarker(QPainter& painter, const KoRect &viewRect); + void paintNormalMarker(TQPainter& painter, const KoRect &viewRect); /** * Paint the highlighted ranges of cells. When the user is editing a formula in a text box, cells and ranges referenced @@ -466,7 +467,7 @@ private: * @param painter The painter on which to draw the highlighted ranges * @param viewRect The area currently visible on the canvas */ - void paintHighlightedRanges(QPainter& painter, const KoRect& viewRect); + void paintHighlightedRanges(TQPainter& painter, const KoRect& viewRect); /** * Calculates the visible region on the canvas occupied by a range of cells on the currently active sheet. @@ -479,7 +480,7 @@ private: * @param visibleRect This is set to the visible region occupied by the given range of cells * */ - void sheetAreaToVisibleRect( const QRect& sheetArea, + void sheetAreaToVisibleRect( const TQRect& sheetArea, KoRect& visibleRect ); /** @@ -490,7 +491,7 @@ private: * @param sheetArea The range of cells on the current sheet * @param visibleRect This is set to the physical region occupied by the given range of cells */ - void sheetAreaToRect( const QRect& sheetArea, KoRect& rect ); + void sheetAreaToRect( const TQRect& sheetArea, KoRect& rect ); /** @@ -507,43 +508,43 @@ private: * Again, these are in the order left, top, right, bottom. * This should be preallocated with a size of at least 4. */ - void retrieveMarkerInfo( const QRect &marker, const KoRect &viewRect, + void retrieveMarkerInfo( const TQRect &marker, const KoRect &viewRect, double positions[], bool paintSides[] ); - bool formatKeyPress( QKeyEvent * _ev ); + bool formatKeyPress( TQKeyEvent * _ev ); /** helper method for formatKeyPress */ - bool formatCellByKey(Cell *cell, int key, const QRect &rect); + bool formatCellByKey(Cell *cell, int key, const TQRect &rect); - void processClickSelectionHandle(QMouseEvent *event); + void processClickSelectionHandle(TQMouseEvent *event); void processLeftClickAnchor(); /** current cursor position, be it marker or choose marker */ - QPoint cursorPos(); + TQPoint cursorPos(); /** * returns the rect that needs to be redrawn */ - QRect moveDirection(KSpread::MoveTo direction, bool extendSelection); - - void processEnterKey(QKeyEvent *event); - void processArrowKey(QKeyEvent *event); - void processEscapeKey(QKeyEvent *event); - bool processHomeKey(QKeyEvent *event); - bool processEndKey(QKeyEvent *event); - bool processPriorKey(QKeyEvent *event); - bool processNextKey(QKeyEvent *event); - void processDeleteKey(QKeyEvent *event); - void processF2Key(QKeyEvent *event); - void processF4Key(QKeyEvent *event); - void processOtherKey(QKeyEvent *event); - bool processControlArrowKey(QKeyEvent *event); - - void processIMEvent( QIMEvent * event ); + TQRect moveDirection(KSpread::MoveTo direction, bool extendSelection); + + void processEnterKey(TQKeyEvent *event); + void processArrowKey(TQKeyEvent *event); + void processEscapeKey(TQKeyEvent *event); + bool processHomeKey(TQKeyEvent *event); + bool processEndKey(TQKeyEvent *event); + bool processPriorKey(TQKeyEvent *event); + bool processNextKey(TQKeyEvent *event); + void processDeleteKey(TQKeyEvent *event); + void processF2Key(TQKeyEvent *event); + void processF4Key(TQKeyEvent *event); + void processOtherKey(TQKeyEvent *event); + bool processControlArrowKey(TQKeyEvent *event); + + void processIMEvent( TQIMEvent * event ); /** * Used in choose mode. Shows/hides the editor depending on the selected @@ -556,7 +557,7 @@ private: * This function sets the paint dirty flag for a @p changedRegion in a * @p sheet . * The calculation which cells really should look different with the new - * selection rather than repainting the entire area has to be done before. + * selection rather than tqrepainting the entire area has to be done before. * @param sheet the sheet, which contains the cells * @param changedRegion the cell region to be set as dirty */ @@ -572,11 +573,12 @@ private: /** * HBorder */ -class HBorder : public QWidget +class HBorder : public TQWidget { Q_OBJECT + TQ_OBJECT public: - HBorder( QWidget *_parent, Canvas *_canvas, View *_view ); + HBorder( TQWidget *_parent, Canvas *_canvas, View *_view ); ~HBorder(); int markerColumn() const { return m_iSelectionAnchor; } @@ -584,26 +586,26 @@ public: void updateColumns( int from, int to ); - QSize sizeHint() const; + TQSize tqsizeHint() const; private slots: void doAutoScroll(); protected: - virtual void paintEvent ( QPaintEvent* _ev ); - virtual void mousePressEvent( QMouseEvent* _ev ); - virtual void mouseReleaseEvent( QMouseEvent* _ev ); - virtual void mouseDoubleClickEvent( QMouseEvent* _ev ); - virtual void mouseMoveEvent( QMouseEvent* _ev ); - virtual void wheelEvent( QWheelEvent* ); - virtual void focusOutEvent( QFocusEvent* ev ); - virtual void resizeEvent( QResizeEvent * _ev ); + virtual void paintEvent ( TQPaintEvent* _ev ); + virtual void mousePressEvent( TQMouseEvent* _ev ); + virtual void mouseReleaseEvent( TQMouseEvent* _ev ); + virtual void mouseDoubleClickEvent( TQMouseEvent* _ev ); + virtual void mouseMoveEvent( TQMouseEvent* _ev ); + virtual void wheelEvent( TQWheelEvent* ); + virtual void focusOutEvent( TQFocusEvent* ev ); + virtual void resizeEvent( TQResizeEvent * _ev ); void paintSizeIndicator( int mouseX, bool firstTime ); private: Canvas *m_pCanvas; View *m_pView; - QTimer * m_scrollTimer; + TQTimer * m_scrollTimer; /** * Flag that inidicates whether the user wants to mark columns. @@ -643,7 +645,7 @@ private: /** * The label used for showing the current size, when resizing */ - QLabel *m_lSize; + TQLabel *m_lSize; /** * True when the mouse button is pressed @@ -658,36 +660,37 @@ private: /** * VBorder */ -class VBorder : public QWidget +class VBorder : public TQWidget { Q_OBJECT + TQ_OBJECT public: - VBorder( QWidget *_parent, Canvas *_canvas, View *_view ); + VBorder( TQWidget *_parent, Canvas *_canvas, View *_view ); ~VBorder(); int markerRow() const { return m_iSelectionAnchor; } void equalizeRow( double resize ); void updateRows( int from, int to ); - QSize sizeHint() const; + TQSize tqsizeHint() const; private slots: void doAutoScroll(); protected: - virtual void paintEvent ( QPaintEvent* _ev ); - virtual void mousePressEvent( QMouseEvent* _ev ); - virtual void mouseReleaseEvent( QMouseEvent* _ev ); - virtual void mouseMoveEvent( QMouseEvent* _ev ); - virtual void mouseDoubleClickEvent( QMouseEvent* _ev ); - virtual void wheelEvent( QWheelEvent* ); - virtual void focusOutEvent( QFocusEvent* ev ); + virtual void paintEvent ( TQPaintEvent* _ev ); + virtual void mousePressEvent( TQMouseEvent* _ev ); + virtual void mouseReleaseEvent( TQMouseEvent* _ev ); + virtual void mouseMoveEvent( TQMouseEvent* _ev ); + virtual void mouseDoubleClickEvent( TQMouseEvent* _ev ); + virtual void wheelEvent( TQWheelEvent* ); + virtual void focusOutEvent( TQFocusEvent* ev ); void paintSizeIndicator( int mouseY, bool firstTime ); private: Canvas *m_pCanvas; View *m_pView; - QTimer * m_scrollTimer; + TQTimer * m_scrollTimer; bool m_bSelection; int m_iSelectionAnchor; @@ -697,7 +700,7 @@ private: /** * The label used for showing the current size, when resizing */ - QLabel *m_lSize; + TQLabel *m_lSize; /** * True when the mouse button is pressed @@ -710,7 +713,7 @@ private: /** * Tooltip, which displays the comment and cell content, when it's too short */ -class ToolTip : public QToolTip +class ToolTip : public TQToolTip { public: ToolTip( Canvas* canvas ); @@ -719,7 +722,7 @@ protected: /** * @reimp */ - void maybeTip( const QPoint& p ); + void maybeTip( const TQPoint& p ); private: Canvas* m_canvas; |