xref: /trunk/main/sw/source/core/access/acccell.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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 additionally 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 
80     //=====  XServiceInfo  ====================================================
81 
82     /** Returns an identifier for the implementation of this object.
83     */
84     virtual ::rtl::OUString SAL_CALL
85         getImplementationName (void);
86 
87     /** Return whether the specified service is supported by this class.
88     */
89     virtual sal_Bool SAL_CALL
90         supportsService (const ::rtl::OUString& sServiceName);
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 
98     virtual void Dispose( sal_Bool bRecursive = sal_False );
99 
100     virtual void InvalidatePosOrSize( const SwRect& rFrm );
101 
102     //=====  XInterface  ======================================================
103 
104     // (XInterface methods need to be implemented to disambiguate
105     // between those inherited through SwAcessibleContext and
106     // XAccessibleValue).
107 
108     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
109         const ::com::sun::star::uno::Type& aType );
110 
acquire()111     virtual void SAL_CALL acquire(  ) throw ()
112         { SwAccessibleContext::acquire(); };
113 
release()114     virtual void SAL_CALL release(  ) throw ()
115         { SwAccessibleContext::release(); };
116 
117     //====== XTypeProvider ====================================================
118     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  );
119     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  );
120 
121     //=====  XAccessibleValue  ================================================
122 
123     //=====  XAccessibleExtendedAttributes ================================================
124     ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes() ;
125 private:
126     SwFrmFmt* GetTblBoxFormat() const;
127 
128 public:
129     virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( );
130 
131     virtual sal_Bool SAL_CALL setCurrentValue(
132         const ::com::sun::star::uno::Any& aNumber );
133 
134     virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue(  );
135 
136     virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue(  );
137     //=====  XAccessibleComponent  ============================================
138     sal_Int32 SAL_CALL getBackground();
139 
140     //=====  XAccessibleSelection  ============================================
141     virtual void SAL_CALL selectAccessibleChild(
142         sal_Int32 nChildIndex );
143 
144     virtual sal_Bool SAL_CALL isAccessibleChildSelected(
145         sal_Int32 nChildIndex );
146     virtual void SAL_CALL clearAccessibleSelection(  );
147     virtual void SAL_CALL selectAllAccessibleChildren(  );
148     virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount(  );
149     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(
150         sal_Int32 nSelectedChildIndex );
151 
152     virtual void SAL_CALL deselectAccessibleChild(
153         sal_Int32 nSelectedChildIndex );
154 
155 };
156 
157 
158 #endif
159