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_ACCESSIBLEPREVIEWTABLE_HXX
26 #define _SC_ACCESSIBLEPREVIEWTABLE_HXX
27 
28 #include "AccessibleContextBase.hxx"
29 #include <com/sun/star/accessibility/XAccessibleTable.hpp>
30 #include <cppuhelper/implbase1.hxx>
31 
32 class ScPreviewShell;
33 class ScPreviewTableInfo;
34 
35 typedef cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleTable>
36 					ScAccessiblePreviewTableImpl;
37 
38 class ScAccessiblePreviewTable :
39 		public ScAccessibleContextBase,
40 		public ScAccessiblePreviewTableImpl
41 {
42 public:
43 	ScAccessiblePreviewTable( const ::com::sun::star::uno::Reference<
44 						        ::com::sun::star::accessibility::XAccessible>& rxParent,
45 							ScPreviewShell* pViewShell, sal_Int32 nIndex );
46 
47 protected:
48 	virtual ~ScAccessiblePreviewTable();
49 
50     using ScAccessibleContextBase::IsDefunc;
51 
52 public:
53     using ScAccessibleContextBase::disposing;
54  	virtual void SAL_CALL disposing();
55 
56 	//=====  SfxListener  =====================================================
57 
58 	virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
59 
60 	///=====  XInterface  =====================================================
61 
62 	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
63 		::com::sun::star::uno::Type const & rType )
64 		throw (::com::sun::star::uno::RuntimeException);
65 
66 	virtual void SAL_CALL acquire() throw ();
67 
68 	virtual void SAL_CALL release() throw ();
69 
70 	//=====  XAccessibleTable  ================================================
71 
72     virtual sal_Int32 SAL_CALL getAccessibleRowCount() throw (::com::sun::star::uno::RuntimeException);
73     virtual sal_Int32 SAL_CALL getAccessibleColumnCount() throw (::com::sun::star::uno::RuntimeException);
74     virtual ::rtl::OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow )
75 								throw (::com::sun::star::lang::IndexOutOfBoundsException,
76 									::com::sun::star::uno::RuntimeException);
77     virtual ::rtl::OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn )
78 								throw (::com::sun::star::lang::IndexOutOfBoundsException,
79 									::com::sun::star::uno::RuntimeException);
80     virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
81     							throw (::com::sun::star::lang::IndexOutOfBoundsException,
82     								::com::sun::star::uno::RuntimeException);
83     virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn )
84     							throw (::com::sun::star::lang::IndexOutOfBoundsException,
85     								::com::sun::star::uno::RuntimeException);
86     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL
87     						getAccessibleRowHeaders() throw (::com::sun::star::uno::RuntimeException);
88     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL
89     						getAccessibleColumnHeaders() throw (::com::sun::star::uno::RuntimeException);
90     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows()
91     							throw (::com::sun::star::uno::RuntimeException);
92     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns()
93     							throw (::com::sun::star::uno::RuntimeException);
94     virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow )
95     							throw (::com::sun::star::lang::IndexOutOfBoundsException,
96     								::com::sun::star::uno::RuntimeException);
97     virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn )
98     							throw (::com::sun::star::lang::IndexOutOfBoundsException,
99     								::com::sun::star::uno::RuntimeException);
100     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
101     						getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn )
102     							throw (::com::sun::star::lang::IndexOutOfBoundsException,
103     								::com::sun::star::uno::RuntimeException);
104     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
105     						getAccessibleCaption() throw (::com::sun::star::uno::RuntimeException);
106     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
107     						getAccessibleSummary() throw (::com::sun::star::uno::RuntimeException);
108     virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn )
109     							throw (::com::sun::star::lang::IndexOutOfBoundsException,
110     								::com::sun::star::uno::RuntimeException);
111     virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn )
112     							throw (::com::sun::star::lang::IndexOutOfBoundsException,
113     								::com::sun::star::uno::RuntimeException);
114     virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex )
115     							throw (::com::sun::star::lang::IndexOutOfBoundsException,
116     								::com::sun::star::uno::RuntimeException);
117     virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex )
118     							throw (::com::sun::star::lang::IndexOutOfBoundsException,
119     								::com::sun::star::uno::RuntimeException);
120 
121 	//=====  XAccessibleComponent  ============================================
122 
123     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
124     						getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint )
125     							throw (::com::sun::star::uno::RuntimeException);
126     virtual void SAL_CALL	grabFocus() throw (::com::sun::star::uno::RuntimeException);
127 
128 	//=====  XAccessibleContext  ==============================================
129 
130     virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException);
131     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
132     						getAccessibleChild( sal_Int32 i )
133     							throw (::com::sun::star::lang::IndexOutOfBoundsException,
134     								::com::sun::star::uno::RuntimeException);
135     virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw (::com::sun::star::uno::RuntimeException);
136     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL
137     						getAccessibleStateSet() throw (::com::sun::star::uno::RuntimeException);
138 
139 	//=====  XServiceInfo  ====================================================
140 
141 	virtual ::rtl::OUString SAL_CALL getImplementationName()
142 								throw(::com::sun::star::uno::RuntimeException);
143 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
144 								throw(::com::sun::star::uno::RuntimeException);
145 
146 	//=====  XTypeProvider  ===================================================
147 
148     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL
149 		getTypes()
150 		throw (::com::sun::star::uno::RuntimeException);
151 
152 	virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
153 								throw(::com::sun::star::uno::RuntimeException);
154 
155     //=====  internal  ========================================================
SetCurrentIndexInParent(sal_Int32 nNew)156     void SetCurrentIndexInParent(sal_Int32 nNew) { mnIndex = nNew; }
157 
158 protected:
159 	virtual ::rtl::OUString SAL_CALL createAccessibleDescription(void) throw(::com::sun::star::uno::RuntimeException);
160 	virtual ::rtl::OUString SAL_CALL createAccessibleName(void) throw (::com::sun::star::uno::RuntimeException);
161 
162 	virtual Rectangle GetBoundingBoxOnScreen(void) const throw(::com::sun::star::uno::RuntimeException);
163 	virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException);
164 
165 private:
166 	ScPreviewShell*		mpViewShell;
167 	sal_Int32			mnIndex;
168 	mutable ScPreviewTableInfo*	mpTableInfo;
169 
170 	sal_Bool IsDefunc(
171 		const com::sun::star::uno::Reference<
172 		::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
173 
174 	void	FillTableInfo() const;
175 };
176 
177 
178 #endif
179