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

virtual ~SwPortionHandler ()
 
virtual void Text (TextFrameIndex nLength, PortionType nType)=0
 (empty) destructor More...
 
virtual void Special (TextFrameIndex nLength, const OUString &rText, PortionType nType)=0
 special portion. More...
 
virtual void LineBreak ()=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 45 of file SwPortionHandler.hxx.

Constructor & Destructor Documentation

◆ ~SwPortionHandler()

virtual SwPortionHandler::~SwPortionHandler ( )
inlinevirtual

Definition at line 49 of file SwPortionHandler.hxx.

Member Function Documentation

◆ Finish()

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

Referenced by SwTextFrame::VisitPortions().

◆ LineBreak()

virtual void SwPortionHandler::LineBreak ( )
pure virtual

line break.

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

Implemented in SwAccessiblePortionData.

Referenced by SwTextFrame::VisitPortions().

◆ Skip()

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

Referenced by SwTextFrame::VisitPortions().

◆ Special()

virtual void SwPortionHandler::Special ( TextFrameIndex  nLength,
const OUString &  rText,
PortionType  nType 
)
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 type of this portion

Implemented in SwAccessiblePortionData.

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

◆ Text()

virtual void SwPortionHandler::Text ( TextFrameIndex  nLength,
PortionType  nType 
)
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
nTypetype of this portion

Implemented in SwAccessiblePortionData.

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


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