kword

#include <KWViewMode.h>

Inheritance diagram for KWViewModeText:
KWViewMode

Public Member Functions

 KWViewModeText (KWDocument *doc, KWCanvas *canvas, KWTextFrameSet *fs)
KWTextFrameSet * textFrameSet () const
virtual TQPoint normalToView (const TQPoint &nPoint)
virtual TQPoint viewToNormal (const TQPoint &vPoint)
virtual TQSize contentsSize ()
virtual TQRect viewPageRect (int)
virtual TQSize availableSizeForText (KWTextFrameSet *textfs)
virtual TQPoint pageCorner ()
virtual TQRect rulerFrameRect ()
virtual void setPageLayout (KoRuler *hRuler, KoRuler *vRuler, const KoPageLayout &layout)
virtual void drawPageBorders (TQPainter *painter, const TQRect &crect, const TQRegion &emptySpaceRegion)
virtual const TQString type () const
virtual bool shouldFormatVertically ()
virtual bool shouldAdjustMargins ()
virtual bool hasFrames ()
virtual bool hasPages ()
virtual bool isFrameSetVisible (const KWFrameSet *fs)
virtual bool isTextModeFrameset (KWFrameSet *fs) const
Public Member Functions inherited from KWViewMode
TQRect normalToView (const TQRect &nRect)
TQRect viewToNormal (const TQRect &nRect)
virtual void setPagesPerRow (int)
virtual int pagesPerRow ()
virtual bool drawSelections ()
virtual bool drawFrameBackground ()
bool drawFrameBorders () const
void setDrawFrameBorders (bool b)
KWCanvas * canvas () const

Static Public Member Functions

static KWTextFrameSet * determineTextFrameSet (KWDocument *doc)
Static Public Member Functions inherited from KWViewMode
static KWViewMode * create (const TQString &viewModeType, KWDocument *doc, KWCanvas *canvas)

Static Public Attributes

static const int OFFSET = 10

Additional Inherited Members

Protected Member Functions inherited from KWViewMode
 KWViewMode (KWDocument *doc, KWCanvas *canvas, bool drawFrameBorders)
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)
Protected Attributes inherited from KWViewMode
KWDocument * m_doc
KWCanvas * m_canvas
bool m_drawFrameBorders
Static Protected Attributes inherited from KWViewMode
static const unsigned short s_shadowOffset = 3

Detailed Description

The 'edit only one text frameset' view mode.

Definition at line 252 of file KWViewMode.h.

Constructor & Destructor Documentation

◆ KWViewModeText()

KWViewModeText::KWViewModeText ( KWDocument * doc,
KWCanvas * canvas,
KWTextFrameSet * fs )

Definition at line 449 of file KWViewMode.cpp.

◆ ~KWViewModeText()

virtual KWViewModeText::~KWViewModeText ( )
inlinevirtual

Definition at line 257 of file KWViewMode.h.

Member Function Documentation

◆ availableSizeForText()

TQSize KWViewModeText::availableSizeForText ( KWTextFrameSet * textfs)
virtual

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.

Reimplemented from KWViewMode.

Definition at line 519 of file KWViewMode.cpp.

◆ contentsSize()

TQSize KWViewModeText::contentsSize ( )
virtual

Size of the contents area, in pixels.

Implements KWViewMode.

Definition at line 502 of file KWViewMode.cpp.

◆ determineTextFrameSet()

KWTextFrameSet * KWViewModeText::determineTextFrameSet ( KWDocument * doc)
static

Return a text frameset that the user has either selected or is currently editing, returning the main text frameset otherwise.

If the selected frame is not a text FS, and the user is not editing one in the first view plus the document has no main text frameset then this method will return 0

Definition at line 462 of file KWViewMode.cpp.

◆ drawPageBorders()

void KWViewModeText::drawPageBorders ( TQPainter * painter,
const TQRect & crect,
const TQRegion & emptySpaceRegion )
virtual

