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 const ::std::function<css::awt::Rectangle (
const sal_Int32,
const sal_Int32)>&
45 rCharacterBoundsAccess,
46 const ::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,
96 const SharedPresenterTextCaret& rpCaret);
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);
249 const SharedPresenterTextCaret&
GetCaret()
const;
252 SharedPresenterTextParagraph
GetParagraph (
const sal_Int32 nParagraphIndex)
const;
255 css::uno::Reference<css::rendering::XCanvas>
mxCanvas;
271 const sal_Int32 nParagraphIndex,
272 const sal_Int32 nCharacterIndex)
const;
css::uno::Reference< css::rendering::XCanvas > mxCanvas
sal_Int32 mnLineEndCellIndex
css::accessibility::TextSegment GetTextSegment(const sal_Int32 nOffset, const sal_Int32 nGlobalCharacterIndex, const sal_Int16 nTextType) const
std::shared_ptr< FontDescriptor > SharedFontDescriptor
css::awt::Rectangle maCaretBounds
css::uno::Reference< css::uno::XComponentContext > const & m_xContext
::std::function< void()> maTextChangeBroadcaster
sal_Int32 GetParagraphIndex() const
void SetCaretPosition(const sal_Int32 nPosition) const
sal_Int32 mnLineEndCharacterIndex
PresenterTextCaret(css::uno::Reference< css::uno::XComponentContext > const &xContext, const ::std::function< css::awt::Rectangle(const sal_Int32, const sal_Int32)> &rCharacterBoundsAccess, const ::std::function< void(const css::awt::Rectangle &)> &rInvalidator)
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 GetCaretPosition() const
A portion of a string that encodes one unicode cell.
void ProvideLayoutedLine(const OUString &rsParagraphText, const PresenterTheme::SharedFontDescriptor &rpFont, const sal_Int8 nTextDirection)
css::awt::Rectangle GetCharacterBounds(sal_Int32 nGlobalCharacterIndex, const bool bCaretBox)
const css::awt::Rectangle & GetBounds() const
void SetText(const css::uno::Reference< css::text::XText > &rxText)
::std::vector< sal_Int32 > maWordBoundaries
void SetOffset(const double nLeft, const double nTop)
css::uno::Reference< css::rendering::XTextLayout > mxLayoutedLine
sal_Int32 mnCharacterIndex
Line(const sal_Int32 nLineStartCharacterIndex, const sal_Int32 nLineEndCharacterIndex)
double GetTotalTextHeight() const
SharedPresenterTextCaret mpCaret
const ::std::function< css::awt::Rectangle(const sal_Int32, const sal_Int32)> maCharacterBoundsAccess
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, const SharedPresenterTextCaret &rpCaret)
sal_Int32 GetCharacterIndex() const
sal_Int32 mnCharacterIndex
sal_Int32 GetWordBoundary(const sal_Int32 nLocalCharacterIndex, const sal_Int32 nDistance)
const OUString & GetText() const
sal_Int32 mnCharacterOffset
The index of the first character in this paragraph with respect to the whole text.
css::uno::Reference< css::i18n::XScriptTypeDetector > mxScriptTypeDetector
const SharedPresenterTextCaret & GetCaret() const
css::uno::Sequence< css::geometry::RealRectangle2D > maCellBoxes
void SetupCellArray(const PresenterTheme::SharedFontDescriptor &rpFont)
const sal_Int32 nCellWidth
void Paint(const css::awt::Rectangle &rUpdateBox)
bool IsTextReferencePointLeft() const
css::accessibility::TextSegment CreateTextSegment(sal_Int32 nStartIndex, sal_Int32 nEndIndex) const
Cell(const sal_Int32 nCharacterIndex, const sal_Int32 nCharacterCount, const double nCellWidth)
sal_Int32 mnLineStartCharacterIndex
css::accessibility::TextSegment GetWordTextSegment(const sal_Int32 nOffset, const sal_Int32 nIndex) const
css::awt::Size GetSize() const
const sal_Int32 mnParagraphIndex
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 AddWord(const double nWidth, css::i18n::Boundary &rCurrentLine, const sal_Int32 nWordBoundary, const PresenterTheme::SharedFontDescriptor &rpFont)
css::uno::Reference< css::i18n::XScriptTypeDetector > mxScriptTypeDetector
void SetFont(const PresenterTheme::SharedFontDescriptor &rpFont)
SharedPresenterTextParagraph GetParagraph(const sal_Int32 nParagraphIndex) const
sal_Int8 GetTextDirection() const
css::awt::Rectangle GetCaretBounds(const sal_Int32 nParagraphIndex, const sal_Int32 nCharacterIndex) const
void SetTextChangeBroadcaster(const ::std::function< void()> &rBroadcaster)
std::shared_ptr< PresenterTextCaret > SharedPresenterTextCaret
::std::vector< Cell > maCells
void SetPosition(const sal_Int32 nParagraphIndex, const sal_Int32 nCharacterIndex)
sal_Int32 GetParagraphCount() const
void AddLine(css::i18n::Boundary &rCurrentLine)
void SetLocation(const css::geometry::RealPoint2D &rLocation)
::std::function< void(sal_Int32, sal_Int32, sal_Int32, sal_Int32)> maBroadcaster
::std::vector< Line > maLines
PresenterTheme::SharedFontDescriptor mpFont
css::uno::Reference< css::i18n::XBreakIterator > mxBreakIterator
sal_Int32 mnCharacterCount
void Format(const double nY, const double nWidth, const PresenterTheme::SharedFontDescriptor &rpFont)
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
sal_Int32 mnParagraphIndex
A simple text view that paints text onto a given canvas.
sal_Int32 GetCharacterCount() const
css::awt::Point GetRelativeLocation() const
SharedPresenterTextCaret mpCaret
css::uno::Reference< css::i18n::XBreakIterator > mxBreakIterator
sal_Int32 mnLineStartCellIndex
double GetTotalTextHeight()
const ::std::function< void(const css::awt::Rectangle &)> maInvalidator
void SetCharacterOffset(const sal_Int32 nCharacterOffset)
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)
sal_Unicode GetCharacter(const sal_Int32 nGlobalCharacterIndex) const
std::shared_ptr< PresenterTextParagraph > SharedPresenterTextParagraph
css::geometry::RealSize2D maSize
sal_Int32 mnCaretBlinkTaskId
void SetSize(const css::geometry::RealSize2D &rSize)
::std::vector< SharedPresenterTextParagraph > maParagraphs
void SetOrigin(const double nXOrigin, const double nYOrigin)