LibreOffice Module sd (master) 1
|
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 SharedPresenterTextCaret & | GetCaret () 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< SharedPresenterTextParagraph > | maParagraphs |
SharedPresenterTextCaret | mpCaret |
double | mnLeftOffset |
double | mnTopOffset |
bool | mbIsFormatPending |
::std::function< void()> | maTextChangeBroadcaster |
A simple text view that paints text onto a given canvas.
Definition at line 214 of file PresenterTextView.hxx.
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().
|
private |
Definition at line 398 of file PresenterTextView.cxx.
References maParagraphs, maSize, maTextChangeBroadcaster, mbIsFormatPending, and mpFont.
Referenced by GetTotalTextHeight(), and Paint().
const SharedPresenterTextCaret & sdext::presenter::PresenterTextView::GetCaret | ( | ) | const |
Definition at line 374 of file PresenterTextView.cxx.
References mpCaret.
|
private |
Definition at line 379 of file PresenterTextView.cxx.
References GetParagraph().
Referenced by PresenterTextView().
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().
sal_Int32 sdext::presenter::PresenterTextView::GetParagraphCount | ( | ) | const |
Definition at line 413 of file PresenterTextView.cxx.
References maParagraphs.
Referenced by Paint().
double sdext::presenter::PresenterTextView::GetTotalTextHeight | ( | ) |
Definition at line 160 of file PresenterTextView.cxx.
References Format(), maParagraphs, mbIsFormatPending, mpFont, and mxCanvas.
void sdext::presenter::PresenterTextView::MoveCaret | ( | const sal_Int32 | nDistance, |
const sal_Int16 | nTextType | ||
) |
Move the caret forward or backward by character or by word.
nDistance | Should be either -1 or +1 to move caret backwards or forwards, respectively. |
nTextType | Valid values are the css::accessibility::AccessibleTextType constants. |
Definition at line 192 of file PresenterTextView.cxx.
References GetParagraph(), o3tl::make_unsigned(), maParagraphs, and mpCaret.
void sdext::presenter::PresenterTextView::Paint | ( | const css::awt::Rectangle & | rUpdateBox | ) |
Definition at line 274 of file PresenterTextView.cxx.
References sdext::presenter::PresenterGeometryHelper::CreatePolygon(), Format(), GetParagraph(), GetParagraphCount(), maLocation, maParagraphs, maSize, mbIsFormatPending, mnLeftOffset, mnTopOffset, mpCaret, mpFont, mxCanvas, sdext::presenter::PresenterGeometryHelper::Round(), and sdext::presenter::PresenterCanvasHelper::SetDeviceColor().
|
private |
Definition at line 393 of file PresenterTextView.cxx.
References mbIsFormatPending.
void sdext::presenter::PresenterTextView::SetFont | ( | const PresenterTheme::SharedFontDescriptor & | rpFont | ) |
Definition at line 175 of file PresenterTextView.cxx.
References mpFont, and RequestFormat().
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().
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().
void sdext::presenter::PresenterTextView::SetSize | ( | const css::geometry::RealSize2D & | rSize | ) |
Definition at line 154 of file PresenterTextView.cxx.
References maSize, and RequestFormat().
void sdext::presenter::PresenterTextView::SetText | ( | const css::uno::Reference< css::text::XText > & | rxText | ) |
Definition at line 99 of file PresenterTextView.cxx.
References maParagraphs, mpCaret, mpFont, mxBreakIterator, mxCanvas, mxScriptTypeDetector, and RequestFormat().
void sdext::presenter::PresenterTextView::SetTextChangeBroadcaster | ( | const ::std::function< void()> & | rBroadcaster | ) |
Definition at line 136 of file PresenterTextView.cxx.
References maTextChangeBroadcaster.
|
private |
Definition at line 258 of file PresenterTextView.hxx.
Referenced by Paint(), SetLocation(), and SetOffset().
|
private |
Definition at line 261 of file PresenterTextView.hxx.
Referenced by Format(), GetParagraph(), GetParagraphCount(), GetTotalTextHeight(), MoveCaret(), Paint(), SetLocation(), and SetText().
|
private |
Definition at line 259 of file PresenterTextView.hxx.
|
private |
Definition at line 266 of file PresenterTextView.hxx.
Referenced by Format(), and SetTextChangeBroadcaster().
|
private |
Definition at line 265 of file PresenterTextView.hxx.
Referenced by Format(), GetTotalTextHeight(), Paint(), and RequestFormat().
|
private |
Definition at line 263 of file PresenterTextView.hxx.
Referenced by Paint(), SetLocation(), and SetOffset().
|
private |
Definition at line 264 of file PresenterTextView.hxx.
Referenced by Paint(), SetLocation(), and SetOffset().
|
private |
Definition at line 262 of file PresenterTextView.hxx.
Referenced by GetCaret(), MoveCaret(), Paint(), and SetText().
|
private |
Definition at line 260 of file PresenterTextView.hxx.
Referenced by Format(), GetTotalTextHeight(), Paint(), SetFont(), and SetText().
|
private |
Definition at line 256 of file PresenterTextView.hxx.
Referenced by SetText().
|
private |
Definition at line 255 of file PresenterTextView.hxx.
Referenced by GetTotalTextHeight(), Paint(), and SetText().
|
private |
Definition at line 257 of file PresenterTextView.hxx.
Referenced by SetText().