#include <KWViewMode.h>
Public Member Functions | |
| virtual TQPoint | normalToView (const TQPoint &nPoint)=0 |
| TQRect | normalToView (const TQRect &nRect) |
| virtual TQPoint | viewToNormal (const TQPoint &vPoint)=0 |
| TQRect | viewToNormal (const TQRect &nRect) |
| virtual TQRect | viewPageRect (int pgNum)=0 |
| virtual TQSize | contentsSize ()=0 |
| 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)=0 |
| virtual void | setPagesPerRow (int) |
| virtual int | pagesPerRow () |
| virtual bool | drawSelections () |
| virtual bool | drawFrameBackground () |
| bool | drawFrameBorders () const |
| void | setDrawFrameBorders (bool b) |
| virtual bool | isFrameSetVisible (const KWFrameSet *) |
| virtual bool | shouldFormatVertically () |
| virtual bool | shouldAdjustMargins () |
| virtual bool | hasFrames () |
| virtual bool | hasPages () |
| virtual const TQString | type () const =0 |
| virtual bool | isTextModeFrameset (KWFrameSet *) const |
| KWCanvas * | canvas () const |
Static Public Member Functions | |
| static KWViewMode * | create (const TQString &viewModeType, KWDocument *doc, KWCanvas *canvas) |
Protected Member Functions | |
| 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 | |
| KWDocument * | m_doc |
| KWCanvas * | m_canvas |
| bool | m_drawFrameBorders |
Static Protected Attributes | |
| static const unsigned short | s_shadowOffset = 3 |
Detailed Description
Abstract base class for KWCanvas's view modes.
The 'normal' mode is the WYSIWYG mode ("page mode"), in which pages are one below another. Since frames are in this coordinate system, the view modes other than the normal mode implement a transformation between the normal mode's coordinate system and its own. When drawing, we use normalcoord->viewcoord and when handling mouse clicks we use viewcoord->normalcoord. Note that this all in zoomed (pixel) coordinates (see DESIGN file).
The View Mode is obviously also responsible for drawing pages etc.
Definition at line 47 of file KWViewMode.h.
Constructor & Destructor Documentation
◆ KWViewMode()
|
inlineprotected |
Definition at line 50 of file KWViewMode.h.
◆ ~KWViewMode()
|
inlinevirtual |
Definition at line 54 of file KWViewMode.h.
Member Function Documentation
◆ availableSizeForText()
|
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 in KWViewModeText.
Definition at line 37 of file KWViewMode.cpp.
◆ canvas()
|
inline |
Definition at line 133 of file KWViewMode.h.
◆ contentsSize()
|
pure virtual |
Size of the contents area, in pixels.
Implemented in KWViewModeNormal, KWViewModeEmbedded, KWViewModePreview, and KWViewModeText.
◆ create()
|
static |
Definition at line 154 of file KWViewMode.cpp.
◆ drawBottomShadow()
|
protected |
Definition at line 82 of file KWViewMode.cpp.
◆ drawFrameBackground()
|
inlinevirtual |
Should frame background be drawn? Usually yes, but not for embedded docs with transparent=true.
Reimplemented in KWViewModeEmbedded.
Definition at line 102 of file KWViewMode.h.
◆ drawFrameBorders()
|
inline |
Should we see frame borders? This setting doesn't always come from KWView...
Definition at line 105 of file KWViewMode.h.
◆ drawOnePageBorder()
|
protected |
Draw the border around one page, and clear up the empty space in that page.
- Parameters
-
crect the rect we're interested in painting (in view pixels) pageRect the rect for the page, in view pixels emptySpaceRegion the empty space to clear up inside the page (in view pixels) painter the painter to paint the border on.
Definition at line 44 of file KWViewMode.cpp.
◆ drawRightShadow()
|
protected |
Definition at line 70 of file KWViewMode.cpp.
◆ drawSelections()
|
inlinevirtual |
Should selected text be drawn as such?
Reimplemented in KWViewModePrint, and KWViewModeEmbedded.
Definition at line 99 of file KWViewMode.h.
◆ hasFrames()
|
inlinevirtual |
Does this viewmode know anything about frames?
Reimplemented in KWViewModeText.
Definition at line 119 of file KWViewMode.h.
◆ hasPages()
|
inlinevirtual |
Does this viewmode know anything about pages?
Reimplemented in KWViewModeEmbedded, and KWViewModeText.
Definition at line 122 of file KWViewMode.h.
◆ isFrameSetVisible()
|
inlinevirtual |
Should this frameset be visible in this viewmode? True by default, all are shown.
Reimplemented in KWViewModeText.
Definition at line 109 of file KWViewMode.h.
◆ isTextModeFrameset()
|
inlinevirtual |
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 in KWViewModeText.
Definition at line 129 of file KWViewMode.h.
◆ normalToView() [1/2]
|
pure virtual |
Normal coord -> view coord.
Implemented in KWViewModeNormal, KWViewModeEmbedded, KWViewModePreview, and KWViewModeText.
◆ normalToView() [2/2]
|
inline |
Normal coord -> view coord.
Definition at line 60 of file KWViewMode.h.
◆ pageCorner()
|
virtual |
"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 in KWViewModeText.
Definition at line 92 of file KWViewMode.cpp.
◆ pagesPerRow()
|
inlinevirtual |
Definition at line 96 of file KWViewMode.h.
◆ rulerFrameRect()
|
virtual |
The result of this is passed to setFrameStartEnd for both rulers (after adjustement with pageCorner())
Reimplemented in KWViewModeText.
Definition at line 115 of file KWViewMode.cpp.
◆ setDrawFrameBorders()
|
inline |
Definition at line 106 of file KWViewMode.h.
◆ setPageLayout()
|
virtual |
Called when the page layout is set, or changes.
Usually this is directly passed to KoRuler (for page-based viewmodes)
Reimplemented in KWViewModeText.
Definition at line 147 of file KWViewMode.cpp.
◆ setPagesPerRow()
|
inlinevirtual |
Config option for KWViewModePreview (a bit of a hack)
Reimplemented in KWViewModePreview.
Definition at line 95 of file KWViewMode.h.
◆ shouldAdjustMargins()
|
inlinevirtual |
Should adjust[LR]Margin() happen (to run the text around frames on top etc.)
Reimplemented in KWViewModeText.
Definition at line 116 of file KWViewMode.h.
◆ shouldFormatVertically()
|
inlinevirtual |
Should formatVertically() happen (to skip frame bottom, frames on top, etc.)
Reimplemented in KWViewModeText.
Definition at line 113 of file KWViewMode.h.
◆ type()
|
pure virtual |
Return the name of the viewmode, used for loading/saving.
Implemented in KWViewModeNormal, KWViewModeEmbedded, KWViewModePreview, and KWViewModeText.
◆ viewPageRect()
|
pure virtual |
Return view coord for page rect.
Avoids rounding problems when doing normalToView(zoomedRect)
Implemented in KWViewModeNormal, KWViewModeEmbedded, KWViewModePreview, and KWViewModeText.
◆ viewToNormal() [1/2]
|
pure virtual |
View coord -> normal coord.
Implemented in KWViewModeNormal, KWViewModeEmbedded, KWViewModePreview, and KWViewModeText.
◆ viewToNormal() [2/2]
|
inline |
View coord -> normal coord.
Definition at line 67 of file KWViewMode.h.
Member Data Documentation
◆ m_canvas
|
protected |
Definition at line 150 of file KWViewMode.h.
◆ m_doc
|
protected |
Definition at line 149 of file KWViewMode.h.
◆ m_drawFrameBorders
|
protected |
Definition at line 151 of file KWViewMode.h.
◆ s_shadowOffset
|
staticprotected |
Definition at line 147 of file KWViewMode.h.
The documentation for this class was generated from the following files:
