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 #ifndef ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLHEADERCELL_HXX
24 #define ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLHEADERCELL_HXX
25 
26 #include "accessibility/extended/AccessibleGridControlTableCell.hxx"
27 
28 namespace accessibility
29 {
30 	class AccessibleGridControlHeaderCell : public AccessibleGridControlCell, public ::com::sun::star::accessibility::XAccessible
31 	{
32 		sal_Int32	m_nColumnRowId;
33 	public:
34 		AccessibleGridControlHeaderCell(sal_Int32 _nColumnRowId,
35 						const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent,
36 						::svt::table::IAccessibleTable& _rTable,
37 						::svt::table::AccessibleTableControlObjType  _eObjType);
38 		/** @return  The count of visible children. */
39 		virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw ( ::com::sun::star::uno::RuntimeException );
40 
41 		/** @return  The XAccessible interface of the specified child. */
42 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
43 			getAccessibleChild( sal_Int32 nChildIndex ) throw ( ::com::sun::star::lang::IndexOutOfBoundsException,::com::sun::star::uno::RuntimeException );
44 
45 		/** @return  The index of this object among the parent's children. */
46 		virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw ( ::com::sun::star::uno::RuntimeException );
47 
48 		/** Grabs the focus to the GridControl. */
49 		virtual void SAL_CALL grabFocus() throw ( ::com::sun::star::uno::RuntimeException );
50 
51 		// XInterface -------------------------------------------------------------
52 
53 		/** Queries for a new interface. */
54 		::com::sun::star::uno::Any SAL_CALL queryInterface(
55 				const ::com::sun::star::uno::Type& rType )
56 			throw ( ::com::sun::star::uno::RuntimeException );
57 
58 		/** Aquires the object (calls acquire() on base class). */
59 		virtual void SAL_CALL acquire() throw ();
60 
61 		/** Releases the object (calls release() on base class). */
62 		virtual void SAL_CALL release() throw ();
63 		// XAccessible ------------------------------------------------------------
64 
65 		/** @return  The XAccessibleContext interface of this object. */
66 		virtual ::com::sun::star::uno::Reference<
67 			::com::sun::star::accessibility::XAccessibleContext > SAL_CALL
68 		getAccessibleContext()
69 			throw ( ::com::sun::star::uno::RuntimeException );
70 		//-------------------------------------------------------------------------
isRowBarCell() const71 		inline sal_Bool isRowBarCell() const
72 		{
73 			return getType() == ::svt::table::TCTYPE_ROWHEADERCELL;
74 		}
75 
76 		/** @return
77 				The name of this class.
78 		*/
79 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw ( ::com::sun::star::uno::RuntimeException );
80 
81 		/** Creates a new AccessibleStateSetHelper and fills it with states of the
82 			current object.
83 			@return
84 				A filled AccessibleStateSetHelper.
85 		*/
86 		::utl::AccessibleStateSetHelper* implCreateStateSetHelper();
87 
88 	protected:
89 		virtual Rectangle implGetBoundingBox();
90 
91 		virtual Rectangle implGetBoundingBoxOnScreen();
92 	private:
93 		::rtl::OUString m_sHeaderName;
94 	};
95 }
96 
97 #endif // ACCESSIBILITY_EXT_ACCESSIBLEGRIDCONTROLHEADERCELL_HXX
98 
99