Implements KWViewMode.

Definition at line 538 of file KWViewMode.cpp.

◆ hasFrames()

virtual bool KWViewModeText::hasFrames ( )
inlinevirtual

Does this viewmode know anything about frames?

Reimplemented from KWViewMode.

Definition at line 282 of file KWViewMode.h.

◆ hasPages()

virtual bool KWViewModeText::hasPages ( )
inlinevirtual

Does this viewmode know anything about pages?

Reimplemented from KWViewMode.

Definition at line 283 of file KWViewMode.h.

◆ isFrameSetVisible()

bool KWViewModeText::isFrameSetVisible ( const KWFrameSet * )
virtual

Should this frameset be visible in this viewmode?

True by default, all are shown.

Reimplemented from KWViewMode.

Definition at line 524 of file KWViewMode.cpp.

◆ isTextModeFrameset()

bool KWViewModeText::isTextModeFrameset ( KWFrameSet * ) const
virtual

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.

Reimplemented from KWViewMode.

Definition at line 594 of file KWViewMode.cpp.

◆ normalToView()

TQPoint KWViewModeText::normalToView ( const TQPoint & nPoint)
virtual

Normal coord -> view coord.

Implements KWViewMode.

Definition at line 488 of file KWViewMode.cpp.

◆ pageCorner()

virtual TQPoint KWViewModeText::pageCorner ( )
inlinevirtual

"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.

Reimplemented from KWViewMode.

Definition at line 274 of file KWViewMode.h.

◆ rulerFrameRect()

TQRect KWViewModeText::rulerFrameRect ( )
virtual

The result of this is passed to setFrameStartEnd for both rulers (after adjustement with pageCorner()).

Reimplemented from KWViewMode.

Definition at line 569 of file KWViewMode.cpp.

◆ setPageLayout()

void KWViewModeText::setPageLayout ( KoRuler * hRuler,
KoRuler * vRuler,
const KoPageLayout & layout )
virtual

Called when the page layout is set, or changes.

Usually this is directly passed to KoRuler (for page-based viewmodes)

Reimplemented from KWViewMode.

Definition at line 574 of file KWViewMode.cpp.

◆ shouldAdjustMargins()

virtual bool KWViewModeText::shouldAdjustMargins ( )
inlinevirtual

Should adjust[LR]Margin() happen (to run the text around frames on top etc.).

Reimplemented from KWViewMode.

Definition at line 281 of file KWViewMode.h.

◆ shouldFormatVertically()

virtual bool KWViewModeText::shouldFormatVertically ( )
inlinevirtual

Should formatVertically() happen (to skip frame bottom, frames on top, etc.).

Reimplemented from KWViewMode.

Definition at line 280 of file KWViewMode.h.

◆ textFrameSet()

KWTextFrameSet * KWViewModeText::textFrameSet ( ) const

Definition at line 455 of file KWViewMode.cpp.

◆ type()

virtual const TQString KWViewModeText::type ( ) const
inlinevirtual

Return the name of the viewmode, used for loading/saving.

Implements KWViewMode.

Definition at line 279 of file KWViewMode.h.

◆ viewPageRect()

virtual TQRect KWViewModeText::viewPageRect ( int pgNum)
inlinevirtual

Return view coord for page rect.

Avoids rounding problems when doing normalToView(zoomedRect)

Implements KWViewMode.

Definition at line 271 of file KWViewMode.h.

◆ viewToNormal()

TQPoint KWViewModeText::viewToNormal ( const TQPoint & vPoint)
virtual

View coord -> normal coord.

Implements KWViewMode.

Definition at line 495 of file KWViewMode.cpp.

Member Data Documentation

◆ OFFSET

const int KWViewModeText::OFFSET = 10
static

hardcoded distance from the left side this viewmode starts its rendering

Definition at line 290 of file KWViewMode.h.


The documentation for this class was generated from the following files: