LibreOffice Module svtools (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SvtScriptedTextHelper Class Referencefinal

This class provides drawing text with different script types on any output devices. More...

#include <scriptedtext.hxx>

Public Member Functions

 SvtScriptedTextHelper (OutputDevice &_rOutDevice)
 Constructor sets an output device and no fonts. More...
 
 SvtScriptedTextHelper (const SvtScriptedTextHelper &_rCopy)
 Copy constructor. More...
 
 ~SvtScriptedTextHelper ()
 Destructor. More...
 
void SetFonts (vcl::Font const *_pLatinFont, vcl::Font const *_pAsianFont, vcl::Font const *_pCmplxFont)
 Sets new fonts and recalculates the text width. More...
 
void SetDefaultFont ()
 Sets the default font of the current output device to all script types. More...
 
void SetText (const OUString &_rText, const css::uno::Reference< css::i18n::XBreakIterator > &_xBreakIter)
 Sets a new text and calculates all script breaks and the text width. More...
 
const SizeGetTextSize () const
 Returns a size struct containing the width and height of the text in the current output device. More...
 
void DrawText (const Point &_rPos)
 Draws the text in the current output device. More...
 

Private Member Functions

SvtScriptedTextHelperoperator= (const SvtScriptedTextHelper &)=delete
 Implementation of class functionality. More...
 

Private Attributes

std::unique_ptr< SvtScriptedTextHelper_ImplmpImpl
 

Detailed Description

This class provides drawing text with different script types on any output devices.

Definition at line 40 of file scriptedtext.hxx.

Constructor & Destructor Documentation

◆ SvtScriptedTextHelper() [1/2]

SvtScriptedTextHelper::SvtScriptedTextHelper ( OutputDevice _rOutDevice)

Constructor sets an output device and no fonts.

Parameters
_rOutDeviceA reference to an output device.

Definition at line 278 of file scriptedtext.cxx.

◆ SvtScriptedTextHelper() [2/2]

SvtScriptedTextHelper::SvtScriptedTextHelper ( const SvtScriptedTextHelper _rCopy)

Copy constructor.

Definition at line 283 of file scriptedtext.cxx.

◆ ~SvtScriptedTextHelper()

SvtScriptedTextHelper::~SvtScriptedTextHelper ( )

Destructor.

Definition at line 288 of file scriptedtext.cxx.

Member Function Documentation

◆ DrawText()

void SvtScriptedTextHelper::DrawText ( const Point _rPos)

Draws the text in the current output device.

Parameters
_rPosThe position of the top left edge of the text.

Definition at line 312 of file scriptedtext.cxx.

References mpImpl.

◆ GetTextSize()

const Size & SvtScriptedTextHelper::GetTextSize ( ) const

Returns a size struct containing the width and height of the text in the current output device.

Returns
A size struct with the text dimensions.

Definition at line 307 of file scriptedtext.cxx.

References mpImpl.

◆ operator=()

SvtScriptedTextHelper & SvtScriptedTextHelper::operator= ( const SvtScriptedTextHelper )
privatedelete

Implementation of class functionality.

References DrawText, GetTextSize(), and SetText().

◆ SetDefaultFont()

void SvtScriptedTextHelper::SetDefaultFont ( )

Sets the default font of the current output device to all script types.

Definition at line 297 of file scriptedtext.cxx.

References mpImpl.

◆ SetFonts()

void SvtScriptedTextHelper::SetFonts ( vcl::Font const *  _pLatinFont,
vcl::Font const *  _pAsianFont,
vcl::Font const *  _pCmplxFont 
)

Sets new fonts and recalculates the text width.

Parameters
_pLatinFontThe font for latin characters.
_pAsianFontThe font for asian characters.
_pCmplxFontThe font for complex text layout.

Definition at line 292 of file scriptedtext.cxx.

References mpImpl.

◆ SetText()

void SvtScriptedTextHelper::SetText ( const OUString &  _rText,
const css::uno::Reference< css::i18n::XBreakIterator > &  _xBreakIter 
)

Sets a new text and calculates all script breaks and the text width.

Parameters
_rTextThe new text.
_xBreakIterThe break iterator for iterating through the script portions.

Definition at line 302 of file scriptedtext.cxx.

References mpImpl.

Member Data Documentation

◆ mpImpl

std::unique_ptr<SvtScriptedTextHelper_Impl> SvtScriptedTextHelper::mpImpl
private

Definition at line 43 of file scriptedtext.hxx.

Referenced by DrawText(), GetTextSize(), SetDefaultFont(), SetFonts(), and SetText().


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