19#ifndef INCLUDED_SW_SOURCE_CORE_ACCESS_ACCPARA_HXX
20#define INCLUDED_SW_SOURCE_CORE_ACCESS_ACCPARA_HXX
23#include <com/sun/star/accessibility/AccessibleScrollType.hpp>
24#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
25#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
26#include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
27#include <com/sun/star/accessibility/XAccessibleTextMarkup.hpp>
28#include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp>
29#include <com/sun/star/accessibility/XAccessibleTextSelection.hpp>
30#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
31#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
33#include <unordered_map>
45 namespace i18n {
struct Boundary; }
47 namespace style {
struct TabStop; }
50typedef std::unordered_map< OUString,
56 public css::accessibility::XAccessibleEditableText,
57 public css::accessibility::XAccessibleSelection,
58 public css::accessibility::XAccessibleHypertext,
59 public css::accessibility::XAccessibleTextMarkup,
60 public css::accessibility::XAccessibleMultiLineText,
61 public css::accessibility::XAccessibleTextAttributes,
62 public css::accessibility::XAccessibleTextSelection,
63 public css::accessibility::XAccessibleExtendedAttributes
124 static bool IsValidChar(sal_Int32 nPos, sal_Int32 nLength);
130 static bool IsValidRange(sal_Int32 nBegin, sal_Int32 nEnd, sal_Int32 nLength);
136 std::swap( nBegin, nEnd );
144 const css::uno::Sequence< OUString >& aRequestedAttributes,
146 const bool bOnlyCharAttrs =
false );
148 const sal_Int32 nIndex,
149 const css::uno::Sequence< OUString >& aRequestedAttributes,
153 const css::uno::Sequence< OUString >& aRequestedAttributes,
157 const sal_Int32 nIndex,
158 std::vector< css::beans::PropertyValue >& rValues );
168 virtual void GetStates( sal_Int64& rStateSet )
override;
198 std::u16string_view text,
201 const OUString& rText,
204 const OUString& rText,
207 std::u16string_view aText,
210 std::u16string_view aText );
214 const OUString& rText,
223 const OUString& rText,
225 sal_Int16 aTextType );
234 inline operator css::accessibility::XAccessibleText *();
244 virtual OUString SAL_CALL
249 virtual css::lang::Locale SAL_CALL
253 virtual css::uno::Reference<
254 css::accessibility::XAccessibleRelationSet> SAL_CALL
259 virtual void SAL_CALL
grabFocus()
override;
267 virtual OUString SAL_CALL
276 virtual css::uno::Sequence< OUString> SAL_CALL
286 const css::uno::Type& aType )
override;
288 virtual void SAL_CALL
acquire( ) noexcept
override
289 { SwAccessibleContext::acquire(); };
291 virtual void SAL_CALL
release( ) noexcept
override
292 { SwAccessibleContext::release(); };
295 virtual css::uno::Sequence< css::uno::Type > SAL_CALL
getTypes( )
override;
302 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL
getCharacterAttributes( sal_Int32 nIndex,
const css::uno::Sequence< OUString >& aRequestedAttributes )
override;
305 virtual sal_Int32 SAL_CALL
getIndexAtPoint(
const css::awt::Point& aPoint )
override;
310 virtual OUString SAL_CALL
getText( )
override;
311 virtual OUString SAL_CALL
getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
override;
312 virtual css::accessibility::TextSegment SAL_CALL
getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType )
override;
313 virtual css::accessibility::TextSegment SAL_CALL
getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType )
override;
314 virtual css::accessibility::TextSegment SAL_CALL
getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType )
override;
315 virtual sal_Bool SAL_CALL
copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
override;
316 virtual sal_Bool SAL_CALL
scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType)
override;
319 virtual sal_Bool SAL_CALL
cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
override;
321 virtual sal_Bool SAL_CALL
deleteText( sal_Int32 nStartIndex, sal_Int32 nEndIndex )
override;
322 virtual sal_Bool SAL_CALL
insertText(
const OUString& sText, sal_Int32 nIndex )
override;
323 virtual sal_Bool SAL_CALL
replaceText( sal_Int32 nStartIndex, sal_Int32 nEndIndex,
const OUString& sReplacement )
override;
324 virtual sal_Bool SAL_CALL
setAttributes( sal_Int32 nStartIndex, sal_Int32 nEndIndex,
const css::uno::Sequence< css::beans::PropertyValue >& aAttributeSet )
override;
329 sal_Int64 nChildIndex )
override;
332 sal_Int64 nChildIndex )
override;
337 sal_Int64 nSelectedChildIndex )
override;
341 sal_Int64 nChildIndex )
override;
345 virtual css::uno::Reference<
346 css::accessibility::XAccessibleHyperlink >
354 virtual css::accessibility::TextSegment SAL_CALL
356 sal_Int32 nTextMarkupType )
override;
358 virtual css::uno::Sequence< css::accessibility::TextSegment > SAL_CALL
360 sal_Int32 nTextMarkupType )
override;
368 virtual sal_Int32 SAL_CALL
addSelection( sal_Int32 selectionIndex, sal_Int32 startOffset, sal_Int32 endOffset)
override;
377 virtual css::accessibility::TextSegment SAL_CALL
380 virtual css::accessibility::TextSegment SAL_CALL
387 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL
getDefaultAttributes(
const css::uno::Sequence< OUString >& aRequestedAttributes )
override;
388 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL
getRunAttributes( sal_Int32 nIndex,
const css::uno::Sequence< OUString >& aRequestedAttributes )
override;
391inline SwAccessibleParagraph::operator css::accessibility::XAccessibleText *()
393 return static_cast< css::accessibility::XAccessibleEditableText *
>( this );
constexpr OUStringLiteral sServiceName
std::unordered_map< OUString, css::beans::PropertyValue > tAccParaPropValMap
virtual sal_Int32 SAL_CALL getSelectedPortionCount() override
bool GetWordBoundary(css::i18n::Boundary &rBound, const OUString &rText, sal_Int32 nPos)
std::unique_ptr< SwParaChangeTrackingInfo > mpParaChangeTrackInfo
virtual sal_Int32 SAL_CALL getForeground() override
virtual sal_Bool SAL_CALL setText(const OUString &sText) override
virtual sal_Bool SAL_CALL insertText(const OUString &sText, sal_Int32 nIndex) override
static bool IsValidRange(sal_Int32 nBegin, sal_Int32 nEnd, sal_Int32 nLength)
virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex(sal_Int32 nIndex, sal_Int16 aTextType) override
std::unique_ptr< SwAccessiblePortionData > m_pPortionData
bool GetCharBoundary(css::i18n::Boundary &rBound, std::u16string_view text, sal_Int32 nPos)
sal_Int32 m_nHeadingLevel
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
static void OrderRange(sal_Int32 &nBegin, sal_Int32 &nEnd)
virtual void GetStates(sal_Int64 &rStateSet) override
static OUString GetDescription()
virtual void InvalidateContent_(bool bVisibleDataFired) override
virtual sal_Bool SAL_CALL scrollToPosition(const css::awt::Point &aPoint, sal_Bool isLeftTop) override
static bool GetParagraphBoundary(css::i18n::Boundary &rBound, std::u16string_view aText)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex) override
OUString GetFieldTypeNameAtIndex(sal_Int32 nIndex)
virtual sal_Bool SAL_CALL cutText(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
virtual sal_Int32 SAL_CALL getSelectionStart() override
rtl::Reference< SwXTextPortion > CreateUnoPortion(sal_Int32 nStart, sal_Int32 nEnd)
virtual void InvalidateCursorPos_() override
virtual sal_Bool SAL_CALL setCaretPosition(sal_Int32 nIndex) override
virtual sal_Int32 SAL_CALL addSelection(sal_Int32 selectionIndex, sal_Int32 startOffset, sal_Int32 endOffset) override
css::uno::Sequence< css::style::TabStop > GetCurrentTabStop(sal_Int32 nIndex)
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
virtual sal_Bool SAL_CALL replaceText(sal_Int32 nStartIndex, sal_Int32 nEndIndex, const OUString &sReplacement) override
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int64 nChildIndex) override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes(sal_Int32 nIndex, const css::uno::Sequence< OUString > &aRequestedAttributes) override
virtual sal_Int32 SAL_CALL getBackground() override
bool GetSentenceBoundary(css::i18n::Boundary &rBound, const OUString &rText, sal_Int32 nPos)
virtual sal_Int32 SAL_CALL getLineNumberAtIndex(sal_Int32 nIndex) override
std::unique_ptr< SwAccessibleHyperTextData > m_pHyperTextData
virtual sal_Bool SAL_CALL pasteText(sal_Int32 nIndex) override
void ExecuteAtViewShell(sal_uInt16 nSlot)
virtual OUString SAL_CALL getText() override
SwAccessibleSelectionHelper m_aSelectionHelper
virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex(sal_Int32 nIndex, sal_Int16 aTextType) override
static bool IsValidPosition(sal_Int32 nPos, sal_Int32 nLength)
virtual bool HasCursor() override
virtual sal_Bool SAL_CALL scrollSubstringTo(sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override
bool GetGlyphBoundary(css::i18n::Boundary &rBound, const OUString &rText, sal_Int32 nPos)
virtual sal_Bool SAL_CALL setAttributes(sal_Int32 nStartIndex, sal_Int32 nEndIndex, const css::uno::Sequence< css::beans::PropertyValue > &aAttributeSet) override
SwAccessiblePortionData & GetPortionData()
virtual OUString SAL_CALL getAccessibleDescription() override
sal_Int32 GetRealHeadingLevel()
virtual css::lang::Locale SAL_CALL getLocale() override
Return the parents locale or throw exception if this object has no parent yet/anymore.
virtual css::accessibility::TextSegment SAL_CALL getTextAtLineNumber(sal_Int32 nLineNo) override
virtual void SAL_CALL clearAccessibleSelection() override
SwPaM * GetCursor(const bool _bForSelection)
virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override
virtual OUString SAL_CALL getTextRange(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
SwAccessibleParagraph(std::shared_ptr< SwAccessibleMap > const &pInitMap, const SwTextFrame &rTextFrame)
virtual ~SwAccessibleParagraph() override
static bool IsValidChar(sal_Int32 nPos, sal_Int32 nLength)
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getDefaultAttributes(const css::uno::Sequence< OUString > &aRequestedAttributes) override
virtual css::awt::Rectangle SAL_CALL getCharacterBounds(sal_Int32 nIndex) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL deselectAccessibleChild(sal_Int64 nChildIndex) override
virtual sal_Int32 SAL_CALL getHyperLinkCount() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
bool GetAttributeBoundary(css::i18n::Boundary &rBound, sal_Int32 nPos)
virtual sal_Int16 SAL_CALL getAccessibleRole() override
OUString const & GetString()
get the (accessible) text string (requires frame; check before)
virtual sal_Bool SAL_CALL setSelection(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
virtual css::uno::Sequence< css::accessibility::TextSegment > SAL_CALL getTextMarkupAtIndex(sal_Int32 nCharIndex, sal_Int32 nTextMarkupType) override
virtual css::uno::Reference< css::accessibility::XAccessibleHyperlink > SAL_CALL getHyperLink(sal_Int32 nLinkIndex) override
virtual sal_Int32 SAL_CALL getSeletedPositionEnd(sal_Int32 nSelectedPortionIndex) override
virtual sal_Bool SAL_CALL copyText(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
bool GetLineBoundary(css::i18n::Boundary &rBound, std::u16string_view aText, sal_Int32 nPos)
virtual sal_Int32 SAL_CALL getSeletedPositionStart(sal_Int32 nSelectedPortionIndex) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual sal_Int32 SAL_CALL getNumberOfLineWithCaret() override
const SwRangeRedline * GetRedlineAtIndex()
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual sal_Int32 SAL_CALL getTextMarkupCount(sal_Int32 nTextMarkupType) override
virtual void SAL_CALL grabFocus() override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getRunAttributes(sal_Int32 nIndex, const css::uno::Sequence< OUString > &aRequestedAttributes) override
void _getRunAttributesImpl(const sal_Int32 nIndex, const css::uno::Sequence< OUString > &aRequestedAttributes, tAccParaPropValMap &rRunAttrSeq)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
Return whether the specified service is supported by this class.
virtual void SAL_CALL selectAccessibleChild(sal_Int64 nChildIndex) override
void _getDefaultAttributesImpl(const css::uno::Sequence< OUString > &aRequestedAttributes, tAccParaPropValMap &rDefAttrSeq, const bool bOnlyCharAttrs=false)
virtual css::accessibility::TextSegment SAL_CALL getTextMarkup(sal_Int32 nTextMarkupIndex, sal_Int32 nTextMarkupType) override
virtual sal_Bool SAL_CALL deleteText(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
virtual sal_Int32 SAL_CALL getIndexAtPoint(const css::awt::Point &aPoint) override
virtual sal_Unicode SAL_CALL getCharacter(sal_Int32 nIndex) override
virtual css::accessibility::TextSegment SAL_CALL getTextAtLineWithCaret() override
void _correctValues(const sal_Int32 nIndex, std::vector< css::beans::PropertyValue > &rValues)
virtual OUString SAL_CALL getSelectedText() override
virtual void SAL_CALL selectAllAccessibleChildren() override
virtual void SAL_CALL acquire() noexcept override
virtual void InvalidateFocus_() override
virtual sal_Int32 SAL_CALL getCaretPosition() override
virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex(sal_Int32 nIndex, sal_Int16 aTextType) override
bool GetTextBoundary(css::i18n::Boundary &rBound, const OUString &rText, sal_Int32 nPos, sal_Int16 aTextType)
virtual void SAL_CALL release() noexcept override
virtual sal_Bool SAL_CALL removeSelection(sal_Int32 selectionIndex) override
bool GetSelectionAtIndex(sal_Int32 *pSelection, sal_Int32 &nStart, sal_Int32 &nEnd)
virtual sal_Int32 SAL_CALL getSelectionEnd() override
virtual sal_Int32 SAL_CALL getHyperLinkIndex(sal_Int32 nCharIndex) override
bool GetSelection(sal_Int32 &nStart, sal_Int32 &nEnd)
void _getSupplementalAttributesImpl(const css::uno::Sequence< OUString > &aRequestedAttributes, tAccParaPropValMap &rSupplementalAttrSeq)
virtual sal_Int32 SAL_CALL getCharacterCount() override
collect text portion data from the layout through SwPortionHandler interface
PaM is Point and Mark: a selection of the document model.
Represents the visualization of a paragraph.