LibreOffice Module sw (master)  1
Public Member Functions | List of all members
SwPortionHandler Class Referenceabstract

The SwPortionHandler interface implements a visitor for the layout engine's text portions. More...

#include <SwPortionHandler.hxx>

Inheritance diagram for SwPortionHandler:
[legend]

Public Member Functions

 SwPortionHandler ()
 
virtual ~SwPortionHandler ()
 (empty) constructor More...
 
virtual void Text (TextFrameIndex nLength, PortionType nType, sal_Int32 nHeight=0, sal_Int32 nWidth=0)=0
 (empty) destructor More...
 
virtual void Special (TextFrameIndex nLength, const OUString &rText, PortionType nType, sal_Int32 nHeight=0, sal_Int32 nWidth=0, const SwFont *pFont=nullptr)=0
 special portion. More...
 
virtual void LineBreak (sal_Int32 nWidth)=0
 line break. More...
 
virtual void Skip (TextFrameIndex nLength)=0
 skip characters. More...
 
virtual void Finish ()=0
 end of paragraph. More...
 

Detailed Description

The SwPortionHandler interface implements a visitor for the layout engine's text portions.

This can be used to gather information of the on-screen representation of a single paragraph.

For each text portion, one of the methods text(...) or special(...) is called, depending on whether it is a 'normal' run of text, or any other portion. Additionally, the linebreak() method is called once at the end of every on-screen line.

All parameters relate to the 'view string', which is the text string held by the sequence of all corresponding SwTextFrames.

The SwPortionHandler can be used with the SwTextFrame::VisitPortions(...) method.

Definition at line 44 of file SwPortionHandler.hxx.

Constructor & Destructor Documentation

SwPortionHandler::SwPortionHandler ( )
inline

Definition at line 48 of file SwPortionHandler.hxx.

virtual SwPortionHandler::~SwPortionHandler ( )
inlinevirtual

(empty) constructor

Definition at line 50 of file SwPortionHandler.hxx.

Member Function Documentation

virtual void SwPortionHandler::Finish ( )
pure virtual

end of paragraph.

This method is to be called when all the paragraph's portions have been processed.

Implemented in XmlPortionDumper, and SwAccessiblePortionData.

Referenced by SwTextFrame::VisitPortions().

virtual void SwPortionHandler::LineBreak ( sal_Int32  nWidth)
pure virtual

line break.

This method is called whenever a line break in the layout occurs.

Implemented in XmlPortionDumper, and SwAccessiblePortionData.

Referenced by SwTextFrame::VisitPortions().

virtual void SwPortionHandler::Skip ( TextFrameIndex  nLength)
pure virtual

skip characters.

The SwTextFrame may only display partially display a certain paragraph (e.g. when the paragraph is split across multiple pages). In this case, the Skip() method must be called to inform the portion handler to ignore a certain run of characters in the 'view string'. Skip(), if used at all, must be called before any of the other methods is called. Calling Skip() between portions is not allowed.

Parameters
nLengthnumber of 'view string' characters to be skipped

Implemented in XmlPortionDumper, and SwAccessiblePortionData.

Referenced by SwTextFrame::VisitPortions().

virtual void SwPortionHandler::Special ( TextFrameIndex  nLength,
const OUString &  rText,
PortionType  nType,
sal_Int32  nHeight = 0,
sal_Int32  nWidth = 0,
const SwFont pFont = nullptr 
)
pure virtual

special portion.

This method is called for every non-text portion. The parameters describe the length of the corresponding characters in the view string (often 0 or 1), the text which is displayed, and the type of the portion.

Parameters
nLengthlength of this portion in the view string
nTypetext which is painted on-screen
nHeighttype of this portion
nWidthfont height of the painted text
pFontwidth of this portion font of this portion

Implemented in XmlPortionDumper, and SwAccessiblePortionData.

Referenced by SwHyphPortion::HandlePortion(), SwExpandPortion::HandlePortion(), SwIsoRefPortion::HandlePortion(), SwIsoToxPortion::HandlePortion(), SwHyphStrPortion::HandlePortion(), SwBlankPortion::HandlePortion(), SwSoftHyphPortion::HandlePortion(), SwQuoVadisPortion::HandlePortion(), SwFieldPortion::HandlePortion(), and SwLinePortion::HandlePortion().

virtual void SwPortionHandler::Text ( TextFrameIndex  nLength,
PortionType  nType,
sal_Int32  nHeight = 0,
sal_Int32  nWidth = 0 
)
pure virtual

(empty) destructor

text portion. A run of nLength characters from the view string, that contains no special characters like embedded fields, etc. Thus, the on-screen text of this portion corresponds exactly to the corresponding characters in the view string.

Parameters
nLengthlength of this portion in the view string
nHeighttype of this portion
nWidthheight of this portion width of this portion

Implemented in XmlPortionDumper, and SwAccessiblePortionData.

Referenced by SwTabPortion::HandlePortion(), SwBreakPortion::HandlePortion(), SwTextPortion::HandlePortion(), SwHolePortion::HandlePortion(), and SwMultiPortion::HandlePortion().


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