LibreOffice Module comphelper (master) 1
Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
comphelper::OCommonAccessibleText Class Referenceabstract

base class encapsulating common functionality for the helper classes implementing the XAccessibleText More...

#include <accessibletexthelper.hxx>

Inheritance diagram for comphelper::OCommonAccessibleText:
[legend]

Static Public Member Functions

static bool implInitTextChangedEvent (std::u16string_view rOldString, std::u16string_view rNewString, css::uno::Any &rDeleted, css::uno::Any &rInserted)
 Helper method, that detects the difference between two strings and returns the deleted selection and the inserted selection if available. More...
 

Protected Member Functions

 OCommonAccessibleText ()
 
virtual ~OCommonAccessibleText ()
 
css::uno::Reference< css::i18n::XBreakIterator > const & implGetBreakIterator ()
 
css::uno::Reference< css::i18n::XCharacterClassification > const & implGetCharacterClassification ()
 
virtual OUString implGetText ()=0
 
virtual css::lang::Locale implGetLocale ()=0
 
virtual void implGetSelection (sal_Int32 &nStartIndex, sal_Int32 &nEndIndex)=0
 
void implGetGlyphBoundary (const OUString &rText, css::i18n::Boundary &rBoundary, sal_Int32 nIndex)
 
bool implGetWordBoundary (const OUString &rText, css::i18n::Boundary &rBoundary, sal_Int32 nIndex)
 
void implGetSentenceBoundary (const OUString &rText, css::i18n::Boundary &rBoundary, sal_Int32 nIndex)
 
virtual void implGetParagraphBoundary (const OUString &rText, css::i18n::Boundary &rBoundary, sal_Int32 nIndex)
 
virtual void implGetLineBoundary (const OUString &rText, css::i18n::Boundary &rBoundary, sal_Int32 nIndex)
 
OUString getSelectedText ()
 non-virtual versions of the methods More...
 
sal_Int32 getSelectionStart ()
 
sal_Int32 getSelectionEnd ()
 
css::accessibility::TextSegment getTextAtIndex (sal_Int32 nIndex, sal_Int16 aTextType)
 
css::accessibility::TextSegment getTextBeforeIndex (sal_Int32 nIndex, sal_Int16 aTextType)
 
css::accessibility::TextSegment getTextBehindIndex (sal_Int32 nIndex, sal_Int16 aTextType)
 

Static Protected Member Functions

static bool implIsValidBoundary (css::i18n::Boundary const &rBoundary, sal_Int32 nLength)
 
static bool implIsValidIndex (sal_Int32 nIndex, sal_Int32 nLength)
 
static bool implIsValidRange (sal_Int32 nStartIndex, sal_Int32 nEndIndex, sal_Int32 nLength)
 
static sal_Unicode implGetCharacter (std::u16string_view rText, sal_Int32 nIndex)
 
static OUString implGetTextRange (std::u16string_view rText, sal_Int32 nStartIndex, sal_Int32 nEndIndex)
 

Private Attributes

css::uno::Reference< css::i18n::XBreakIterator > m_xBreakIter
 
css::uno::Reference< css::i18n::XCharacterClassification > m_xCharClass
 

Detailed Description

base class encapsulating common functionality for the helper classes implementing the XAccessibleText

Definition at line 42 of file accessibletexthelper.hxx.

Constructor & Destructor Documentation

◆ OCommonAccessibleText()

comphelper::OCommonAccessibleText::OCommonAccessibleText ( )
protected

Definition at line 49 of file accessibletexthelper.cxx.

◆ ~OCommonAccessibleText()

comphelper::OCommonAccessibleText::~OCommonAccessibleText ( )
protectedvirtual

Definition at line 54 of file accessibletexthelper.cxx.

Member Function Documentation

◆ getSelectedText()

OUString comphelper::OCommonAccessibleText::getSelectedText ( )
protected

non-virtual versions of the methods

Exceptions
css::lang::IndexOutOfBoundsException
css::uno::RuntimeException

Definition at line 227 of file accessibletexthelper.cxx.

References implGetSelection(), implGetText(), and implGetTextRange().

