xref: /trunk/main/sw/source/core/access/acccell.hxx (revision 4d7c9de0)
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 _ACCCELL_HXX
24 #define _ACCCELL_HXX
25 
26 #include "acccontext.hxx"
27 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
28 
29 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XAccessibleExtendedAttributes_HPP_
30 #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
31 #endif
32 
33 #ifndef _ACCSELECTIONHELPER_HXX_
34 #include <accselectionhelper.hxx>
35 #endif
36 
37 class SwCellFrm;
38 class SwAccessibleTable;
39 class SwFrmFmt;
40 
41 class SwAccessibleCell : public	SwAccessibleContext,
42                   ::com::sun::star::accessibility::XAccessibleValue,
43                   ::com::sun::star::accessibility::XAccessibleSelection,
44 					public  ::com::sun::star::accessibility::XAccessibleExtendedAttributes
45 {
46     // Implementation for XAccessibleSelection interface
47     SwAccessibleSelectionHelper aSelectionHelper;
48 	sal_Bool	bIsSelected;	// protected by base class mutex
49 
50 	sal_Bool	IsSelected();
51 
52 	sal_Bool _InvalidateMyCursorPos();
53 	sal_Bool _InvalidateChildrenCursorPos( const SwFrm *pFrm );
54 
55 protected:
56 
57 	// Set states for getAccessibleStateSet.
58 	// This drived class additionaly sets SELECTABLE(1) and SELECTED(+)
59 	virtual void GetStates( ::utl::AccessibleStateSetHelper& rStateSet );
60 
61 	virtual void _InvalidateCursorPos();
62 
63 	virtual ~SwAccessibleCell();
64 
65 public:
66 
67     SwAccessibleCell( SwAccessibleMap* pInitMap, const SwCellFrm *pCellFrm );
68 
69 	virtual sal_Bool HasCursor();	// required by map to remember that object
70 
71 	//=====  XAccessibleContext  ==============================================
72 
73     ///	Return this object's description.
74 	virtual ::rtl::OUString SAL_CALL
75     	getAccessibleDescription (void)
76         throw (com::sun::star::uno::RuntimeException);
77 
78 	//=====  XServiceInfo  ====================================================
79 
80     /**	Returns an identifier for the implementation of this object.
81     */
82 	virtual ::rtl::OUString SAL_CALL
83     	getImplementationName (void)
84         throw (::com::sun::star::uno::RuntimeException);
85 
86     /**	Return whether the specified service is supported by this class.
87     */
88     virtual sal_Bool SAL_CALL
89     	supportsService (const ::rtl::OUString& sServiceName)
90         throw (::com::sun::star::uno::RuntimeException);
91 
92     /** Returns a list of all supported services.  In this case that is just
93     	the AccessibleContext service.
94     */
95 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
96     	getSupportedServiceNames (void)
97         throw (::com::sun::star::uno::RuntimeException);
98 
99 	virtual void Dispose( sal_Bool bRecursive = sal_False );
100 
101 	virtual void InvalidatePosOrSize( const SwRect& rFrm );
102 
103 	//=====  XInterface  ======================================================
104 
105     // (XInterface methods need to be implemented to disambiguate
106     // between those inherited through SwAcessibleContext and
107     // XAccessibleValue).
108 
109     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
110         const ::com::sun::star::uno::Type& aType )
111         throw (::com::sun::star::uno::RuntimeException);
112 
113     virtual void SAL_CALL acquire(  ) throw ()
114         { SwAccessibleContext::acquire(); };
115 
116     virtual void SAL_CALL release(  ) throw ()
117         { SwAccessibleContext::release(); };
118 
119 	//====== XTypeProvider ====================================================
120 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
121     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
122 
123 	//=====  XAccessibleValue  ================================================
124 
125 	//=====  XAccessibleExtendedAttributes ================================================
126 	::com::sun::star::uno::Any SAL_CALL getExtendedAttributes()
127 		throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ;
128 private:
129     SwFrmFmt* GetTblBoxFormat() const;
130 
131 public:
132     virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( )
133         throw (::com::sun::star::uno::RuntimeException);
134 
135     virtual sal_Bool SAL_CALL setCurrentValue(
136         const ::com::sun::star::uno::Any& aNumber )
137         throw (::com::sun::star::uno::RuntimeException);
138 
139     virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue(  )
140         throw (::com::sun::star::uno::RuntimeException);
141 
142     virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue(  )
143         throw (::com::sun::star::uno::RuntimeException);
144 	//=====  XAccessibleComponent  ============================================
145 	sal_Int32 SAL_CALL getBackground()
146 		throw (::com::sun::star::uno::RuntimeException);
147 
148 	//=====  XAccessibleSelection  ============================================
149 	virtual void SAL_CALL selectAccessibleChild(
150         sal_Int32 nChildIndex )
151         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
152                 ::com::sun::star::uno::RuntimeException );
153 
154     virtual sal_Bool SAL_CALL isAccessibleChildSelected(
155         sal_Int32 nChildIndex )
156         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
157                 ::com::sun::star::uno::RuntimeException );
158     virtual void SAL_CALL clearAccessibleSelection(  )
159         throw ( ::com::sun::star::uno::RuntimeException );
160     virtual void SAL_CALL selectAllAccessibleChildren(  )
161         throw ( ::com::sun::star::uno::RuntimeException );
162     virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount(  )
163         throw ( ::com::sun::star::uno::RuntimeException );
164     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(
165         sal_Int32 nSelectedChildIndex )
166         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
167                 ::com::sun::star::uno::RuntimeException);
168 
169     virtual void SAL_CALL deselectAccessibleChild(
170         sal_Int32 nSelectedChildIndex )
171         throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
172                 ::com::sun::star::uno::RuntimeException );
173 
174 	SwAccessibleTable *GetTable();
175 	::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xTableReference;
176 	SwAccessibleTable *m_pAccTable;
177 };
178 
179 
180 #endif
181 
182