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_ACCESSIBLEDOCUMENTPAGEPREVIEW_HXX
26 #define _SC_ACCESSIBLEDOCUMENTPAGEPREVIEW_HXX
27 
28 #include "AccessibleDocumentBase.hxx"
29 
30 class ScPreviewShell;
31 class ScNotesChilds;
32 class ScShapeChilds;
33 class ScAccessiblePreviewTable;
34 class ScAccessiblePageHeader;
35 
36 class ScAccessibleDocumentPagePreview
37 	:	public ScAccessibleDocumentBase
38 {
39 public:
40 	//=====  internal  ========================================================
41 	ScAccessibleDocumentPagePreview(
42         const ::com::sun::star::uno::Reference<
43 	        ::com::sun::star::accessibility::XAccessible>& rxParent,
44 	    ScPreviewShell* pViewShell );
45 protected:
46 	virtual ~ScAccessibleDocumentPagePreview(void);
47 
48     using ScAccessibleDocumentBase::IsDefunc;
49 
50 public:
51     using ScAccessibleContextBase::disposing;
52 
53  	virtual void SAL_CALL disposing();
54 
55    ///=====  SfxListener  =====================================================
56 
57 	virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
58 
59 	///=====  XAccessibleComponent  ============================================
60 
61     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
62 		SAL_CALL getAccessibleAtPoint(
63 		const ::com::sun::star::awt::Point& rPoint )
64 		throw (::com::sun::star::uno::RuntimeException);
65 
66     virtual void SAL_CALL grabFocus(  )
67 		throw (::com::sun::star::uno::RuntimeException);
68 
69 	///=====  XAccessibleContext  ==============================================
70 
71     ///	Return the number of currently visible children.
72     virtual sal_Int32 SAL_CALL
73     	getAccessibleChildCount(void)
74         throw (::com::sun::star::uno::RuntimeException);
75 
76     ///	Return the specified child or NULL if index is invalid.
77     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
78     	getAccessibleChild(sal_Int32 nIndex)
79         throw (::com::sun::star::uno::RuntimeException,
80 				::com::sun::star::lang::IndexOutOfBoundsException);
81 
82     ///	Return the set of current states.
83 	virtual ::com::sun::star::uno::Reference<
84             ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
85     	getAccessibleStateSet(void)
86         throw (::com::sun::star::uno::RuntimeException);
87 
88 	///=====  XServiceInfo  ====================================================
89 
90     /**	Returns an identifier for the implementation of this object.
91     */
92 	virtual ::rtl::OUString SAL_CALL
93     	getImplementationName(void)
94         throw (::com::sun::star::uno::RuntimeException);
95 
96     /** Returns a list of all supported services.
97     */
98 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
99     	getSupportedServiceNames(void)
100         throw (::com::sun::star::uno::RuntimeException);
101 
102 	///=====  XTypeProvider  ===================================================
103 
104     /**	Returns a implementation id.
105     */
106     virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
107         getImplementationId(void)
108         throw (::com::sun::star::uno::RuntimeException);
109 
110     ///=====  internal  ========================================================
111 
112 //UNUSED2009-05 com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible >
113 //UNUSED2009-05     GetCurrentAccessibleTable();
114 
115 //UNUSED2009-05 void ChildCountChanged();
116 
117 protected:
118     ///	Return this object's description.
119 	virtual ::rtl::OUString SAL_CALL
120     	createAccessibleDescription(void)
121         throw (::com::sun::star::uno::RuntimeException);
122 
123     ///	Return the object's current name.
124 	virtual ::rtl::OUString SAL_CALL
125     	createAccessibleName(void)
126         throw (::com::sun::star::uno::RuntimeException);
127 
128 public: // needed in ScShapeChilds
129     ///	Return the object's current bounding box relative to the desktop.
130 	virtual Rectangle GetBoundingBoxOnScreen(void) const
131 		throw (::com::sun::star::uno::RuntimeException);
132 
133 protected:
134 	///	Return the object's current bounding box relative to the parent object.
135 	virtual Rectangle GetBoundingBox(void) const
136 		throw (::com::sun::star::uno::RuntimeException);
137 
138 private:
139 	ScPreviewShell*	mpViewShell;
140 	ScNotesChilds* mpNotesChilds;
141     ScShapeChilds* mpShapeChilds;
142 	ScAccessiblePreviewTable* mpTable;
143 	ScAccessiblePageHeader* mpHeader;
144 	ScAccessiblePageHeader* mpFooter;
145 
146 	sal_Bool IsDefunc(
147 		const com::sun::star::uno::Reference<
148 		::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
149 
150 	ScNotesChilds* GetNotesChilds();
151     ScShapeChilds* GetShapeChilds();
152 };
153 
154 
155 #endif
156