Referenced by comphelper::OAccessibleTextHelper::getSelectedText().

◆ getSelectionEnd()

sal_Int32 comphelper::OCommonAccessibleText::getSelectionEnd ( )
protected
Exceptions
css::uno::RuntimeException

Definition at line 258 of file accessibletexthelper.cxx.

References implGetSelection().

Referenced by comphelper::OAccessibleTextHelper::getSelectionEnd().

◆ getSelectionStart()

sal_Int32 comphelper::OCommonAccessibleText::getSelectionStart ( )
protected
Exceptions
css::uno::RuntimeException

Definition at line 247 of file accessibletexthelper.cxx.

References implGetSelection().

Referenced by comphelper::OAccessibleTextHelper::getSelectionStart().

◆ getTextAtIndex()

TextSegment comphelper::OCommonAccessibleText::getTextAtIndex ( sal_Int32  nIndex,
sal_Int16  aTextType 
)
protected
Exceptions
css::lang::IndexOutOfBoundsException
css::lang::IllegalArgumentException
css::uno::RuntimeException

Definition at line 281 of file accessibletexthelper.cxx.

References implGetGlyphBoundary(), implGetLineBoundary(), implGetParagraphBoundary(), implGetSentenceBoundary(), implGetText(), implGetWordBoundary(), implIsValidBoundary(), implIsValidIndex(), nIndex, and nLength.

Referenced by comphelper::OAccessibleTextHelper::getTextAtIndex().

◆ getTextBeforeIndex()

TextSegment comphelper::OCommonAccessibleText::getTextBeforeIndex ( sal_Int32  nIndex,
sal_Int16  aTextType 
)
protected
Exceptions
css::lang::IndexOutOfBoundsException
css::lang::IllegalArgumentException
css::uno::RuntimeException

Definition at line 388 of file accessibletexthelper.cxx.

References implGetGlyphBoundary(), implGetLineBoundary(), implGetParagraphBoundary(), implGetSentenceBoundary(), implGetText(), implGetWordBoundary(), implIsValidBoundary(), implIsValidIndex(), nIndex, and nLength.

Referenced by comphelper::OAccessibleTextHelper::getTextBeforeIndex().

◆ getTextBehindIndex()

TextSegment comphelper::OCommonAccessibleText::getTextBehindIndex ( sal_Int32  nIndex,
sal_Int16  aTextType 
)
protected
Exceptions
css::lang::IndexOutOfBoundsException
css::lang::IllegalArgumentException
css::uno::RuntimeException

Definition at line 515 of file accessibletexthelper.cxx.

References implGetGlyphBoundary(), implGetLineBoundary(), implGetParagraphBoundary(), implGetSentenceBoundary(), implGetText(), implGetWordBoundary(), implIsValidBoundary(), implIsValidIndex(), nIndex, and nLength.

Referenced by comphelper::OAccessibleTextHelper::getTextBehindIndex().

◆ implGetBreakIterator()

Reference< i18n::XBreakIterator > const & comphelper::OCommonAccessibleText::implGetBreakIterator ( )
protected

◆ implGetCharacter()

sal_Unicode comphelper::OCommonAccessibleText::implGetCharacter ( std::u16string_view  rText,
sal_Int32  nIndex 
)
staticprotected

Definition at line 219 of file accessibletexthelper.cxx.

References implIsValidIndex(), and nIndex.

◆ implGetCharacterClassification()

Reference< i18n::XCharacterClassification > const & comphelper::OCommonAccessibleText::implGetCharacterClassification ( )
protected

Definition at line 71 of file accessibletexthelper.cxx.

References comphelper::getProcessComponentContext(), and m_xCharClass.

Referenced by implGetWordBoundary().

◆ implGetGlyphBoundary()

void comphelper::OCommonAccessibleText::implGetGlyphBoundary ( const OUString &  rText,
css::i18n::Boundary &  rBoundary,
sal_Int32  nIndex 
)
protected

◆ implGetLineBoundary()

