LibreOffice Module sd (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sdext::presenter::PresenterTextView Class Reference

A simple text view that paints text onto a given canvas. More...

#include <PresenterTextView.hxx>

Public Member Functions

 PresenterTextView (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::rendering::XCanvas > &rxCanvas, const ::std::function< void(const css::awt::Rectangle &)> &rInvalidator)
 
void SetText (const css::uno::Reference< css::text::XText > &rxText)
 
void SetTextChangeBroadcaster (const ::std::function< void()> &rBroadcaster)
 
void SetLocation (const css::geometry::RealPoint2D &rLocation)
 
void SetSize (const css::geometry::RealSize2D &rSize)
 
double GetTotalTextHeight ()
 
void SetFont (const PresenterTheme::SharedFontDescriptor &rpFont)
 
void SetOffset (const double nLeft, const double nTop)
 
void MoveCaret (const sal_Int32 nDistance, const sal_Int16 nTextType)
 Move the caret forward or backward by character or by word. More...
 
void Paint (const css::awt::Rectangle &rUpdateBox)
 
const SharedPresenterTextCaretGetCaret () const
 
sal_Int32 GetParagraphCount () const
 
SharedPresenterTextParagraph GetParagraph (const sal_Int32 nParagraphIndex) const
 

Private Member Functions

void RequestFormat ()
 
void Format ()
 
css::awt::Rectangle GetCaretBounds (const sal_Int32 nParagraphIndex, const sal_Int32 nCharacterIndex) const
 

Private Attributes

css::uno::Reference< css::rendering::XCanvas > mxCanvas
 
css::uno::Reference< css::i18n::XBreakIterator > mxBreakIterator
 
css::uno::Reference< css::i18n::XScriptTypeDetector > mxScriptTypeDetector
 
css::geometry::RealPoint2D maLocation
 
css::geometry::RealSize2D maSize
 
PresenterTheme::SharedFontDescriptor mpFont
 
::std::vector< SharedPresenterTextParagraphmaParagraphs
 
SharedPresenterTextCaret mpCaret
 
double mnLeftOffset
 
double mnTopOffset
 
bool mbIsFormatPending
 
::std::function< void()> maTextChangeBroadcaster
 

Detailed Description

A simple text view that paints text onto a given canvas.

Definition at line 214 of file PresenterTextView.hxx.

Constructor & Destructor Documentation

◆ PresenterTextView()

sdext::presenter::PresenterTextView::PresenterTextView ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const css::uno::Reference< css::rendering::XCanvas > &  rxCanvas,
const ::std::function< void(const css::awt::Rectangle &)> &  rInvalidator 
)

Definition at line 66 of file PresenterTextView.cxx.

References GetCaretBounds(), and make_shared().

Member Function Documentation

◆ Format()

void sdext::presenter::PresenterTextView::Format ( )
private

Definition at line 398 of file PresenterTextView.cxx.

References maParagraphs, maSize, maTextChangeBroadcaster, mbIsFormatPending, and mpFont.

Referenced by GetTotalTextHeight(), and Paint().

◆ GetCaret()

const SharedPresenterTextCaret & sdext::presenter::PresenterTextView::GetCaret ( ) const

Definition at line 374 of file PresenterTextView.cxx.

References mpCaret.

◆ GetCaretBounds()

awt::Rectangle sdext::presenter::PresenterTextView::GetCaretBounds ( const sal_Int32  nParagraphIndex,
const sal_Int32  nCharacterIndex 
) const
private

Definition at line 379 of file PresenterTextView.cxx.

References GetParagraph().

Referenced by PresenterTextView().

◆ GetParagraph()

SharedPresenterTextParagraph sdext::presenter::PresenterTextView::GetParagraph ( const sal_Int32  nParagraphIndex) const

Definition at line 418 of file PresenterTextView.cxx.

References o3tl::make_unsigned(), and maParagraphs.

Referenced by GetCaretBounds(), MoveCaret(), and Paint().

◆ GetParagraphCount()

sal_Int32 sdext::presenter::PresenterTextView::GetParagraphCount ( ) const

Definition at line 413 of file PresenterTextView.cxx.

References maParagraphs.

Referenced by Paint().

◆ GetTotalTextHeight()

double sdext::presenter::PresenterTextView::GetTotalTextHeight ( )

Definition at line 160 of file PresenterTextView.cxx.

References Format(), maParagraphs, mbIsFormatPending, mpFont, and mxCanvas.

◆ MoveCaret()

void sdext::presenter::PresenterTextView::MoveCaret ( const sal_Int32  nDistance,
const sal_Int16  nTextType 
)

Move the caret forward or backward by character or by word.

Parameters
nDistanceShould be either -1 or +1 to move caret backwards or forwards, respectively.
nTextTypeValid values are the css::accessibility::AccessibleTextType constants.

