summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorThomas Lange [tl] <tl@openoffice.org>2010-04-14 10:26:31 +0200
committerThomas Lange [tl] <tl@openoffice.org>2010-04-14 10:26:31 +0200
commit79333b34480c401e3a43e3add609db5874d0b1a7 (patch)
tree44abcc38c77d7e9a2d482efa6e23704e2779f72a /editeng
parentd77eda7077fd8b978f4335270e93756977517955 (diff)
parenta001605a190749900d3e09aa864ce56925ff848e (diff)
cws tl74: merge with DEV300 m76
Diffstat (limited to 'editeng')
-rw-r--r--editeng/inc/editeng/AccessibleEditableTextPara.hxx11
-rw-r--r--editeng/inc/editeng/unoedprx.hxx7
-rw-r--r--editeng/inc/editeng/unoedsrc.hxx1
-rw-r--r--editeng/inc/editeng/unofored.hxx1
-rw-r--r--editeng/inc/editeng/unoforou.hxx2
-rw-r--r--editeng/inc/editeng/unotext.hxx2
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx96
-rw-r--r--editeng/source/accessibility/AccessibleHyperlink.cxx146
-rw-r--r--editeng/source/accessibility/AccessibleHyperlink.hxx82
-rw-r--r--[-rwxr-xr-x]editeng/source/accessibility/makefile.mk1
-rw-r--r--editeng/source/uno/unoedprx.cxx27
-rw-r--r--editeng/source/uno/unofored.cxx5
-rw-r--r--editeng/source/uno/unoforou.cxx5
-rw-r--r--editeng/source/uno/unotext.cxx4
14 files changed, 384 insertions, 6 deletions
diff --git a/editeng/inc/editeng/AccessibleEditableTextPara.hxx b/editeng/inc/editeng/AccessibleEditableTextPara.hxx
index 2588850b4565..8e35f0f7d138 100644
--- a/editeng/inc/editeng/AccessibleEditableTextPara.hxx
+++ b/editeng/inc/editeng/AccessibleEditableTextPara.hxx
@@ -31,7 +31,7 @@
#include <tools/gen.hxx>
#include <tools/string.hxx>
#include <cppuhelper/weakref.hxx>
-#include <cppuhelper/compbase8.hxx>
+#include <cppuhelper/compbase9.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/interfacecontainer.hxx>
@@ -42,6 +42,7 @@
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
+#include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
#include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp>
#include <comphelper/accessibletexthelper.hxx>
@@ -53,12 +54,13 @@
namespace accessibility
{
- typedef ::cppu::WeakComponentImplHelper8< ::com::sun::star::accessibility::XAccessible,
+ typedef ::cppu::WeakComponentImplHelper9< ::com::sun::star::accessibility::XAccessible,
::com::sun::star::accessibility::XAccessibleContext,
::com::sun::star::accessibility::XAccessibleComponent,
::com::sun::star::accessibility::XAccessibleEditableText,
::com::sun::star::accessibility::XAccessibleEventBroadcaster,
::com::sun::star::accessibility::XAccessibleTextAttributes,
+ ::com::sun::star::accessibility::XAccessibleHypertext,
::com::sun::star::accessibility::XAccessibleMultiLineText,
::com::sun::star::lang::XServiceInfo > AccessibleTextParaInterfaceBase;
@@ -162,6 +164,11 @@ namespace accessibility
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getDefaultAttributes( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRunAttributes( ::sal_Int32 Index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ // XAccessibleHypertext
+ virtual ::sal_Int32 SAL_CALL getHyperLinkCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > SAL_CALL getHyperLink( ::sal_Int32 nLinkIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHyperLinkIndex( ::sal_Int32 nCharIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
// XAccessibleMultiLineText
virtual ::sal_Int32 SAL_CALL getLineNumberAtIndex( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtLineNumber( ::sal_Int32 nLineNo ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
diff --git a/editeng/inc/editeng/unoedprx.hxx b/editeng/inc/editeng/unoedprx.hxx
index 67ff8ce44d7f..693fabe7d49f 100644
--- a/editeng/inc/editeng/unoedprx.hxx
+++ b/editeng/inc/editeng/unoedprx.hxx
@@ -50,7 +50,10 @@ public:
virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
virtual void GetPortions( USHORT nPara, SvUShorts& rList ) const;
- virtual USHORT GetItemState( const ESelection& rSel, USHORT nWhich ) const;
+ virtual sal_Int32 CalcLogicalIndex( USHORT nPara, USHORT nEEIndex );
+ virtual USHORT CalcEditEngineIndex( USHORT nPara, sal_Int32 nLogicalIndex );
+
+ virtual USHORT GetItemState( const ESelection& rSel, USHORT nWhich ) const;
virtual USHORT GetItemState( USHORT nPara, USHORT nWhich ) const;
virtual void QuickInsertText( const String& rText, const ESelection& rSel );
@@ -61,6 +64,8 @@ public:
virtual SfxItemPool* GetPool() const;
virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos );
+
virtual BOOL IsValid() const;
virtual LanguageType GetLanguage( USHORT, USHORT ) const;
diff --git a/editeng/inc/editeng/unoedsrc.hxx b/editeng/inc/editeng/unoedsrc.hxx
index c9e71da3d84f..3890bb009cae 100644
--- a/editeng/inc/editeng/unoedsrc.hxx
+++ b/editeng/inc/editeng/unoedsrc.hxx
@@ -171,6 +171,7 @@ public:
virtual void QuickInsertLineBreak( const ESelection& rSel ) = 0;
virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ) = 0;
+ virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ) = 0;
virtual SfxItemPool* GetPool() const = 0;
diff --git a/editeng/inc/editeng/unofored.hxx b/editeng/inc/editeng/unofored.hxx
index fddce62342a6..1c201043511d 100644
--- a/editeng/inc/editeng/unofored.hxx
+++ b/editeng/inc/editeng/unofored.hxx
@@ -63,6 +63,7 @@ public:
virtual SfxItemPool* GetPool() const;
virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos );
virtual BOOL IsValid() const;
virtual LanguageType GetLanguage( USHORT, USHORT ) const;
diff --git a/editeng/inc/editeng/unoforou.hxx b/editeng/inc/editeng/unoforou.hxx
index 0757b2ad20fb..10aeb5805d11 100644
--- a/editeng/inc/editeng/unoforou.hxx
+++ b/editeng/inc/editeng/unoforou.hxx
@@ -81,6 +81,8 @@ public:
virtual SfxItemPool* GetPool() const;
virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos );
+
virtual BOOL IsValid() const;
Outliner& GetOutliner() const { return rOutliner; }
diff --git a/editeng/inc/editeng/unotext.hxx b/editeng/inc/editeng/unotext.hxx
index 78de836ba0ee..732c2f4d17dc 100644
--- a/editeng/inc/editeng/unotext.hxx
+++ b/editeng/inc/editeng/unotext.hxx
@@ -207,6 +207,8 @@ public:
virtual void QuickInsertLineBreak( const ESelection& rSel );
virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos );
+
virtual sal_Bool IsValid() const;
virtual void SetNotifyHdl( const Link& );
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 94b0d92c8d3e..94981dc32e73 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -40,6 +40,7 @@
#include <vos/mutex.hxx>
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
+#include <editeng/flditem.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/awt/Point.hpp>
@@ -52,11 +53,8 @@
#include <comphelper/accessibleeventnotifier.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <unotools/accessiblestatesethelper.hxx>
-
-// --> OD 2006-01-11 #i27138#
#include <unotools/accessiblerelationsethelper.hxx>
#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
-// <--
#include <vcl/unohelp.hxx>
#include <editeng/editeng.hxx>
#include <editeng/unoprnms.hxx>
@@ -70,9 +68,16 @@
//------------------------------------------------------------------------
#include <com/sun/star/beans/PropertyState.hpp>
+
+//!!!#include <svx/unoshape.hxx>
+//!!!#include <svx/dialmgr.hxx>
+//!!!#include "accessibility.hrc"
+
#include <editeng/unolingu.hxx>
#include <editeng/unopracc.hxx>
#include "editeng/AccessibleEditableTextPara.hxx"
+#include "AccessibleHyperlink.hxx"
+
#include <svtools/colorcfg.hxx>
@@ -525,7 +530,9 @@ namespace accessibility
{
uno::Reference< XAccessible > xPara = xParentContext->getAccessibleChild( nIndex );
if( xPara.is() )
+ {
return uno::Reference< XAccessibleText > ( xPara, uno::UNO_QUERY );
+ }
}
}
@@ -811,6 +818,11 @@ namespace accessibility
uno::Reference< XAccessibleEditableText > aAccEditText = this;
aRet <<= aAccEditText;
}
+ else if ( rType == ::getCppuType((uno::Reference< XAccessibleHypertext > *)0) )
+ {
+ uno::Reference< XAccessibleHypertext > aAccHyperText = this;
+ aRet <<= aAccHyperText;
+ }
else
{
aRet = AccessibleTextParaInterfaceBase::queryInterface(rType);
@@ -2063,6 +2075,84 @@ namespace accessibility
return aOutSequence;
}
+ // XAccessibleHypertext
+ ::sal_Int32 SAL_CALL AccessibleEditableTextPara::getHyperLinkCount( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ SvxAccessibleTextAdapter& rT = GetTextForwarder();
+ const sal_Int32 nPara = GetParagraphIndex();
+
+ USHORT nHyperLinks = 0;
+ USHORT nFields = rT.GetFieldCount( nPara );
+ for ( USHORT n = 0; n < nFields; n++ )
+ {
+ EFieldInfo aField = rT.GetFieldInfo( nPara, n );
+ if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) )
+ nHyperLinks++;
+ }
+ return nHyperLinks;
+ }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > SAL_CALL AccessibleEditableTextPara::getHyperLink( ::sal_Int32 nLinkIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > xRef;
+
+ SvxAccessibleTextAdapter& rT = GetTextForwarder();
+ const sal_Int32 nPara = GetParagraphIndex();
+
+ USHORT nHyperLink = 0;
+ USHORT nFields = rT.GetFieldCount( nPara );
+ for ( USHORT n = 0; n < nFields; n++ )
+ {
+ EFieldInfo aField = rT.GetFieldInfo( nPara, n );
+ if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) )
+ {
+ if ( nHyperLink == nLinkIndex )
+ {
+ USHORT nEEStart = aField.aPosition.nIndex;
+
+ // Translate EE Index to accessible index
+ USHORT nStart = rT.CalcEditEngineIndex( nPara, nEEStart );
+ USHORT nEnd = nStart + aField.aCurrentText.Len();
+ xRef = new AccessibleHyperlink( rT, new SvxFieldItem( *aField.pFieldItem ), nPara, nEEStart, nStart, nEnd, aField.aCurrentText );
+ break;
+ }
+ nHyperLink++;
+ }
+ }
+
+ return xRef;
+ }
+
+ ::sal_Int32 SAL_CALL AccessibleEditableTextPara::getHyperLinkIndex( ::sal_Int32 nCharIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+ {
+ const sal_Int32 nPara = GetParagraphIndex();
+ SvxAccessibleTextAdapter& rT = GetTextForwarder();
+
+// SvxAccessibleTextIndex aIndex;
+// aIndex.SetIndex(nPara, nCharIndex, rT);
+// const USHORT nEEIndex = aIndex.GetEEIndex();
+
+ const USHORT nEEIndex = rT.CalcEditEngineIndex( nPara, nCharIndex );
+ sal_Int32 nHLIndex = 0;
+ USHORT nHyperLink = 0;
+ USHORT nFields = rT.GetFieldCount( nPara );
+ for ( USHORT n = 0; n < nFields; n++ )
+ {
+ EFieldInfo aField = rT.GetFieldInfo( nPara, n );
+ if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) )
+ {
+ if ( aField.aPosition.nIndex == nEEIndex )
+ {
+ nHLIndex = nHyperLink;
+ break;
+ }
+ nHyperLink++;
+ }
+ }
+
+ return nHLIndex;
+ }
+
// XAccessibleMultiLineText
sal_Int32 SAL_CALL AccessibleEditableTextPara::getLineNumberAtIndex( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
diff --git a/editeng/source/accessibility/AccessibleHyperlink.cxx b/editeng/source/accessibility/AccessibleHyperlink.cxx
new file mode 100644
index 000000000000..52c12b08a27b
--- /dev/null
+++ b/editeng/source/accessibility/AccessibleHyperlink.cxx
@@ -0,0 +1,146 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: AccessibleEditableTextPara.cxx,v $
+ * $Revision: 1.53 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_editeng.hxx"
+
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <comphelper/accessiblekeybindinghelper.hxx>
+
+#include "AccessibleHyperlink.hxx"
+#include "editeng/unoedprx.hxx"
+#include <editeng/flditem.hxx>
+#include <vcl/keycodes.hxx>
+
+using namespace ::com::sun::star;
+
+
+//------------------------------------------------------------------------
+//
+// AccessibleHyperlink implementation
+//
+//------------------------------------------------------------------------
+
+namespace accessibility
+{
+
+ AccessibleHyperlink::AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, USHORT nP, USHORT nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD )
+ : rTA( r )
+ {
+ pFld = p;
+ nPara = nP;
+ nRealIdx = nR;
+ nStartIdx = nStt;
+ nEndIdx = nEnd;
+ aDescription = rD;
+ }
+
+ AccessibleHyperlink::~AccessibleHyperlink()
+ {
+ delete pFld;
+ }
+
+ // XAccessibleAction
+ sal_Int32 SAL_CALL AccessibleHyperlink::getAccessibleActionCount() throw (uno::RuntimeException)
+ {
+ return isValid() ? 1 : 0;
+ }
+
+ sal_Bool SAL_CALL AccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ sal_Bool bRet = sal_False;
+ if ( isValid() && ( nIndex == 0 ) )
+ {
+ rTA.FieldClicked( *pFld, nPara, nRealIdx );
+ bRet = sal_True;
+ }
+ return bRet;
+ }
+
+ ::rtl::OUString SAL_CALL AccessibleHyperlink::getAccessibleActionDescription( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ ::rtl::OUString aDesc;
+
+ if ( isValid() && ( nIndex == 0 ) )
+ aDesc = aDescription;
+
+ return aDesc;
+ }
+
+ uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL AccessibleHyperlink::getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > xKeyBinding;
+
+ if( isValid() && ( nIndex == 0 ) )
+ {
+ ::comphelper::OAccessibleKeyBindingHelper* pKeyBindingHelper = new ::comphelper::OAccessibleKeyBindingHelper();
+ xKeyBinding = pKeyBindingHelper;
+
+ awt::KeyStroke aKeyStroke;
+ aKeyStroke.Modifiers = 0;
+ aKeyStroke.KeyCode = KEY_RETURN;
+ aKeyStroke.KeyChar = 0;
+ aKeyStroke.KeyFunc = 0;
+ pKeyBindingHelper->AddKeyBinding( aKeyStroke );
+ }
+
+ return xKeyBinding;
+ }
+
+ // XAccessibleHyperlink
+ uno::Any SAL_CALL AccessibleHyperlink::getAccessibleActionAnchor( sal_Int32 /*nIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ return uno::Any();
+ }
+
+ uno::Any SAL_CALL AccessibleHyperlink::getAccessibleActionObject( sal_Int32 /*nIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ return uno::Any();
+ }
+
+ sal_Int32 SAL_CALL AccessibleHyperlink::getStartIndex() throw (uno::RuntimeException)
+ {
+ return nStartIdx;
+ }
+
+ sal_Int32 SAL_CALL AccessibleHyperlink::getEndIndex() throw (uno::RuntimeException)
+ {
+ return nEndIdx;
+ }
+
+ sal_Bool SAL_CALL AccessibleHyperlink::isValid( ) throw (uno::RuntimeException)
+ {
+ return rTA.IsValid();
+ }
+
+} // end of namespace accessibility
+
+//------------------------------------------------------------------------
diff --git a/editeng/source/accessibility/AccessibleHyperlink.hxx b/editeng/source/accessibility/AccessibleHyperlink.hxx
new file mode 100644
index 000000000000..5192f4b5be0b
--- /dev/null
+++ b/editeng/source/accessibility/AccessibleHyperlink.hxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: AccessibleEditableTextPara.hxx,v $
+ * $Revision: 1.22 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SVX_ACCESSIBLE_HYPERLINK_HXX
+#define _SVX_ACCESSIBLE_HYPERLINK_HXX
+
+#include <cppuhelper/weakref.hxx>
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
+
+#include <tools/solar.h>
+
+class SvxFieldItem;
+class SvxAccessibleTextAdapter;
+
+namespace accessibility
+{
+
+ class AccessibleHyperlink : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleHyperlink >
+ {
+ private:
+
+ SvxAccessibleTextAdapter& rTA;
+ SvxFieldItem* pFld;
+ USHORT nPara, nRealIdx; // EE values
+ sal_Int32 nStartIdx, nEndIdx; // translated values
+ ::rtl::OUString aDescription;
+
+ public:
+ AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, USHORT nP, USHORT nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD );
+ ~AccessibleHyperlink();
+
+ // XAccessibleAction
+ virtual sal_Int32 SAL_CALL getAccessibleActionCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleHyperlink
+ virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionAnchor( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionObject( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getStartIndex() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getEndIndex() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isValid() throw (::com::sun::star::uno::RuntimeException);
+ };
+
+} // end of namespace accessibility
+
+#endif
+
diff --git a/editeng/source/accessibility/makefile.mk b/editeng/source/accessibility/makefile.mk
index e29b6477f608..80cb6df746e5 100755..100644
--- a/editeng/source/accessibility/makefile.mk
+++ b/editeng/source/accessibility/makefile.mk
@@ -50,6 +50,7 @@ SLOFILES = \
$(SLO)$/AccessibleStaticTextBase.obj \
$(SLO)$/AccessibleParaManager.obj \
$(SLO)$/AccessibleEditableTextPara.obj \
+ $(SLO)$/AccessibleHyperlink.obj \
$(SLO)$/AccessibleImageBullet.obj
# --- Tagets -------------------------------------------------------
diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx
index 6e49976cfc1d..9fe556190f27 100644
--- a/editeng/source/uno/unoedprx.cxx
+++ b/editeng/source/uno/unoedprx.cxx
@@ -687,6 +687,33 @@ XubString SvxAccessibleTextAdapter::CalcFieldValue( const SvxFieldItem& rField,
return mrTextForwarder->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
}
+void SvxAccessibleTextAdapter::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos )
+{
+ DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
+
+ mrTextForwarder->FieldClicked( rField, nPara, nPos );
+}
+
+sal_Int32 SvxAccessibleTextAdapter::CalcLogicalIndex( USHORT nPara, USHORT nEEIndex )
+{
+ DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
+
+ SvxAccessibleTextIndex aIndex;
+ aIndex.SetEEIndex(nPara, nEEIndex, *mrTextForwarder);
+ return aIndex.GetIndex();
+}
+
+USHORT SvxAccessibleTextAdapter::CalcEditEngineIndex( USHORT nPara, sal_Int32 nLogicalIndex )
+{
+ DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
+
+ SvxAccessibleTextIndex aIndex;
+ aIndex.SetIndex(nPara, nLogicalIndex, *mrTextForwarder);
+ return aIndex.GetEEIndex();
+}
+
+
+
BOOL SvxAccessibleTextAdapter::IsValid() const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx
index f24e815fd6b5..2f21e88f3bfa 100644
--- a/editeng/source/uno/unofored.cxx
+++ b/editeng/source/uno/unofored.cxx
@@ -171,6 +171,11 @@ XubString SvxEditEngineForwarder::CalcFieldValue( const SvxFieldItem& rField, US
return rEditEngine.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
}
+void SvxEditEngineForwarder::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos )
+{
+ rEditEngine.FieldClicked( rField, nPara, nPos );
+}
+
USHORT GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, USHORT nWhich )
{
EECharAttribArray aAttribs;
diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx
index 14e9dd69f082..2b309a6f8aa6 100644
--- a/editeng/source/uno/unoforou.cxx
+++ b/editeng/source/uno/unoforou.cxx
@@ -241,6 +241,11 @@ XubString SvxOutlinerForwarder::CalcFieldValue( const SvxFieldItem& rField, USHO
return rOutliner.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
}
+void SvxOutlinerForwarder::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos )
+{
+ rOutliner.FieldClicked( rField, nPara, nPos );
+}
+
BOOL SvxOutlinerForwarder::IsValid() const
{
// cannot reliably query outliner state
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 1acc71e19c48..45ef23c2be8f 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -2588,6 +2588,10 @@ XubString SvxDummyTextSource::CalcFieldValue( const SvxFieldItem&, sal_uInt16, s
return XubString();
}
+void SvxDummyTextSource::FieldClicked( const SvxFieldItem&, USHORT, xub_StrLen )
+{
+}
+
sal_Bool SvxDummyTextSource::IsValid() const
{
return sal_False;