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 #ifndef _ACCHYPERLINK_HXX
24 #define _ACCHYPERLINK_HXX
25 #include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
26 #include <vos/ref.hxx>
27 #include <cppuhelper/implbase1.hxx>
28 #include <fmtinfmt.hxx>
29 
30 class SwAccessibleParagraph;
31 class SwTxtAttr;
32 
33 class SwAccessibleHyperlink :
34 		public ::cppu::WeakImplHelper1<
35 		::com::sun::star::accessibility::XAccessibleHyperlink >
36 {
37 	friend class SwAccessibleParagraph;
38 	friend class SwAccessibleHyperTextData;
39 	sal_uInt16 nHintPos;
40 	::vos::ORef< SwAccessibleParagraph > xPara;
41 	sal_Int32 nStartIdx;
42 	sal_Int32 nEndIdx;
43 
44 	SwAccessibleHyperlink( sal_uInt16 nHintPos,
45 						   SwAccessibleParagraph *p,
46 		   				   sal_Int32 nStt, sal_Int32 nEnd	);
47 
48 	const SwTxtAttr *GetTxtAttr() const;
49 	void Invalidate();
50 
51 public:
52 
53 	// XAccessibleAction
54     virtual sal_Int32 SAL_CALL getAccessibleActionCount()
55 		throw (::com::sun::star::uno::RuntimeException);
56     virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex )
57 		throw (::com::sun::star::lang::IndexOutOfBoundsException,
58 				::com::sun::star::uno::RuntimeException);
59     virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription(
60 				sal_Int32 nIndex )
61 		throw (::com::sun::star::lang::IndexOutOfBoundsException,
62 				::com::sun::star::uno::RuntimeException);
63     virtual ::com::sun::star::uno::Reference<
64 			::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL
65 		   	getAccessibleActionKeyBinding( sal_Int32 nIndex )
66 		throw (::com::sun::star::lang::IndexOutOfBoundsException,
67 				::com::sun::star::uno::RuntimeException);
68 
69 	// XAccessibleHyperlink
70     virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionAnchor(
71 				sal_Int32 nIndex )
72 		throw (::com::sun::star::lang::IndexOutOfBoundsException,
73 				::com::sun::star::uno::RuntimeException);
74     virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionObject(
75 			sal_Int32 nIndex )
76 		throw (::com::sun::star::lang::IndexOutOfBoundsException,
77 				::com::sun::star::uno::RuntimeException);
78     virtual sal_Int32 SAL_CALL getStartIndex()
79 		throw (::com::sun::star::uno::RuntimeException);
80     virtual sal_Int32 SAL_CALL getEndIndex()
81 		throw (::com::sun::star::uno::RuntimeException);
82     virtual sal_Bool SAL_CALL isValid(  )
83 		throw (::com::sun::star::uno::RuntimeException);
84 };
85 
86 #endif
87 
88