1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _ACCHYPERLINK_HXX
28 #define _ACCHYPERLINK_HXX
29 #include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
30 #include <vos/ref.hxx>
31 #include <cppuhelper/implbase1.hxx>
32 #include <fmtinfmt.hxx>
33 
34 class SwAccessibleParagraph;
35 class SwTxtAttr;
36 
37 class SwAccessibleHyperlink :
38 		public ::cppu::WeakImplHelper1<
39 		::com::sun::star::accessibility::XAccessibleHyperlink >
40 {
41 	friend class SwAccessibleParagraph;
42 	friend class SwAccessibleHyperTextData;
43 	sal_uInt16 nHintPos;
44 	::vos::ORef< SwAccessibleParagraph > xPara;
45 	sal_Int32 nStartIdx;
46 	sal_Int32 nEndIdx;
47 
48 	SwAccessibleHyperlink( sal_uInt16 nHintPos,
49 						   SwAccessibleParagraph *p,
50 		   				   sal_Int32 nStt, sal_Int32 nEnd	);
51 
52 	const SwTxtAttr *GetTxtAttr() const;
53 	void Invalidate();
54 
55 public:
56 
57 	// XAccessibleAction
58     virtual sal_Int32 SAL_CALL getAccessibleActionCount()
59 		throw (::com::sun::star::uno::RuntimeException);
60     virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex )
61 		throw (::com::sun::star::lang::IndexOutOfBoundsException,
62 				::com::sun::star::uno::RuntimeException);
63     virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription(
64 				sal_Int32 nIndex )
65 		throw (::com::sun::star::lang::IndexOutOfBoundsException,
66 				::com::sun::star::uno::RuntimeException);
67     virtual ::com::sun::star::uno::Reference<
68 			::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL
69 		   	getAccessibleActionKeyBinding( sal_Int32 nIndex )
70 		throw (::com::sun::star::lang::IndexOutOfBoundsException,
71 				::com::sun::star::uno::RuntimeException);
72 
73 	// XAccessibleHyperlink
74     virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionAnchor(
75 				sal_Int32 nIndex )
76 		throw (::com::sun::star::lang::IndexOutOfBoundsException,
77 				::com::sun::star::uno::RuntimeException);
78     virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionObject(
79 			sal_Int32 nIndex )
80 		throw (::com::sun::star::lang::IndexOutOfBoundsException,
81 				::com::sun::star::uno::RuntimeException);
82     virtual sal_Int32 SAL_CALL getStartIndex()
83 		throw (::com::sun::star::uno::RuntimeException);
84     virtual sal_Int32 SAL_CALL getEndIndex()
85 		throw (::com::sun::star::uno::RuntimeException);
86     virtual sal_Bool SAL_CALL isValid(  )
87 		throw (::com::sun::star::uno::RuntimeException);
88 };
89 
90 #endif
91 
92