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