20#ifndef INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERTEXTVIEW_HXX
21#define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERTEXTVIEW_HXX
24#include <com/sun/star/accessibility/TextSegment.hpp>
25#include <com/sun/star/awt/Point.hpp>
26#include <com/sun/star/awt/Size.hpp>
27#include <com/sun/star/geometry/RealPoint2D.hpp>
28#include <com/sun/star/geometry/RealSize2D.hpp>
29#include <com/sun/star/i18n/XBreakIterator.hpp>
30#include <com/sun/star/i18n/XScriptTypeDetector.hpp>
31#include <com/sun/star/rendering/XCanvas.hpp>
32#include <com/sun/star/text/XText.hpp>
33#include <com/sun/star/uno/XComponentContext.hpp>
43 css::uno::Reference<css::uno::XComponentContext>
const& xContext,
44 ::std::function<css::awt::Rectangle (
const sal_Int32,
const sal_Int32)>
45 aCharacterBoundsAccess,
46 ::std::function<
void (
const css::awt::Rectangle&)>
56 const sal_Int32 nParagraphIndex,
57 const sal_Int32 nCharacterIndex);
67 const ::std::function<
void (sal_Int32,sal_Int32,sal_Int32,sal_Int32)>& rBroadcaster);
69 const css::awt::Rectangle&
GetBounds()
const;
72 css::uno::Reference<css::uno::XComponentContext>
const&
m_xContext;
79 ::std::function<void (sal_Int32,sal_Int32,sal_Int32,sal_Int32)>
maBroadcaster;
92 const sal_Int32 nParagraphIndex,
93 const css::uno::Reference<css::i18n::XBreakIterator>& rxBreakIterator,
94 const css::uno::Reference<css::i18n::XScriptTypeDetector>& rxScriptTypeDetector,
95 const css::uno::Reference<css::text::XTextRange>& rxTextRange,
99 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
100 const css::geometry::RealSize2D& rSize,
102 const css::rendering::ViewState& rViewState,
103 css::rendering::RenderState& rRenderState,
104 const double nTopOffset,
105 const double nClipTop,
106 const double nClipBottom);
113 const OUString&
GetText()
const;
115 const sal_Int32 nOffset,
116 const sal_Int32 nGlobalCharacterIndex,
117 const sal_Int16 nTextType)
const;
119 const sal_Int32 nOffset,
120 const sal_Int32
nIndex)
const;
122 sal_Int32 nStartIndex,
123 sal_Int32 nEndIndex)
const;
125 sal_Int32 nGlobalCharacterIndex,
126 const bool bCaretBox);
134 const sal_Int32 nLocalCharacterIndex,
135 const sal_Int32 nDistance);
138 void SetOrigin (
const double nXOrigin,
const double nYOrigin);
140 css::awt::Size
GetSize()
const;
155 Cell (
const sal_Int32 nCharacterIndex,
const sal_Int32 nCharacterCount,
const double nCellWidth);
164 Line (
const sal_Int32 nLineStartCharacterIndex,
const sal_Int32 nLineEndCharacterIndex);
175 const OUString& rsParagraphText,
202 css::i18n::Boundary& rCurrentLine,
203 const sal_Int32 nWordBoundary,
206 css::i18n::Boundary& rCurrentLine);
219 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
220 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
221 const ::std::function<
void (
const css::awt::Rectangle&)>& rInvalidator);
222 void SetText (
const css::uno::Reference<css::text::XText>& rxText);
225 void SetLocation (
const css::geometry::RealPoint2D& rLocation);
226 void SetSize (
const css::geometry::RealSize2D& rSize);
244 const sal_Int32 nDistance,
245 const sal_Int16 nTextType);
247 void Paint (
const css::awt::Rectangle& rUpdateBox);
255 css::uno::Reference<css::rendering::XCanvas>
mxCanvas;
271 const sal_Int32 nParagraphIndex,
272 const sal_Int32 nCharacterIndex)
const;
const css::awt::Rectangle & GetBounds() const
sal_Int32 mnParagraphIndex
css::uno::Reference< css::uno::XComponentContext > const & m_xContext
sal_Int32 mnCharacterIndex
sal_Int32 GetParagraphIndex() const
void SetCaretMotionBroadcaster(const ::std::function< void(sal_Int32, sal_Int32, sal_Int32, sal_Int32)> &rBroadcaster)
Set a (possibly empty) functor that broadcasts changes of the caret position.
sal_Int32 GetCharacterIndex() const
css::awt::Rectangle maCaretBounds
const ::std::function< css::awt::Rectangle(const sal_Int32, const sal_Int32)> maCharacterBoundsAccess
void SetPosition(const sal_Int32 nParagraphIndex, const sal_Int32 nCharacterIndex)
sal_Int32 mnCaretBlinkTaskId
PresenterTextCaret(css::uno::Reference< css::uno::XComponentContext > const &xContext, ::std::function< css::awt::Rectangle(const sal_Int32, const sal_Int32)> aCharacterBoundsAccess, ::std::function< void(const css::awt::Rectangle &)> aInvalidator)
::std::function< void(sal_Int32, sal_Int32, sal_Int32, sal_Int32)> maBroadcaster
const ::std::function< void(const css::awt::Rectangle &)> maInvalidator
A portion of a string that encodes one unicode cell.
sal_Int32 mnCharacterCount
Cell(const sal_Int32 nCharacterIndex, const sal_Int32 nCharacterCount, const double nCellWidth)
sal_Int32 mnCharacterIndex
sal_Int32 mnLineEndCharacterIndex
sal_Int32 mnLineStartCellIndex
sal_Int32 mnLineStartCharacterIndex
Line(const sal_Int32 nLineStartCharacterIndex, const sal_Int32 nLineEndCharacterIndex)
css::uno::Sequence< css::geometry::RealRectangle2D > maCellBoxes
css::uno::Reference< css::rendering::XTextLayout > mxLayoutedLine
sal_Int32 mnLineEndCellIndex
void ProvideLayoutedLine(const OUString &rsParagraphText, const PresenterTheme::SharedFontDescriptor &rpFont, const sal_Int8 nTextDirection)
sal_Unicode GetCharacter(const sal_Int32 nGlobalCharacterIndex) const
void SetCaretPosition(const sal_Int32 nPosition) const
css::accessibility::TextSegment GetTextSegment(const sal_Int32 nOffset, const sal_Int32 nGlobalCharacterIndex, const sal_Int16 nTextType) const
double GetTotalTextHeight() const
css::uno::Reference< css::i18n::XScriptTypeDetector > mxScriptTypeDetector
void AddLine(css::i18n::Boundary &rCurrentLine)
void SetupCellArray(const PresenterTheme::SharedFontDescriptor &rpFont)
css::awt::Point GetRelativeLocation() const
sal_Int8 GetTextDirection() const
sal_Int32 mnCharacterOffset
The index of the first character in this paragraph with respect to the whole text.
::std::vector< Cell > maCells
sal_Int32 GetWordBoundary(const sal_Int32 nLocalCharacterIndex, const sal_Int32 nDistance)
sal_Int32 GetCaretPosition() const
const OUString & GetText() const
sal_Int32 GetCharacterCount() const
css::accessibility::TextSegment CreateTextSegment(sal_Int32 nStartIndex, sal_Int32 nEndIndex) const
void SetCharacterOffset(const sal_Int32 nCharacterOffset)
css::awt::Size GetSize() const
PresenterTextParagraph(const sal_Int32 nParagraphIndex, const css::uno::Reference< css::i18n::XBreakIterator > &rxBreakIterator, const css::uno::Reference< css::i18n::XScriptTypeDetector > &rxScriptTypeDetector, const css::uno::Reference< css::text::XTextRange > &rxTextRange, SharedPresenterTextCaret xCaret)
css::uno::Reference< css::i18n::XBreakIterator > mxBreakIterator
void AddWord(const double nWidth, css::i18n::Boundary &rCurrentLine, const sal_Int32 nWordBoundary, const PresenterTheme::SharedFontDescriptor &rpFont)
css::awt::Rectangle GetCharacterBounds(sal_Int32 nGlobalCharacterIndex, const bool bCaretBox)
const sal_Int32 mnParagraphIndex
::std::vector< sal_Int32 > maWordBoundaries
bool IsTextReferencePointLeft() const
css::accessibility::TextSegment GetWordTextSegment(const sal_Int32 nOffset, const sal_Int32 nIndex) const
SharedPresenterTextCaret mpCaret
void SetOrigin(const double nXOrigin, const double nYOrigin)
::std::vector< Line > maLines
void Paint(const css::uno::Reference< css::rendering::XCanvas > &rxCanvas, const css::geometry::RealSize2D &rSize, const PresenterTheme::SharedFontDescriptor &rpFont, const css::rendering::ViewState &rViewState, css::rendering::RenderState &rRenderState, const double nTopOffset, const double nClipTop, const double nClipBottom)
void Format(const double nY, const double nWidth, const PresenterTheme::SharedFontDescriptor &rpFont)
A simple text view that paints text onto a given canvas.
void MoveCaret(const sal_Int32 nDistance, const sal_Int16 nTextType)
Move the caret forward or backward by character or by word.
css::geometry::RealPoint2D maLocation
double GetTotalTextHeight()
void SetSize(const css::geometry::RealSize2D &rSize)
css::uno::Reference< css::i18n::XBreakIterator > mxBreakIterator
sal_Int32 GetParagraphCount() const
css::uno::Reference< css::i18n::XScriptTypeDetector > mxScriptTypeDetector
::std::vector< SharedPresenterTextParagraph > maParagraphs
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)
::std::function< void()> maTextChangeBroadcaster
void SetText(const css::uno::Reference< css::text::XText > &rxText)
const SharedPresenterTextCaret & GetCaret() const
void SetLocation(const css::geometry::RealPoint2D &rLocation)
void Paint(const css::awt::Rectangle &rUpdateBox)
SharedPresenterTextParagraph GetParagraph(const sal_Int32 nParagraphIndex) const
PresenterTheme::SharedFontDescriptor mpFont
SharedPresenterTextCaret mpCaret
void SetOffset(const double nLeft, const double nTop)
void SetFont(const PresenterTheme::SharedFontDescriptor &rpFont)
css::geometry::RealSize2D maSize
css::awt::Rectangle GetCaretBounds(const sal_Int32 nParagraphIndex, const sal_Int32 nCharacterIndex) const
css::uno::Reference< css::rendering::XCanvas > mxCanvas
void SetTextChangeBroadcaster(const ::std::function< void()> &rBroadcaster)
std::shared_ptr< FontDescriptor > SharedFontDescriptor
const sal_Int32 nCellWidth
std::shared_ptr< PresenterTextParagraph > SharedPresenterTextParagraph
std::shared_ptr< PresenterTextCaret > SharedPresenterTextCaret