1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2008 by Sun Microsystems, Inc.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * $RCSfile: AccessibleEditableTextPara.hxx,v $
10  * $Revision: 1.22 $
11  *
12  * This file is part of OpenOffice.org.
13  *
14  * OpenOffice.org is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU Lesser General Public License version 3
16  * only, as published by the Free Software Foundation.
17  *
18  * OpenOffice.org is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU Lesser General Public License version 3 for more details
22  * (a copy is included in the LICENSE file that accompanied this code).
23  *
24  * You should have received a copy of the GNU Lesser General Public License
25  * version 3 along with OpenOffice.org.  If not, see
26  * <http://www.openoffice.org/license.html>
27  * for a copy of the LGPLv3 License.
28  *
29  ************************************************************************/
30 
31 #ifndef _SVX_ACCESSIBLE_HYPERLINK_HXX
32 #define _SVX_ACCESSIBLE_HYPERLINK_HXX
33 
34 #include <cppuhelper/weakref.hxx>
35 #include <cppuhelper/compbase1.hxx>
36 #include <cppuhelper/typeprovider.hxx>
37 #include <cppuhelper/interfacecontainer.hxx>
38 
39 #include <com/sun/star/uno/Reference.hxx>
40 #include <com/sun/star/lang/XServiceInfo.hpp>
41 #include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
42 
43 #include <tools/solar.h>
44 
45 class SvxFieldItem;
46 class SvxAccessibleTextAdapter;
47 
48 namespace accessibility
49 {
50 
51     class AccessibleHyperlink : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleHyperlink >
52     {
53     private:
54 
55         SvxAccessibleTextAdapter& rTA;
56         SvxFieldItem* pFld;
57     	sal_uInt16 nPara, nRealIdx;  // EE values
58     	sal_Int32 nStartIdx, nEndIdx;   // translated values
59     	::rtl::OUString aDescription;
60 
61     public:
62     	AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, sal_uInt16 nP, sal_uInt16 nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD );
63     	~AccessibleHyperlink();
64 
65     	// XAccessibleAction
66         virtual sal_Int32 SAL_CALL getAccessibleActionCount() throw (::com::sun::star::uno::RuntimeException);
67         virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
68         virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
69         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);
70 
71     	// XAccessibleHyperlink
72         virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionAnchor( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
73         virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionObject( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
74         virtual sal_Int32 SAL_CALL getStartIndex() throw (::com::sun::star::uno::RuntimeException);
75         virtual sal_Int32 SAL_CALL getEndIndex() throw (::com::sun::star::uno::RuntimeException);
76         virtual sal_Bool SAL_CALL isValid() throw (::com::sun::star::uno::RuntimeException);
77     };
78 
79 } // end of namespace accessibility
80 
81 #endif
82 
83