1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SVX_ACCESSIBLE_HYPERLINK_HXX
25 #define _SVX_ACCESSIBLE_HYPERLINK_HXX
26 
27 #include <cppuhelper/weakref.hxx>
28 #include <cppuhelper/compbase1.hxx>
29 #include <cppuhelper/typeprovider.hxx>
30 #include <cppuhelper/interfacecontainer.hxx>
31 
32 #include <com/sun/star/uno/Reference.hxx>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
35 
36 #include <tools/solar.h>
37 
38 class SvxFieldItem;
39 class SvxAccessibleTextAdapter;
40 
41 namespace accessibility
42 {
43 
44     class AccessibleHyperlink : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleHyperlink >
45     {
46     private:
47 
48         SvxAccessibleTextAdapter& rTA;
49         SvxFieldItem* pFld;
50     	// EE values
51     	sal_uInt32 nPara;
52     	sal_uInt16 nRealIdx;
53     	sal_Int32 nStartIdx, nEndIdx;   // translated values
54     	::rtl::OUString aDescription;
55 
56     public:
57     	AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, sal_uInt32 nP, sal_uInt16 nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD );
58     	~AccessibleHyperlink();
59 
60     	// XAccessibleAction
61         virtual sal_Int32 SAL_CALL getAccessibleActionCount() throw (::com::sun::star::uno::RuntimeException);
62         virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
63         virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
64         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);
65 
66     	// XAccessibleHyperlink
67         virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionAnchor( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
68         virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionObject( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
69         virtual sal_Int32 SAL_CALL getStartIndex() throw (::com::sun::star::uno::RuntimeException);
70         virtual sal_Int32 SAL_CALL getEndIndex() throw (::com::sun::star::uno::RuntimeException);
71         virtual sal_Bool SAL_CALL isValid() throw (::com::sun::star::uno::RuntimeException);
72     };
73 
74 } // end of namespace accessibility
75 
76 #endif
77 
78