LibreOffice Module sw (master) 1
|
The SwPortionHandler interface implements a visitor for the layout engine's text portions. More...
#include <SwPortionHandler.hxx>
Public Member Functions | |
virtual | ~SwPortionHandler () |
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... | |
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.
|
inlinevirtual |
Definition at line 49 of file SwPortionHandler.hxx.
|
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().
|
pure virtual |
line break.
This method is called whenever a line break in the layout occurs.
Implemented in SwAccessiblePortionData.
Referenced by SwTextFrame::VisitPortions().
|
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.
nLength | number of 'view string' characters to be skipped |
Implemented in SwAccessiblePortionData.
Referenced by SwTextFrame::VisitPortions().
|
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.
nLength | length of this portion in the view string |
nType | text which is painted on-screen |
nHeight | type of this portion |
nWidth | font height of the painted text |
pFont | width of this portion font 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(), and SwIsoToxPortion::HandlePortion().
|
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.
nLength | length of this portion in the view string |
nHeight | type of this portion |
nWidth | height of this portion width of this portion |
Implemented in SwAccessiblePortionData.
Referenced by SwMultiPortion::HandlePortion(), SwBreakPortion::HandlePortion(), SwTabPortion::HandlePortion(), SwTextPortion::HandlePortion(), and SwHolePortion::HandlePortion().