diff options
author | Colomban Wendling <cwendling@hypra.fr> | 2020-04-30 10:49:37 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-05-07 12:11:33 +0200 |
commit | b46a0a7f9f88a0213b0a5ca2712b6eb93b74d088 (patch) | |
tree | af83d20d3c08508268c465a7c6983db294f64559 | |
parent | e420b89a698f50b174422b962a24e2a21672a178 (diff) |
tdf#118418 implement scrollSubstringTo() for gtk
Define & use new accessibility scroll type compatible with IAccessible2
and extend the XAccessibleText interface to require scrollSubstringTo().
Co-authored-by: Martin Pieuchot <mpi@grenadille.net>
Change-Id: Id3b2e8616892d7dcbfb41a14b72a8a457fd1dbf6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89851
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
43 files changed, 365 insertions, 0 deletions
diff --git a/accessibility/inc/extended/AccessibleBrowseBoxTableCell.hxx b/accessibility/inc/extended/AccessibleBrowseBoxTableCell.hxx index 6823fa67eb7a..89569914c516 100644 --- a/accessibility/inc/extended/AccessibleBrowseBoxTableCell.hxx +++ b/accessibility/inc/extended/AccessibleBrowseBoxTableCell.hxx @@ -21,6 +21,7 @@ #include <extended/accessiblebrowseboxcell.hxx> #include <comphelper/accessibletexthelper.hxx> #include <cppuhelper/implbase2.hxx> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> namespace accessibility { @@ -114,6 +115,7 @@ namespace accessibility virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; }; } diff --git a/accessibility/inc/extended/AccessibleGridControlTableCell.hxx b/accessibility/inc/extended/AccessibleGridControlTableCell.hxx index ed1735a14f0a..1c104d14933f 100644 --- a/accessibility/inc/extended/AccessibleGridControlTableCell.hxx +++ b/accessibility/inc/extended/AccessibleGridControlTableCell.hxx @@ -22,6 +22,7 @@ #include <cppuhelper/implbase2.hxx> #include <extended/AccessibleGridControlBase.hxx> #include <vcl/accessibletable.hxx> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> namespace accessibility { @@ -138,6 +139,7 @@ namespace accessibility virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; }; } diff --git a/accessibility/inc/extended/accessibleiconchoicectrlentry.hxx b/accessibility/inc/extended/accessibleiconchoicectrlentry.hxx index 9f605554200a..915736e95c0e 100644 --- a/accessibility/inc/extended/accessibleiconchoicectrlentry.hxx +++ b/accessibility/inc/extended/accessibleiconchoicectrlentry.hxx @@ -19,6 +19,7 @@ #pragma once +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/accessibility/XAccessibleComponent.hpp> #include <com/sun/star/accessibility/XAccessibleContext.hpp> @@ -157,6 +158,7 @@ namespace accessibility virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; // XAccessibleEventBroadcaster virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; diff --git a/accessibility/inc/extended/accessiblelistboxentry.hxx b/accessibility/inc/extended/accessiblelistboxentry.hxx index 3c93620e7175..1d565046d59a 100644 --- a/accessibility/inc/extended/accessiblelistboxentry.hxx +++ b/accessibility/inc/extended/accessiblelistboxentry.hxx @@ -20,6 +20,7 @@ #pragma once #include <deque> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/accessibility/XAccessibleComponent.hpp> #include <com/sun/star/accessibility/XAccessibleContext.hpp> @@ -181,6 +182,7 @@ namespace accessibility virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; // XAccessibleEventBroadcaster virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; diff --git a/accessibility/inc/extended/textwindowaccessibility.hxx b/accessibility/inc/extended/textwindowaccessibility.hxx index 5fed0a0a8dd7..91ccd4b5d52a 100644 --- a/accessibility/inc/extended/textwindowaccessibility.hxx +++ b/accessibility/inc/extended/textwindowaccessibility.hxx @@ -25,6 +25,7 @@ #include <vcl/texteng.hxx> #include <vcl/textview.hxx> #include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/accessibility/XAccessibleContext.hpp> #include <com/sun/star/accessibility/XAccessibleEditableText.hpp> @@ -229,6 +230,8 @@ private: virtual sal_Bool SAL_CALL setSelection(::sal_Int32 nStartIndex, ::sal_Int32 nEndIndex) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; + virtual OUString SAL_CALL getText() override; virtual OUString SAL_CALL getTextRange(::sal_Int32 nStartIndex, diff --git a/accessibility/inc/standard/vclxaccessibleedit.hxx b/accessibility/inc/standard/vclxaccessibleedit.hxx index 3e98c34227d8..a02d03319e8a 100644 --- a/accessibility/inc/standard/vclxaccessibleedit.hxx +++ b/accessibility/inc/standard/vclxaccessibleedit.hxx @@ -20,6 +20,7 @@ #pragma once #include <standard/vclxaccessibletextcomponent.hxx> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessibleEditableText.hpp> #include <com/sun/star/accessibility/XAccessibleAction.hpp> @@ -92,6 +93,7 @@ public: virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; // XAccessibleEditableText virtual sal_Bool SAL_CALL cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; diff --git a/accessibility/inc/standard/vclxaccessiblelistitem.hxx b/accessibility/inc/standard/vclxaccessiblelistitem.hxx index e2e5c2378176..4af3c5afd65e 100644 --- a/accessibility/inc/standard/vclxaccessiblelistitem.hxx +++ b/accessibility/inc/standard/vclxaccessiblelistitem.hxx @@ -19,6 +19,7 @@ #pragma once +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/accessibility/XAccessibleComponent.hpp> #include <com/sun/star/accessibility/XAccessibleContext.hpp> @@ -144,6 +145,7 @@ public: virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; // XAccessibleEventBroadcaster virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; diff --git a/accessibility/inc/standard/vclxaccessiblemenuitem.hxx b/accessibility/inc/standard/vclxaccessiblemenuitem.hxx index 7b087d3725b1..2c32418c525a 100644 --- a/accessibility/inc/standard/vclxaccessiblemenuitem.hxx +++ b/accessibility/inc/standard/vclxaccessiblemenuitem.hxx @@ -21,6 +21,7 @@ #include <standard/accessiblemenuitemcomponent.hxx> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessibleAction.hpp> #include <com/sun/star/accessibility/XAccessibleValue.hpp> @@ -87,6 +88,7 @@ public: virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; // XAccessibleAction virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) final override; diff --git a/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx b/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx index 217b77feb36b..92c39dbd8501 100644 --- a/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx +++ b/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx @@ -19,6 +19,7 @@ #pragma once +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <comphelper/accessibletexthelper.hxx> @@ -124,6 +125,7 @@ public: virtual sal_Int32 SAL_CALL getCharacterCount() override; virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override; virtual OUString SAL_CALL getTextRange(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; }; diff --git a/accessibility/inc/standard/vclxaccessibletabpage.hxx b/accessibility/inc/standard/vclxaccessibletabpage.hxx index 56832a866342..8e3c3c8f6c81 100644 --- a/accessibility/inc/standard/vclxaccessibletabpage.hxx +++ b/accessibility/inc/standard/vclxaccessibletabpage.hxx @@ -19,6 +19,7 @@ #pragma once +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <comphelper/accessibletexthelper.hxx> @@ -133,6 +134,7 @@ public: virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; virtual OUString SAL_CALL getTextRange(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; }; diff --git a/accessibility/inc/standard/vclxaccessibletextcomponent.hxx b/accessibility/inc/standard/vclxaccessibletextcomponent.hxx index 0d145ed6a286..205af38d5660 100644 --- a/accessibility/inc/standard/vclxaccessibletextcomponent.hxx +++ b/accessibility/inc/standard/vclxaccessibletextcomponent.hxx @@ -19,6 +19,7 @@ #pragma once +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <toolkit/awt/vclxaccessiblecomponent.hxx> #include <comphelper/accessibletexthelper.hxx> @@ -74,6 +75,7 @@ public: virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; }; diff --git a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx index 6780bfad536e..544be177044b 100644 --- a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx +++ b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx @@ -18,6 +18,7 @@ */ #pragma once +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/accessibility/XAccessibleAction.hpp> #include <com/sun/star/accessibility/XAccessibleContext.hpp> @@ -120,6 +121,7 @@ public: virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; // XAccessibleComponent virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; diff --git a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx index c09639850b84..9727e2f0131c 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx @@ -322,6 +322,10 @@ namespace accessibility //!!! don't know how to put a string into the clipboard return false; } + sal_Bool SAL_CALL AccessibleBrowseBoxTableCell::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) + { + return false; + } void AccessibleBrowseBoxTableCell::disposing( const EventObject& _rSource ) { if ( _rSource.Source == mxParent ) diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx index 3e3af96ff04c..7254f695a31b 100644 --- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx @@ -320,6 +320,10 @@ namespace accessibility //!!! don't know how to put a string into the clipboard return false; } + sal_Bool SAL_CALL AccessibleGridControlTableCell::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) + { + return false; + } tools::Rectangle AccessibleGridControlTableCell::implGetBoundingBox() { diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx index aac52d59c113..5ab257135dd3 100644 --- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx +++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx @@ -474,6 +474,11 @@ namespace accessibility return true; } + sal_Bool SAL_CALL AccessibleIconChoiceCtrlEntry::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) + { + return false; + } + // XAccessibleEventBroadcaster void SAL_CALL AccessibleIconChoiceCtrlEntry::addAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener ) diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx index 6c8c0a1d52da..c742e454b16f 100644 --- a/accessibility/source/extended/accessiblelistboxentry.cxx +++ b/accessibility/source/extended/accessiblelistboxentry.cxx @@ -695,6 +695,11 @@ namespace accessibility return true; } + sal_Bool SAL_CALL AccessibleListBoxEntry::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) + { + return false; + } + // XAccessibleEventBroadcaster void SAL_CALL AccessibleListBoxEntry::addAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener ) diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 7ab7c52aff12..68814bac9b7e 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -431,6 +431,12 @@ sal_Bool SAL_CALL Paragraph::copyText(::sal_Int32 nStartIndex, } // virtual +sal_Bool SAL_CALL Paragraph::scrollSubstringTo( sal_Int32, sal_Int32, css::accessibility::AccessibleScrollType ) +{ + return false; +} + +// virtual sal_Bool SAL_CALL Paragraph::cutText(::sal_Int32 nStartIndex, ::sal_Int32 nEndIndex) { diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx index 0435f71ccd28..0da8a6ff70b1 100644 --- a/accessibility/source/standard/vclxaccessibleedit.cxx +++ b/accessibility/source/standard/vclxaccessibleedit.cxx @@ -487,6 +487,10 @@ sal_Bool VCLXAccessibleEdit::copyText( sal_Int32 nStartIndex, sal_Int32 nEndInde return VCLXAccessibleTextComponent::copyText( nStartIndex, nEndIndex ); } +sal_Bool VCLXAccessibleEdit::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) +{ + return false; +} // XAccessibleEditableText diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx b/accessibility/source/standard/vclxaccessiblelistitem.cxx index 90f8656c8858..9615c43eff54 100644 --- a/accessibility/source/standard/vclxaccessiblelistitem.cxx +++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx @@ -560,6 +560,11 @@ sal_Bool SAL_CALL VCLXAccessibleListItem::copyText( sal_Int32 nStartIndex, sal_I return bRet; } +sal_Bool VCLXAccessibleListItem::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) +{ + return false; +} + // XAccessibleEventBroadcaster void SAL_CALL VCLXAccessibleListItem::addAccessibleEventListener( const Reference< XAccessibleEventListener >& xListener ) diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx b/accessibility/source/standard/vclxaccessiblemenuitem.cxx index 8733b6bb5ea2..d278dae976e8 100644 --- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx +++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx @@ -383,6 +383,11 @@ sal_Bool VCLXAccessibleMenuItem::copyText( sal_Int32 nStartIndex, sal_Int32 nEnd return bReturn; } +sal_Bool VCLXAccessibleMenuItem::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) +{ + return false; +} + // XAccessibleAction diff --git a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx index b0a97f951a59..aee6f9e46737 100644 --- a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx +++ b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx @@ -582,4 +582,9 @@ sal_Bool VCLXAccessibleStatusBarItem::copyText( sal_Int32 nStartIndex, sal_Int32 } +sal_Bool VCLXAccessibleStatusBarItem::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) +{ + return false; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessibletabpage.cxx b/accessibility/source/standard/vclxaccessibletabpage.cxx index 9bb86195ac7a..fb0936f2f360 100644 --- a/accessibility/source/standard/vclxaccessibletabpage.cxx +++ b/accessibility/source/standard/vclxaccessibletabpage.cxx @@ -669,5 +669,10 @@ sal_Bool VCLXAccessibleTabPage::copyText( sal_Int32 nStartIndex, sal_Int32 nEndI return bReturn; } +sal_Bool VCLXAccessibleTabPage::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) +{ + return false; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessibletextcomponent.cxx b/accessibility/source/standard/vclxaccessibletextcomponent.cxx index b9880754d058..a84c810223c3 100644 --- a/accessibility/source/standard/vclxaccessibletextcomponent.cxx +++ b/accessibility/source/standard/vclxaccessibletextcomponent.cxx @@ -368,5 +368,9 @@ sal_Bool VCLXAccessibleTextComponent::copyText( sal_Int32 nStartIndex, sal_Int32 return bReturn; } +sal_Bool VCLXAccessibleTextComponent::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) +{ + return false; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx index 555f0beb008c..64a08300ce59 100644 --- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx +++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx @@ -555,6 +555,11 @@ sal_Bool SAL_CALL VCLXAccessibleToolBoxItem::copyText( sal_Int32 nStartIndex, sa return bReturn; } +sal_Bool VCLXAccessibleToolBoxItem::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) +{ + return false; +} + // XAccessibleComponent Reference< XAccessible > SAL_CALL VCLXAccessibleToolBoxItem::getAccessibleAtPoint( const awt::Point& ) diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 43e4f628b191..a920ebac4732 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -2113,6 +2113,11 @@ namespace accessibility } } + sal_Bool SAL_CALL AccessibleEditableTextPara::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) + { + return false; + } + // XAccessibleEditableText sal_Bool SAL_CALL AccessibleEditableTextPara::cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) { diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx index 1abfd2c40de5..1dcf37b8d54a 100644 --- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx +++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx @@ -883,6 +883,11 @@ namespace accessibility aEndIndex.nPara, aEndIndex.nIndex ); } + sal_Bool SAL_CALL AccessibleStaticTextBase::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) + { + return false; + } + // XAccessibleTextAttributes uno::Sequence< beans::PropertyValue > AccessibleStaticTextBase::getDefaultAttributes( const uno::Sequence< OUString >& RequestedAttributes ) { diff --git a/include/editeng/AccessibleEditableTextPara.hxx b/include/editeng/AccessibleEditableTextPara.hxx index f6d77171c1b3..34fab512fbcb 100644 --- a/include/editeng/AccessibleEditableTextPara.hxx +++ b/include/editeng/AccessibleEditableTextPara.hxx @@ -28,6 +28,7 @@ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/accessibility/XAccessibleContext.hpp> #include <com/sun/star/accessibility/XAccessibleComponent.hpp> @@ -139,6 +140,7 @@ namespace accessibility /// Does not support AccessibleTextType::SENTENCE (missing feature in EditEngine) virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; // XAccessibleEditableText virtual sal_Bool SAL_CALL cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; diff --git a/include/editeng/AccessibleStaticTextBase.hxx b/include/editeng/AccessibleStaticTextBase.hxx index 0ecf3021a2f4..2f2095f073ae 100644 --- a/include/editeng/AccessibleStaticTextBase.hxx +++ b/include/editeng/AccessibleStaticTextBase.hxx @@ -24,6 +24,7 @@ #include <tools/gen.hxx> #include <cppuhelper/implbase2.hxx> #include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessibleText.hpp> #include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp> #include <com/sun/star/accessibility/TextSegment.hpp> @@ -198,6 +199,7 @@ namespace accessibility virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; /// This will only work with a functional SvxEditViewForwarder, i.e. an EditEngine/Outliner in edit mode virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; // XAccessibleTextAttributes virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getDefaultAttributes( const css::uno::Sequence< OUString >& RequestedAttributes ) override; diff --git a/include/svx/AccessibleShape.hxx b/include/svx/AccessibleShape.hxx index 487c7aeabd80..046463e666c0 100644 --- a/include/svx/AccessibleShape.hxx +++ b/include/svx/AccessibleShape.hxx @@ -21,6 +21,7 @@ #ifndef INCLUDED_SVX_ACCESSIBLESHAPE_HXX #define INCLUDED_SVX_ACCESSIBLESHAPE_HXX +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/TextSegment.hpp> #include <com/sun/star/accessibility/XAccessibleSelection.hpp> #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp> @@ -350,6 +351,7 @@ public: virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; //===== Misc ======================================================== diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 8f4079009f12..61262689343b 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -1621,6 +1621,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/accessibility,\ AccessibleRelation \ AccessibleRelationType \ AccessibleRole \ + AccessibleScrollType \ AccessibleStateType \ AccessibleTableModelChange \ AccessibleTableModelChangeType \ diff --git a/offapi/com/sun/star/accessibility/AccessibleScrollType.idl b/offapi/com/sun/star/accessibility/AccessibleScrollType.idl new file mode 100644 index 000000000000..fd096b09b3d9 --- /dev/null +++ b/offapi/com/sun/star/accessibility/AccessibleScrollType.idl @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_accessibility_AccessibleScrollType_idl__ +#define __com_sun_star_accessibility_AccessibleScrollType_idl__ + +module com { module sun { module star { module accessibility { + +/** Scroll types + + <p>Describes the type of scrolling that are available for the methods of + the XAccessibleScrollableText interface.</p> + + @since LibreOffice 7.0 +*/ +enum AccessibleScrollType +{ + /** + Scroll the top left corner of the object or string such that the + top left corner is within the top level window. + */ + SCROLL_TOP_LEFT, + + /** + Scroll the bottom right corner of the object or string such that the + bottom right corner is within the top level window. + */ + SCROLL_BOTTOM_RIGHT, + + /** + Scroll the top edge of the object or string such that the top edge is + within the top level window. + */ + SCROLL_TOP_EDGE, + + /** + Scroll the bottom edge of the object or string such that the bottom + edge is within the top level window. + */ + SCROLL_BOTTOM_EDGE, + + /** + Scroll the left edge of the object or string such that the left edge + is within the top level window. + */ + SCROLL_LEFT_EDGE, + + /** + Scroll the right edge of the object or string such that the right edge + is within the top level window. + */ + SCROLL_RIGHT_EDGE, + + /** + Scroll the object or string such that as much as possible of the + object or string is within the top level window. + */ + SCROLL_ANYWHERE +}; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/accessibility/XAccessibleText.idl b/offapi/com/sun/star/accessibility/XAccessibleText.idl index 7e90f2d8a463..98af06445733 100644 --- a/offapi/com/sun/star/accessibility/XAccessibleText.idl +++ b/offapi/com/sun/star/accessibility/XAccessibleText.idl @@ -491,6 +491,33 @@ interface XAccessibleText : ::com::sun::star::uno::XInterface boolean copyText ([in] long nStartIndex, [in] long nEndIndex) raises (::com::sun::star::lang::IndexOutOfBoundsException); + /** Scroll the specified text to make it visible on screen. + + @param nStartIndex + Start index of the text to scroll. + The valid range is 0..length. + + @param nEndIndex + End index of the text to scroll. + The valid range is nStartIndex..length. + + @param aScrollType + Type of scroll to perform. See AccessibleScrollType for the + complete list. + + @return + Returns `TRUE` if the specified text has been scrolled + successfully. + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if the indices are invalid + + @since LibreOffice 7.0 + */ + boolean + scrollSubstringTo ([in] long nStartIndex, [in] long nEndIndex, + [in] AccessibleScrollType aScrollType) + raises (::com::sun::star::lang::IndexOutOfBoundsException); }; }; }; }; }; diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index 2d762fd41d9a..b16095de21b4 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -608,6 +608,11 @@ sal_Bool SAL_CALL ScAccessibleCsvRuler::copyText( sal_Int32 /* nStartIndex */, s return false; } +sal_Bool SAL_CALL ScAccessibleCsvRuler::scrollSubstringTo( sal_Int32 /* nStartIndex */, sal_Int32/* nEndIndex */, AccessibleScrollType /* aScrollType */ ) +{ + return false; +} + // XInterface ----------------------------------------------------------------- Any SAL_CALL ScAccessibleCsvRuler::queryInterface( const css::uno::Type& rType ) diff --git a/sc/source/ui/inc/AccessibleCsvControl.hxx b/sc/source/ui/inc/AccessibleCsvControl.hxx index 68623b33936a..575b855b7fd6 100644 --- a/sc/source/ui/inc/AccessibleCsvControl.hxx +++ b/sc/source/ui/inc/AccessibleCsvControl.hxx @@ -22,6 +22,7 @@ #include <memory> #include <com/sun/star/accessibility/AccessibleRole.hpp> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessibleText.hpp> #include <com/sun/star/accessibility/XAccessibleTable.hpp> #include <com/sun/star/accessibility/XAccessibleSelection.hpp> @@ -175,6 +176,8 @@ public: /** Copies the specified text range into the clipboard (ruler does nothing). */ virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; + // XInterface ------------------------------------------------------------- DECLARE_XINTERFACE() diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx index 35d094d8bf87..2c494c058a2b 100644 --- a/sdext/source/presenter/PresenterAccessibility.cxx +++ b/sdext/source/presenter/PresenterAccessibility.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleRelationType.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/XAccessibleComponent.hpp> #include <com/sun/star/accessibility/XAccessibleContext.hpp> @@ -324,6 +325,11 @@ public: virtual sal_Bool SAL_CALL copyText (sal_Int32 nStartIndex, sal_Int32 nEndIndex) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( + sal_Int32 nStartIndex, + sal_Int32 nEndIndex, + css::accessibility::AccessibleScrollType aScrollType) override; + protected: virtual awt::Point GetRelativeLocation() override; virtual awt::Size GetSize() override; @@ -1575,6 +1581,14 @@ sal_Bool SAL_CALL PresenterAccessible::AccessibleParagraph::copyText ( return false; } +sal_Bool SAL_CALL PresenterAccessible::AccessibleParagraph::scrollSubstringTo( + sal_Int32, + sal_Int32, + AccessibleScrollType) +{ + return false; +} + //----- protected ------------------------------------------------------------- awt::Point PresenterAccessible::AccessibleParagraph::GetRelativeLocation() diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index e7f0bf900d78..854f09443712 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -718,6 +718,11 @@ sal_Bool SAL_CALL SmGraphicAccessible::copyText( return bReturn; } +sal_Bool SAL_CALL SmGraphicAccessible::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ) +{ + return false; +} + OUString SAL_CALL SmGraphicAccessible::getImplementationName() { return "SmGraphicAccessible"; diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx index 5fce05b193da..8cccdc916e72 100644 --- a/starmath/source/accessibility.hxx +++ b/starmath/source/accessibility.hxx @@ -20,6 +20,7 @@ #ifndef INCLUDED_STARMATH_SOURCE_ACCESSIBILITY_HXX #define INCLUDED_STARMATH_SOURCE_ACCESSIBILITY_HXX +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/accessibility/XAccessibleComponent.hpp> #include <com/sun/star/accessibility/XAccessibleContext.hpp> @@ -128,6 +129,7 @@ public: virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) override; diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 1f2315e07c48..c96b97282305 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -1336,6 +1336,7 @@ css::accessibility::TextSegment SAL_CALL AccessibleShape::getTextBehindIndex( sa return aResult; } sal_Bool SAL_CALL AccessibleShape::copyText( sal_Int32, sal_Int32 ){return true;} +sal_Bool SAL_CALL AccessibleShape::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ){return false;} } // end of namespace accessibility diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx index 7aa34cffe2bf..acc4f0ce31a5 100644 --- a/sw/source/core/access/accnotextframe.cxx +++ b/sw/source/core/access/accnotextframe.cxx @@ -259,6 +259,7 @@ css::accessibility::TextSegment SAL_CALL SwAccessibleNoTextFrame::getTextBehindI } sal_Bool SAL_CALL SwAccessibleNoTextFrame::copyText( sal_Int32, sal_Int32 ){return true;} +sal_Bool SAL_CALL SwAccessibleNoTextFrame::scrollSubstringTo( sal_Int32, sal_Int32, AccessibleScrollType ){return false;} // XAccessibleHyperText diff --git a/sw/source/core/access/accnotextframe.hxx b/sw/source/core/access/accnotextframe.hxx index 38fdd480cc97..21d3bcbe0968 100644 --- a/sw/source/core/access/accnotextframe.hxx +++ b/sw/source/core/access/accnotextframe.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SW_SOURCE_CORE_ACCESS_ACCNOTEXTFRAME_HXX #include "accframebase.hxx" +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessibleImage.hpp> #include <com/sun/star/accessibility/XAccessibleHypertext.hpp> @@ -104,6 +105,7 @@ public: virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; // XAccessibleHypertext virtual sal_Int32 SAL_CALL getHyperLinkCount() override; diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index b2e2e56634c9..4119275a75bc 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -21,6 +21,7 @@ #include <numeric> #include <txtfrm.hxx> #include <flyfrm.hxx> +#include <mdiexp.hxx> #include <ndtxt.hxx> #include <pam.hxx> #include <unotextrange.hxx> @@ -34,6 +35,7 @@ #include <vcl/window.hxx> #include <sal/log.hxx> #include <com/sun/star/accessibility/AccessibleRole.hpp> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleTextType.hpp> #include <com/sun/star/accessibility/AccessibleEventId.hpp> @@ -2492,6 +2494,71 @@ sal_Bool SwAccessibleParagraph::copyText( sal_Int32 nStartIndex, sal_Int32 nEndI return true; } +sal_Bool SwAccessibleParagraph::scrollSubstringTo( sal_Int32 nStartIndex, + sal_Int32 nEndIndex, AccessibleScrollType aScrollType ) +{ + SolarMutexGuard aGuard; + + ThrowIfDisposed(); + + // parameter checking + sal_Int32 nLength = GetString().getLength(); + if ( ! IsValidRange( nStartIndex, nEndIndex, nLength ) ) + throw lang::IndexOutOfBoundsException(); + + vcl::Window *pWin = GetWindow(); + if ( ! pWin ) + throw uno::RuntimeException("no Window", static_cast<cppu::OWeakObject*>(this)); + + /* Start and end character bounds, in pixels, relative to the paragraph */ + awt::Rectangle startR, endR; + startR = getCharacterBounds(nStartIndex); + endR = getCharacterBounds(nEndIndex); + + /* Adjust points to fit the bounding box of both bounds. */ + Point sP(std::min(startR.X, endR.X), startR.Y); + Point eP(std::max(startR.X + startR.Width, endR.X + endR.Width), endR.Y + endR.Height); + + /* Offset the values relative to the view shell frame */ + SwRect aFrameLogBounds( GetBounds( *(GetMap()) ) ); // twip rel to doc root + Point aFramePixPos( GetMap()->CoreToPixel( aFrameLogBounds.SVRect() ).TopLeft() ); + sP += aFramePixPos; + eP += aFramePixPos; + + Point startPoint(GetMap()->PixelToCore(sP)); + Point endPoint(GetMap()->PixelToCore(eP)); + + switch (aScrollType) + { +#ifdef notyet + case AccessibleScrollType_SCROLL_TOP_LEFT: + break; + case AccessibleScrollType_SCROLL_BOTTOM_RIGHT: + break; + case AccessibleScrollType_SCROLL_TOP_EDGE: + break; + case AccessibleScrollType_SCROLL_BOTTOM_EDGE: + break; + case AccessibleScrollType_SCROLL_LEFT_EDGE: + break; + case AccessibleScrollType_SCROLL_RIGHT_EDGE: + break; +#endif + case AccessibleScrollType_SCROLL_ANYWHERE: + break; + default: + return false; + } + + const SwRect aRect(startPoint, endPoint); + SwViewShell* pViewShell = GetMap()->GetShell(); + OSL_ENSURE( pViewShell != nullptr, "View shell expected!" ); + + ScrollMDI(pViewShell, aRect, USHRT_MAX, USHRT_MAX); + + return true; +} + // XAccessibleEditableText sal_Bool SwAccessibleParagraph::cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx index 5e6fed4a5705..6b6f481637d5 100644 --- a/sw/source/core/access/accpara.hxx +++ b/sw/source/core/access/accpara.hxx @@ -20,6 +20,7 @@ #define INCLUDED_SW_SOURCE_CORE_ACCESS_ACCPARA_HXX #include "acccontext.hxx" +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/XAccessibleEditableText.hpp> #include <com/sun/star/accessibility/XAccessibleSelection.hpp> #include <com/sun/star/accessibility/XAccessibleHypertext.hpp> @@ -313,6 +314,7 @@ public: virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; // XAccessibleEditableText virtual sal_Bool SAL_CALL cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; diff --git a/vcl/unx/gtk3/a11y/gtk3atktext.cxx b/vcl/unx/gtk3/a11y/gtk3atktext.cxx index f219efb90fef..713b03325518 100644 --- a/vcl/unx/gtk3/a11y/gtk3atktext.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atktext.cxx @@ -23,12 +23,14 @@ #include <osl/diagnose.h> +#include <com/sun/star/accessibility/AccessibleScrollType.hpp> #include <com/sun/star/accessibility/AccessibleTextType.hpp> #include <com/sun/star/accessibility/TextSegment.hpp> #include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp> #include <com/sun/star/accessibility/XAccessibleText.hpp> #include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp> #include <com/sun/star/accessibility/XAccessibleTextMarkup.hpp> +#include <com/sun/star/lang/NoSupportException.hpp> #include <com/sun/star/text/TextMarkupType.hpp> using namespace ::com::sun::star; @@ -56,6 +58,34 @@ text_type_from_boundary(AtkTextBoundary boundary_type) /*****************************************************************************/ +#if ATK_CHECK_VERSION(2,32,0) +static accessibility::AccessibleScrollType +scroll_type_from_scroll_type(AtkScrollType type) +{ + switch(type) + { + case ATK_SCROLL_TOP_LEFT: + return accessibility::AccessibleScrollType_SCROLL_TOP_LEFT; + case ATK_SCROLL_BOTTOM_RIGHT: + return accessibility::AccessibleScrollType_SCROLL_BOTTOM_RIGHT; + case ATK_SCROLL_TOP_EDGE: + return accessibility::AccessibleScrollType_SCROLL_TOP_EDGE; + case ATK_SCROLL_BOTTOM_EDGE: + return accessibility::AccessibleScrollType_SCROLL_BOTTOM_EDGE; + case ATK_SCROLL_LEFT_EDGE: + return accessibility::AccessibleScrollType_SCROLL_LEFT_EDGE; + case ATK_SCROLL_RIGHT_EDGE: + return accessibility::AccessibleScrollType_SCROLL_RIGHT_EDGE; + case ATK_SCROLL_ANYWHERE: + return accessibility::AccessibleScrollType_SCROLL_ANYWHERE; + default: + throw lang::NoSupportException(); + } +} +#endif + +/*****************************************************************************/ + static gchar * adjust_boundaries( css::uno::Reference<css::accessibility::XAccessibleText> const & pText, accessibility::TextSegment const & rTextSegment, @@ -812,6 +842,29 @@ text_wrapper_set_selection (AtkText *text, return FALSE; } +#if ATK_CHECK_VERSION(2,32,0) +static gboolean +text_wrapper_scroll_substring_to(AtkText *text, + gint start_offset, + gint end_offset, + AtkScrollType scroll_type) +{ + try { + css::uno::Reference<css::accessibility::XAccessibleText> pText + = getText( text ); + + if( pText.is() ) + return pText->scrollSubstringTo( start_offset, end_offset, + scroll_type_from_scroll_type( scroll_type ) ); + } + catch(const uno::Exception&) { + g_warning( "Exception in scrollSubstringTo()" ); + } + + return FALSE; +} +#endif + } // extern "C" void @@ -836,6 +889,9 @@ textIfaceInit (AtkTextIface *iface) iface->get_default_attributes = text_wrapper_get_default_attributes; iface->get_character_extents = text_wrapper_get_character_extents; iface->get_offset_at_point = text_wrapper_get_offset_at_point; +#if ATK_CHECK_VERSION(2,32,0) + iface->scroll_substring_to = text_wrapper_scroll_substring_to; +#endif } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |