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 
28 
29 #ifndef _SC_ACCESSIBLEPAGEHEADERAREA_HXX
30 #define _SC_ACCESSIBLEPAGEHEADERAREA_HXX
31 
32 #ifndef _SC_ACCESSIBLE_CONTEXT_BASE_HXX
33 #include "AccessibleContextBase.hxx"
34 #endif
35 #include <editeng/svxenum.hxx>
36 
37 class EditTextObject;
38 namespace accessibility
39 {
40     class AccessibleTextHelper;
41 }
42 class ScPreviewShell;
43 
44 class ScAccessiblePageHeaderArea
45 	:	public ScAccessibleContextBase
46 {
47 public:
48 	//=====  internal  ========================================================
49 	ScAccessiblePageHeaderArea(
50         const ::com::sun::star::uno::Reference<
51         ::com::sun::star::accessibility::XAccessible>& rxParent,
52         ScPreviewShell* pViewShell,
53         const EditTextObject* pEditObj,
54         sal_Bool bHeader,
55         SvxAdjust eAdjust);
56 protected:
57 	virtual ~ScAccessiblePageHeaderArea	(void);
58 public:
59     const EditTextObject* GetEditTextObject() const { return mpEditObj; }
60 
61     using ScAccessibleContextBase::disposing;
62     virtual void SAL_CALL disposing();
63 
64    ///=====  SfxListener  =====================================================
65 
66 	virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
67 
68     ///=====  XAccessibleComponent  ============================================
69 
70     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
71 		SAL_CALL getAccessibleAtPoint(
72 		const ::com::sun::star::awt::Point& rPoint )
73 		throw (::com::sun::star::uno::RuntimeException);
74 
75 	///=====  XAccessibleContext  ==============================================
76 
77     ///	Return the number of currently visible children.
78     // is overloaded to calculate this on demand
79     virtual sal_Int32 SAL_CALL
80     	getAccessibleChildCount(void)
81     				throw (::com::sun::star::uno::RuntimeException);
82 
83     ///	Return the specified child or NULL if index is invalid.
84     // is overloaded to calculate this on demand
85     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
86     	getAccessibleChild(sal_Int32 nIndex)
87         throw (::com::sun::star::uno::RuntimeException,
88 				::com::sun::star::lang::IndexOutOfBoundsException);
89 
90 	///	Return the set of current states.
91 	virtual ::com::sun::star::uno::Reference<
92             ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
93     	getAccessibleStateSet(void)
94         throw (::com::sun::star::uno::RuntimeException);
95 
96 	///=====  XServiceInfo  ====================================================
97 
98     /**	Returns an identifier for the implementation of this object.
99     */
100 	virtual ::rtl::OUString SAL_CALL
101     	getImplementationName(void)
102         throw (::com::sun::star::uno::RuntimeException);
103 
104     /** Returns a list of all supported services.  In this case that is just
105     	the AccessibleContext and Accessible service.
106     */
107 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
108     	getSupportedServiceNames(void)
109         throw (::com::sun::star::uno::RuntimeException);
110 
111     ///=====  XTypeProvider  ===================================================
112 
113     /**	Returns a implementation id.
114     */
115     virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
116         getImplementationId(void)
117         throw (::com::sun::star::uno::RuntimeException);
118 
119 protected:
120 	virtual ::rtl::OUString SAL_CALL createAccessibleDescription(void) throw(::com::sun::star::uno::RuntimeException);
121 	virtual ::rtl::OUString SAL_CALL createAccessibleName(void) throw (::com::sun::star::uno::RuntimeException);
122 
123 	virtual Rectangle GetBoundingBoxOnScreen(void) const throw(::com::sun::star::uno::RuntimeException);
124 	virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException);
125 
126 private:
127     EditTextObject* mpEditObj;
128 	accessibility::AccessibleTextHelper* mpTextHelper;
129     ScPreviewShell* mpViewShell;
130     sal_Bool mbHeader;
131     SvxAdjust meAdjust;
132 
133 	void CreateTextHelper();
134 };
135 
136 
137 #endif
138 
139