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 
25 #ifndef _SC_ACCESSIBLEPAGEHEADER_HXX
26 #define _SC_ACCESSIBLEPAGEHEADER_HXX
27 
28 #include "AccessibleContextBase.hxx"
29 #include <editeng/svxenum.hxx>
30 
31 class ScPreviewShell;
32 class EditTextObject;
33 class ScAccessiblePageHeaderArea;
34 class ScPreviewShell;
35 
36 class ScAccessiblePageHeader : public ScAccessibleContextBase
37 {
38 public:
39 	ScAccessiblePageHeader( const ::com::sun::star::uno::Reference<
40 						        ::com::sun::star::accessibility::XAccessible>& rxParent,
41 							ScPreviewShell* pViewShell, sal_Bool bHeader, sal_Int32 nIndex );
42 
43 protected:
44 	virtual ~ScAccessiblePageHeader();
45 
46     using ScAccessibleContextBase::IsDefunc;
47 
48 public:
49     using ScAccessibleContextBase::disposing;
50  	virtual void SAL_CALL disposing();
51 
52 	//=====  SfxListener  =====================================================
53 
54 	virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
55 
56 	//=====  XAccessibleComponent  ============================================
57 
58     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
59     						getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint )
60     							throw (::com::sun::star::uno::RuntimeException);
61     virtual void SAL_CALL	grabFocus() throw (::com::sun::star::uno::RuntimeException);
62 
63 	//=====  XAccessibleContext  ==============================================
64 
65     virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException);
66     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
67     						getAccessibleChild( sal_Int32 i )
68     							throw (::com::sun::star::lang::IndexOutOfBoundsException,
69     								::com::sun::star::uno::RuntimeException);
70     virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw (::com::sun::star::uno::RuntimeException);
71     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL
72     						getAccessibleStateSet() throw (::com::sun::star::uno::RuntimeException);
73 
74 	//=====  XServiceInfo  ====================================================
75 
76 	virtual ::rtl::OUString SAL_CALL getImplementationName()
77 								throw(::com::sun::star::uno::RuntimeException);
78 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
79 								throw(::com::sun::star::uno::RuntimeException);
80 
81     //=====  internal  ========================================================
SetCurrentIndexInParent(sal_Int32 nNew)82     void SetCurrentIndexInParent(sal_Int32 nNew) { mnIndex = nNew; }
83 
84 protected:
85 	virtual ::rtl::OUString SAL_CALL createAccessibleDescription(void) throw(::com::sun::star::uno::RuntimeException);
86 	virtual ::rtl::OUString SAL_CALL createAccessibleName(void) throw (::com::sun::star::uno::RuntimeException);
87 
88 	virtual Rectangle GetBoundingBoxOnScreen(void) const throw(::com::sun::star::uno::RuntimeException);
89 	virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException);
90 
91 private:
92 	ScPreviewShell*		mpViewShell;
93 	sal_Int32			mnIndex;
94 	sal_Bool			mbHeader;
95     typedef std::vector< ScAccessiblePageHeaderArea* > ScHFAreas;
96     ScHFAreas           maAreas;
97     sal_Int32           mnChildCount;
98 
99 	sal_Bool IsDefunc(
100 		const com::sun::star::uno::Reference<
101 		::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
102 
103     void AddChild(const EditTextObject* pArea, sal_uInt32 nIndex, SvxAdjust eAdjust);
104 };
105 
106 
107 #endif
108