LibreOffice Module editeng (master) 1
|
Helper class for objects containing EditEngine/Outliner text. More...
#include <AccessibleStaticTextBase.hxx>
Public Member Functions | |
AccessibleStaticTextBase (::std::unique_ptr< SvxEditSource > &&pEditSource) | |
Create accessible text object for given edit source. More... | |
virtual | ~AccessibleStaticTextBase () |
void | SetEditSource (::std::unique_ptr< SvxEditSource > &&pEditSource) |
Set the current edit source. More... | |
void | SetEventSource (const css::uno::Reference< css::accessibility::XAccessible > &rInterface) |
Set the event source. More... | |
void | SetOffset (const Point &rPoint) |
Set offset of EditEngine from parent. More... | |
void | Dispose () |
Drop all references and enter disposed state. More... | |
virtual sal_Int32 SAL_CALL | getCaretPosition () override |
virtual sal_Bool SAL_CALL | setCaretPosition (sal_Int32 nIndex) override |
virtual sal_Unicode SAL_CALL | getCharacter (sal_Int32 nIndex) override |
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL | getCharacterAttributes (sal_Int32 nIndex, const css::uno::Sequence< OUString > &aRequestedAttributes) override |
virtual css::awt::Rectangle SAL_CALL | getCharacterBounds (sal_Int32 nIndex) override |
virtual sal_Int32 SAL_CALL | getCharacterCount () override |
virtual sal_Int32 SAL_CALL | getIndexAtPoint (const css::awt::Point &aPoint) override |
virtual OUString SAL_CALL | getSelectedText () override |
virtual sal_Int32 SAL_CALL | getSelectionStart () override |
virtual sal_Int32 SAL_CALL | getSelectionEnd () override |
virtual sal_Bool SAL_CALL | setSelection (sal_Int32 nStartIndex, sal_Int32 nEndIndex) override |
This will only work with a functional SvxEditViewForwarder, i.e. an EditEngine/Outliner in edit mode. More... | |
virtual OUString SAL_CALL | getText () override |
virtual OUString SAL_CALL | getTextRange (sal_Int32 nStartIndex, sal_Int32 nEndIndex) override |
virtual css::accessibility::TextSegment SAL_CALL | getTextAtIndex (sal_Int32 nIndex, sal_Int16 aTextType) override |
Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine) More... | |
virtual css::accessibility::TextSegment SAL_CALL | getTextBeforeIndex (sal_Int32 nIndex, sal_Int16 aTextType) override |
Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine) More... | |
virtual css::accessibility::TextSegment SAL_CALL | getTextBehindIndex (sal_Int32 nIndex, sal_Int16 aTextType) override |
Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine) More... | |
virtual sal_Bool SAL_CALL | copyText (sal_Int32 nStartIndex, sal_Int32 nEndIndex) override |
This will only work with a functional SvxEditViewForwarder, i.e. an EditEngine/Outliner in edit mode. More... | |
virtual sal_Bool SAL_CALL | scrollSubstringTo (sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override |
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL | getDefaultAttributes (const css::uno::Sequence< OUString > &RequestedAttributes) override |
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL | getRunAttributes (sal_Int32 Index, const css::uno::Sequence< OUString > &RequestedAttributes) override |
virtual sal_Int64 SAL_CALL | getAccessibleChildCount () |
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL | getAccessibleChild (sal_Int64 i) |
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL | getAccessibleAtPoint (const css::awt::Point &aPoint) |
Public Member Functions inherited from cppu::ImplHelper2< class Ifc1, class Ifc2 > | |
virtual css::uno::Any SAL_CALL | queryInterface (css::uno::Type const &rType) SAL_OVERRIDE |
virtual css::uno::Sequence< css::uno::Type > SAL_CALL | getTypes () SAL_OVERRIDE |
virtual css::uno::Sequence< sal_Int8 > SAL_CALL | getImplementationId () SAL_OVERRIDE |
Protected Member Functions | |
tools::Rectangle | GetParagraphBoundingBox () const |
Protected Member Functions inherited from cppu::ImplHelper2< class Ifc1, class Ifc2 > | |
~ImplHelper2 () SAL_NOEXCEPT | |
Private Member Functions | |
AccessibleStaticTextBase (const AccessibleStaticTextBase &)=delete | |
AccessibleStaticTextBase & | operator= (const AccessibleStaticTextBase &)=delete |
Private Attributes | |
const std::unique_ptr< AccessibleStaticTextBase_Impl > | mpImpl |
@dyn More... | |
Helper class for objects containing EditEngine/Outliner text.
This class implements the XAccessibleText interface for static text, somewhat similar to the children of the AccessibleTextHelper class. Currently, there are no children, i.e. the whole text is presented in one big chunk. This might change in the future, if a need for image bullets should arise. These, by convention, would be represented as children of the text.
You have to implement the SvxEditSource, SvxTextForwarder, SvxViewForwarder and SvxEditViewForwarder interfaces in order to enable your object to cooperate with this class. SvxTextForwarder encapsulates the fact that text objects do not necessarily have an EditEngine at their disposal, SvxViewForwarder and SvxEditViewForwarder do the same for the document and the edit view. The three mentioned forwarder objects are not stored by the AccessibleTextHelper, but fetched every time from the SvxEditSource. So you are best off making your SvxEditSource::Get*Forwarder methods cache the current forwarder.
As this class is intended for static (i.e. non-changing) text only, no event broadcasting is necessary. You must handle visibility by yourself, the bounding boxes returned by getCharacterBounds() are relative to your accessibility object.
Definition at line 89 of file AccessibleStaticTextBase.hxx.
|
explicit |
Create accessible text object for given edit source.
pEditSource | The edit source to use. Object ownership is transferred from the caller to the callee. The object listens on the SvxEditSource for object disposal, so no provisions have to be taken if the caller destroys the data (e.g. the model) contained in the given SvxEditSource. |
|
virtual |
Definition at line 435 of file AccessibleStaticTextBase.cxx.
|
privatedelete |
|
overridevirtual |
This will only work with a functional SvxEditViewForwarder, i.e. an EditEngine/Outliner in edit mode.
Definition at line 869 of file AccessibleStaticTextBase.cxx.
References mpImpl, EPosition::nIndex, and EPosition::nPara.
void accessibility::AccessibleStaticTextBase::Dispose | ( | ) |
Drop all references and enter disposed state.
This method drops all references to external objects (also the event source reference set via SetEventSource()) and sets the object into the disposed state (i.e. the methods return default values or throw a uno::DisposedException exception).
Definition at line 461 of file AccessibleStaticTextBase.cxx.
References mpImpl.
|
virtual |
css::uno::RuntimeException |
Definition at line 480 of file AccessibleStaticTextBase.cxx.
|
virtual |
css::lang::IndexOutOfBoundsException | |
css::uno::RuntimeException |
Definition at line 474 of file AccessibleStaticTextBase.cxx.
|
virtual |
css::uno::RuntimeException |
Definition at line 468 of file AccessibleStaticTextBase.cxx.
|
overridevirtual |
Definition at line 487 of file AccessibleStaticTextBase.cxx.
|
overridevirtual |
Definition at line 506 of file AccessibleStaticTextBase.cxx.
References mpImpl, nIndex, EPosition::nIndex, and EPosition::nPara.
|
overridevirtual |
Definition at line 515 of file AccessibleStaticTextBase.cxx.
References mpImpl, nIndex, EPosition::nIndex, and EPosition::nPara.
|
overridevirtual |
Definition at line 527 of file AccessibleStaticTextBase.cxx.
References mpImpl, nIndex, EPosition::nIndex, and EPosition::nPara.
|
overridevirtual |
Definition at line 545 of file AccessibleStaticTextBase.cxx.
|
overridevirtual |
Definition at line 889 of file AccessibleStaticTextBase.cxx.
References aSeq, comphelper::containerToSequence(), and mpImpl.
Referenced by getRunAttributes().
|
overridevirtual |
Definition at line 557 of file AccessibleStaticTextBase.cxx.
|
protected |
Definition at line 956 of file AccessibleStaticTextBase.cxx.
References mpImpl.
|
overridevirtual |
Definition at line 926 of file AccessibleStaticTextBase.cxx.
References comphelper::containerToSequence(), getDefaultAttributes(), Handle, i, mpImpl, nIndex, EPosition::nIndex, nLength, and EPosition::nPara.
|
overridevirtual |
Definition at line 584 of file AccessibleStaticTextBase.cxx.
References getSelectionEnd(), getSelectionStart(), and getTextRange().
|
overridevirtual |
Definition at line 612 of file AccessibleStaticTextBase.cxx.
References i, mpImpl, and nPos.
Referenced by getSelectedText().
|
overridevirtual |
Definition at line 598 of file AccessibleStaticTextBase.cxx.
References i, mpImpl, and nPos.
Referenced by getSelectedText().
|
overridevirtual |
Definition at line 637 of file AccessibleStaticTextBase.cxx.
|
overridevirtual |
Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine)
Definition at line 731 of file AccessibleStaticTextBase.cxx.
References accessibility::cNewLine(), SvxAccessibleTextAdapter::GetAttributeRun(), getTextRange(), mpImpl, nIndex, EPosition::nIndex, and EPosition::nPara.
Referenced by getTextBeforeIndex().
|
overridevirtual |
Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine)
Definition at line 782 of file AccessibleStaticTextBase.cxx.
References getTextAtIndex(), mpImpl, nIndex, EPosition::nIndex, and EPosition::nPara.
|
overridevirtual |
Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine)
Definition at line 828 of file AccessibleStaticTextBase.cxx.
References accessibility::cNewLine(), mpImpl, nIndex, EPosition::nIndex, and EPosition::nPara.
|
overridevirtual |
Definition at line 649 of file AccessibleStaticTextBase.cxx.
References accessibility::cNewLine(), i, mpImpl, EPosition::nIndex, and EPosition::nPara.
Referenced by getSelectedText(), and getTextAtIndex().
|
privatedelete |
References Dispose().
|
overridevirtual |
Definition at line 883 of file AccessibleStaticTextBase.cxx.
|
overridevirtual |
Definition at line 501 of file AccessibleStaticTextBase.cxx.
References nIndex, and setSelection().
void accessibility::AccessibleStaticTextBase::SetEditSource | ( | ::std::unique_ptr< SvxEditSource > && | pEditSource | ) |
Set the current edit source.
The EditSource set here is required to broadcast out the following hints: SfxHintId::EditSourceParasMoved, SfxHintId::EditSourceSelectionChanged, SfxHintId::TextModified, SfxHintId::TextParaInserted, SfxHintId::TextParaRemoved, SfxHintId::TextHeightChanged, SfxHintId::TextViewScrolled. Otherwise, not all state changes will get noticed by the accessibility object. Further more, when the corresponding core object or the model is dying, either the edit source must be set to NULL or it has to broadcast a SfxHintId::Dying hint.
This class does not have a dispose method, since it is not a UNO component. Nevertheless, it holds C++ references to several core objects, so you should issue a SetEditSource(::std::unique_ptr<SvxEditSource>()) in your dispose() method.
pEditSource | The new edit source to set. Object ownership is transferred from the caller to the callee. |
Definition at line 439 of file AccessibleStaticTextBase.cxx.
References DBG_TESTSOLARMUTEX, and mpImpl.
void accessibility::AccessibleStaticTextBase::SetEventSource | ( | const css::uno::Reference< css::accessibility::XAccessible > & | rInterface | ) |
Set the event source.
rInterface | The interface that should be set as the source for accessibility events sent by this object. |
Definition at line 447 of file AccessibleStaticTextBase.cxx.
References mpImpl.
void accessibility::AccessibleStaticTextBase::SetOffset | ( | const Point & | rPoint | ) |
Set offset of EditEngine from parent.
If the origin of the underlying EditEngine does not correspond to the upper left corner of the object using this class, you have to specify the offset.
rPoint | The offset in screen coordinates (i.e. pixel) |
Definition at line 453 of file AccessibleStaticTextBase.cxx.
References DBG_TESTSOLARMUTEX, and mpImpl.
|
overridevirtual |
This will only work with a functional SvxEditViewForwarder, i.e. an EditEngine/Outliner in edit mode.
Definition at line 626 of file AccessibleStaticTextBase.cxx.
References mpImpl, EPosition::nIndex, and EPosition::nPara.
Referenced by setCaretPosition().
|
private |
@dyn
Definition at line 225 of file AccessibleStaticTextBase.hxx.
Referenced by copyText(), Dispose(), getCaretPosition(), getCharacter(), getCharacterAttributes(), getCharacterBounds(), getCharacterCount(), getDefaultAttributes(), getIndexAtPoint(), GetParagraphBoundingBox(), getRunAttributes(), getSelectionEnd(), getSelectionStart(), getText(), getTextAtIndex(), getTextBeforeIndex(), getTextBehindIndex(), getTextRange(), SetEditSource(), SetEventSource(), SetOffset(), and setSelection().