Definition at line 192 of file PresenterTextView.cxx.

References GetParagraph(), o3tl::make_unsigned(), maParagraphs, and mpCaret.

◆ Paint()

void sdext::presenter::PresenterTextView::Paint ( const css::awt::Rectangle &  rUpdateBox)

◆ RequestFormat()

void sdext::presenter::PresenterTextView::RequestFormat ( )
private

Definition at line 393 of file PresenterTextView.cxx.

References mbIsFormatPending.

Referenced by SetFont(), SetSize(), and SetText().

◆ SetFont()

void sdext::presenter::PresenterTextView::SetFont ( const PresenterTheme::SharedFontDescriptor rpFont)

Definition at line 175 of file PresenterTextView.cxx.

References mpFont, and RequestFormat().

◆ SetLocation()

void sdext::presenter::PresenterTextView::SetLocation ( const css::geometry::RealPoint2D &  rLocation)

Definition at line 142 of file PresenterTextView.cxx.

References maLocation, maParagraphs, mnLeftOffset, and mnTopOffset.

Referenced by SetOffset().

◆ SetOffset()

void sdext::presenter::PresenterTextView::SetOffset ( const double  nLeft,
const double  nTop 
)

Definition at line 181 of file PresenterTextView.cxx.

References maLocation, mnLeftOffset, mnTopOffset, and SetLocation().

◆ SetSize()

void sdext::presenter::PresenterTextView::SetSize ( const css::geometry::RealSize2D &  rSize)

Definition at line 154 of file PresenterTextView.cxx.

References maSize, and RequestFormat().

◆ SetText()

void sdext::presenter::PresenterTextView::SetText ( const css::uno::Reference< css::text::XText > &  rxText)

◆ SetTextChangeBroadcaster()

void sdext::presenter::PresenterTextView::SetTextChangeBroadcaster ( const ::std::function< void()> &  rBroadcaster)

Definition at line 136 of file PresenterTextView.cxx.

References maTextChangeBroadcaster.

Member Data Documentation

◆ maLocation

css::geometry::RealPoint2D sdext::presenter::PresenterTextView::maLocation
private

Definition at line 258 of file PresenterTextView.hxx.

Referenced by Paint(), SetLocation(), and SetOffset().

◆ maParagraphs

::std::vector<SharedPresenterTextParagraph> sdext::presenter::PresenterTextView::maParagraphs
private

◆ maSize

css::geometry::RealSize2D sdext::presenter::PresenterTextView::maSize
private

Definition at line 259 of file PresenterTextView.hxx.

Referenced by Format(), Paint(), and SetSize().

◆ maTextChangeBroadcaster

::std::function<void ()> sdext::presenter::PresenterTextView::maTextChangeBroadcaster
private

Definition at line 266 of file PresenterTextView.hxx.

Referenced by Format(), and SetTextChangeBroadcaster().

◆ mbIsFormatPending

bool sdext::presenter::PresenterTextView::mbIsFormatPending
private

Definition at line 265 of file PresenterTextView.hxx.

Referenced by Format(), GetTotalTextHeight(), Paint(), and RequestFormat().

◆ mnLeftOffset

double sdext::presenter::PresenterTextView::mnLeftOffset
private

Definition at line 263 of file PresenterTextView.hxx.

Referenced by Paint(), SetLocation(), and SetOffset().

◆ mnTopOffset

double sdext::presenter::PresenterTextView::mnTopOffset
private

Definition at line 264 of file PresenterTextView.hxx.

Referenced by Paint(), SetLocation(), and SetOffset().

◆ mpCaret

SharedPresenterTextCaret sdext::presenter::PresenterTextView::mpCaret
private

Definition at line 262 of file PresenterTextView.hxx.

Referenced by GetCaret(), MoveCaret(), Paint(), and SetText().

◆ mpFont

PresenterTheme::SharedFontDescriptor sdext::presenter::PresenterTextView::mpFont
private

Definition at line 260 of file PresenterTextView.hxx.

Referenced by Format(), GetTotalTextHeight(), Paint(), SetFont(), and SetText().

◆ mxBreakIterator

css::uno::Reference<css::i18n::XBreakIterator> sdext::presenter::PresenterTextView::mxBreakIterator
private

Definition at line 256 of file PresenterTextView.hxx.

Referenced by SetText().

◆ mxCanvas

css::uno::Reference<css::rendering::XCanvas> sdext::presenter::PresenterTextView::mxCanvas
private

Definition at line 255 of file PresenterTextView.hxx.

Referenced by GetTotalTextHeight(), Paint(), and SetText().

◆ mxScriptTypeDetector

css::uno::Reference<css::i18n::XScriptTypeDetector> sdext::presenter::PresenterTextView::mxScriptTypeDetector
private

Definition at line 257 of file PresenterTextView.hxx.

Referenced by SetText().


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