diff options
Diffstat (limited to 'kword/KWViewMode.h')
-rw-r--r-- | kword/KWViewMode.h | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/kword/KWViewMode.h b/kword/KWViewMode.h index 8afde053..fc78779a 100644 --- a/kword/KWViewMode.h +++ b/kword/KWViewMode.h @@ -20,10 +20,10 @@ #ifndef kwviewmode_h #define kwviewmode_h -#include <qrect.h> +#include <tqrect.h> class KWDocument; -class QPainter; -class QRegion; +class TQPainter; +class TQRegion; class KWTextFrameSet; class KWFrameSet; class KWCanvas; @@ -54,42 +54,42 @@ public: virtual ~KWViewMode() {} /** Normal coord -> view coord */ - virtual QPoint normalToView( const QPoint & nPoint ) = 0; + virtual TQPoint normalToView( const TQPoint & nPoint ) = 0; /** Normal coord -> view coord */ - QRect normalToView( const QRect & nRect ) - { return QRect( normalToView( nRect.topLeft() ), nRect.size() ); } + TQRect normalToView( const TQRect & nRect ) + { return TQRect( normalToView( nRect.topLeft() ), nRect.size() ); } /** View coord -> normal coord */ - virtual QPoint viewToNormal( const QPoint & vPoint ) = 0; + virtual TQPoint viewToNormal( const TQPoint & vPoint ) = 0; /** View coord -> normal coord */ - QRect viewToNormal( const QRect & nRect ) - { return QRect( viewToNormal( nRect.topLeft() ), viewToNormal( nRect.bottomRight() ) ); } + TQRect viewToNormal( const TQRect & nRect ) + { return TQRect( viewToNormal( nRect.topLeft() ), viewToNormal( nRect.bottomRight() ) ); } /** Return view coord for page rect. Avoids rounding problems when doing normalToView(zoomedRect) */ - virtual QRect viewPageRect( int pgNum ) = 0; + virtual TQRect viewPageRect( int pgNum ) = 0; /** Size of the contents area, in pixels */ - virtual QSize contentsSize() = 0; + virtual TQSize contentsSize() = 0; /** Size (in pixels) of the total area available for text in a given textframeset * This is used by KWTextFrameSet::drawFrame to erase between the bottom of the * last paragraph and the bottom of the available area. */ - virtual QSize availableSizeForText( KWTextFrameSet* textfs ); + virtual TQSize availableSizeForText( KWTextFrameSet* textfs ); /** "Topleft of current page" - concept used by the rulers. * The default implementation is good enough for any page-based viewmode, * since it calls normalToView. But the textmode has no page concept. */ - virtual QPoint pageCorner(); + virtual TQPoint pageCorner(); /** The result of this is passed to setFrameStartEnd for both rulers * (after adjustement with pageCorner()) */ - virtual QRect rulerFrameRect(); - /** Called when the page layout is set, or changes. + virtual TQRect rulerFrameRect(); + /** Called when the page tqlayout is set, or changes. * Usually this is directly passed to KoRuler (for page-based viewmodes) */ - virtual void setPageLayout( KoRuler* hRuler, KoRuler* vRuler, const KoPageLayout& layout ); + virtual void setPageLayout( KoRuler* hRuler, KoRuler* vRuler, const KoPageLayout& tqlayout ); - virtual void drawPageBorders( QPainter * painter, const QRect & crect, const QRegion & emptySpaceRegion ) = 0; + virtual void drawPageBorders( TQPainter * painter, const TQRect & crect, const TQRegion & emptySpaceRegion ) = 0; /** Config option for KWViewModePreview (a bit of a hack) */ virtual void setPagesPerRow(int) {} @@ -122,13 +122,13 @@ public: virtual bool hasPages() { return true; } /** Return the name of the viewmode, used for loading/saving. */ - virtual const QString type() const = 0; + virtual const TQString type() const = 0; /** Answers the question if argument frameset has to be drawn as a text-mode * text area if true, or if false as a frame with its own contents. */ virtual bool isTextModeFrameset(KWFrameSet *) const { return false; } - static KWViewMode *create( const QString& viewModeType, KWDocument* doc, KWCanvas* canvas ); + static KWViewMode *create( const TQString& viewModeType, KWDocument* doc, KWCanvas* canvas ); KWCanvas * canvas() const { return m_canvas; } @@ -140,10 +140,10 @@ protected: * @param emptySpaceRegion the empty space to clear up inside the page (in view pixels) * @param painter the painter to paint the border on. */ - void drawOnePageBorder( QPainter * painter, const QRect & crect, const QRect & pageRect, - const QRegion & emptySpaceRegion ); - QRect drawRightShadow( QPainter * painter, const QRect & crect, const QRect & pageRect, int topOffset ); - QRect drawBottomShadow( QPainter * painter, const QRect & crect, const QRect & pageRect, int leftOffset ); + void drawOnePageBorder( TQPainter * painter, const TQRect & crect, const TQRect & pageRect, + const TQRegion & emptySpaceRegion ); + TQRect drawRightShadow( TQPainter * painter, const TQRect & crect, const TQRect & pageRect, int topOffset ); + TQRect drawBottomShadow( TQPainter * painter, const TQRect & crect, const TQRect & pageRect, int leftOffset ); static const unsigned short s_shadowOffset; KWDocument * m_doc; @@ -159,14 +159,14 @@ public: : KWViewMode( doc, canvas, drawFrameBorders ) {} virtual ~KWViewModeNormal() {} - virtual QPoint normalToView( const QPoint & nPoint ); - virtual QPoint viewToNormal( const QPoint & vPoint ); - virtual QRect viewPageRect( int pgNum ); - virtual QSize contentsSize(); + virtual TQPoint normalToView( const TQPoint & nPoint ); + virtual TQPoint viewToNormal( const TQPoint & vPoint ); + virtual TQRect viewPageRect( int pgNum ); + virtual TQSize contentsSize(); - virtual const QString type() const { return "ModeNormal"; } + virtual const TQString type() const { return "ModeNormal"; } - virtual void drawPageBorders( QPainter * painter, const QRect & crect, const QRegion & emptySpaceRegion ); + virtual void drawPageBorders( TQPainter * painter, const TQRect & crect, const TQRegion & emptySpaceRegion ); protected: virtual int xOffset(KWPage *page, int canvasWidth = -1); @@ -199,16 +199,16 @@ public: void setDrawSelections( bool b ) { mDrawSelections = b; } // This view mode is very easy to implement ;-P - virtual QPoint normalToView( const QPoint & nPoint ) { return nPoint; } - virtual QPoint viewToNormal( const QPoint & vPoint ) { return vPoint; } - virtual QRect viewPageRect( int pgNum ); - virtual QSize contentsSize() { return QSize(); } + virtual TQPoint normalToView( const TQPoint & nPoint ) { return nPoint; } + virtual TQPoint viewToNormal( const TQPoint & vPoint ) { return vPoint; } + virtual TQRect viewPageRect( int pgNum ); + virtual TQSize contentsSize() { return TQSize(); } virtual bool hasPages() { return false; } - virtual void drawPageBorders( QPainter *, const QRect &, const QRegion & ){} + virtual void drawPageBorders( TQPainter *, const TQRect &, const TQRegion & ){} virtual bool drawSelections() { return mDrawSelections; } - virtual const QString type() const { return "ModeEmbedded"; } + virtual const TQString type() const { return "ModeEmbedded"; } virtual bool drawFrameBackground() { return mDrawFrameBackground; } private: @@ -225,15 +225,15 @@ public: KWViewModePreview( KWDocument * doc, KWCanvas* canvas, bool drawFrameBorders, int _nbPagePerRow ); virtual ~KWViewModePreview() {} - virtual QPoint normalToView( const QPoint & nPoint ); - virtual QPoint viewToNormal( const QPoint & vPoint ); - virtual QRect viewPageRect( int pgNum ); - virtual QSize contentsSize(); - virtual void drawPageBorders( QPainter * painter, const QRect & crect, const QRegion & emptySpaceRegion ); + virtual TQPoint normalToView( const TQPoint & nPoint ); + virtual TQPoint viewToNormal( const TQPoint & vPoint ); + virtual TQRect viewPageRect( int pgNum ); + virtual TQSize contentsSize(); + virtual void drawPageBorders( TQPainter * painter, const TQRect & crect, const TQRegion & emptySpaceRegion ); virtual void setPagesPerRow(int _nb) {m_pagesPerRow=_nb;} virtual int pagesPerRow() {return m_pagesPerRow;} - virtual const QString type() const { return "ModePreview"; } + virtual const TQString type() const { return "ModePreview"; } int numRows() const; @@ -265,18 +265,18 @@ public: */ static KWTextFrameSet *determineTextFrameSet( KWDocument* doc ); - virtual QPoint normalToView( const QPoint & nPoint ); - virtual QPoint viewToNormal( const QPoint & vPoint ); - virtual QSize contentsSize(); - virtual QRect viewPageRect( int ) { return QRect(); } - virtual QSize availableSizeForText( KWTextFrameSet* textfs ); + virtual TQPoint normalToView( const TQPoint & nPoint ); + virtual TQPoint viewToNormal( const TQPoint & vPoint ); + virtual TQSize contentsSize(); + virtual TQRect viewPageRect( int ) { return TQRect(); } + virtual TQSize availableSizeForText( KWTextFrameSet* textfs ); // There is no page concept. Keep everything relative to (0,0) - virtual QPoint pageCorner() { return QPoint( 0, 0 ); } - virtual QRect rulerFrameRect(); - virtual void setPageLayout( KoRuler* hRuler, KoRuler* vRuler, const KoPageLayout& layout ); + virtual TQPoint pageCorner() { return TQPoint( 0, 0 ); } + virtual TQRect rulerFrameRect(); + virtual void setPageLayout( KoRuler* hRuler, KoRuler* vRuler, const KoPageLayout& tqlayout ); - virtual void drawPageBorders( QPainter * painter, const QRect & crect, const QRegion & emptySpaceRegion ); - virtual const QString type() const { return "ModeText"; } + virtual void drawPageBorders( TQPainter * painter, const TQRect & crect, const TQRegion & emptySpaceRegion ); + virtual const TQString type() const { return "ModeText"; } virtual bool shouldFormatVertically() { return false; } virtual bool shouldAdjustMargins() { return false; } virtual bool hasFrames() { return false; } |