void comphelper::OCommonAccessibleText::implGetLineBoundary ( const OUString &  rText,
css::i18n::Boundary &  rBoundary,
sal_Int32  nIndex 
)
protectedvirtual

Definition at line 202 of file accessibletexthelper.cxx.

References implIsValidIndex(), nIndex, and nLength.

Referenced by getTextAtIndex(), getTextBeforeIndex(), and getTextBehindIndex().

◆ implGetLocale()

virtual css::lang::Locale comphelper::OCommonAccessibleText::implGetLocale ( )
protectedpure virtual

◆ implGetParagraphBoundary()

void comphelper::OCommonAccessibleText::implGetParagraphBoundary ( const OUString &  rText,
css::i18n::Boundary &  rBoundary,
sal_Int32  nIndex 
)
protectedvirtual

Definition at line 179 of file accessibletexthelper.cxx.

References implIsValidIndex(), and nIndex.

Referenced by getTextAtIndex(), getTextBeforeIndex(), and getTextBehindIndex().

◆ implGetSelection()

virtual void comphelper::OCommonAccessibleText::implGetSelection ( sal_Int32 &  nStartIndex,
sal_Int32 &  nEndIndex 
)
protectedpure virtual

◆ implGetSentenceBoundary()

void comphelper::OCommonAccessibleText::implGetSentenceBoundary ( const OUString &  rText,
css::i18n::Boundary &  rBoundary,
sal_Int32  nIndex 
)
protected

◆ implGetText()

virtual OUString comphelper::OCommonAccessibleText::implGetText ( )
protectedpure virtual

◆ implGetTextRange()

OUString comphelper::OCommonAccessibleText::implGetTextRange ( std::u16string_view  rText,
sal_Int32  nStartIndex,
sal_Int32  nEndIndex 
)
staticprotected

Definition at line 269 of file accessibletexthelper.cxx.

References implIsValidRange().

Referenced by getSelectedText().

◆ implGetWordBoundary()

bool comphelper::OCommonAccessibleText::implGetWordBoundary ( const OUString &  rText,
css::i18n::Boundary &  rBoundary,
sal_Int32  nIndex 
)
protected

◆ implInitTextChangedEvent()

bool comphelper::OCommonAccessibleText::implInitTextChangedEvent ( std::u16string_view  rOldString,
std::u16string_view  rNewString,
css::uno::Any &  rDeleted,
css::uno::Any &  rInserted 
)
static

Helper method, that detects the difference between two strings and returns the deleted selection and the inserted selection if available.

Returns
true if there are differences between the two strings and false if both are equal
See also
css::accessibility::AccessibleEventId css::accessibility::TextSegment

Definition at line 646 of file accessibletexthelper.cxx.

◆ implIsValidBoundary()

bool comphelper::OCommonAccessibleText::implIsValidBoundary ( css::i18n::Boundary const &  rBoundary,
sal_Int32  nLength 
)
staticprotected

Definition at line 82 of file accessibletexthelper.cxx.

References nLength.

Referenced by getTextAtIndex(), getTextBeforeIndex(), and getTextBehindIndex().

◆ implIsValidIndex()

bool comphelper::OCommonAccessibleText::implIsValidIndex ( sal_Int32  nIndex,
sal_Int32  nLength 
)
staticprotected

◆ implIsValidRange()

bool comphelper::OCommonAccessibleText::implIsValidRange ( sal_Int32  nStartIndex,
sal_Int32  nEndIndex,
sal_Int32  nLength 
)
staticprotected

Definition at line 94 of file accessibletexthelper.cxx.

References nLength.

Referenced by implGetTextRange().

Member Data Documentation

◆ m_xBreakIter

css::uno::Reference< css::i18n::XBreakIterator > comphelper::OCommonAccessibleText::m_xBreakIter
private

Definition at line 45 of file accessibletexthelper.hxx.

Referenced by implGetBreakIterator().

◆ m_xCharClass

css::uno::Reference< css::i18n::XCharacterClassification > comphelper::OCommonAccessibleText::m_xCharClass
private

Definition at line 46 of file accessibletexthelper.hxx.

Referenced by implGetCharacterClassification().


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