xref: /trunk/main/sc/source/ui/inc/AccessiblePreviewCell.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 
24 
25 #ifndef _SC_ACCESSIBLEPREVIEWCELL_HXX
26 #define _SC_ACCESSIBLEPREVIEWCELL_HXX
27 
28 #include "AccessibleCellBase.hxx"
29 
30 class ScPreviewShell;
31 
32 namespace accessibility
33 {
34     class AccessibleTextHelper;
35 }
36 
37 class ScAccessiblePreviewCell : public ScAccessibleCellBase
38 {
39 public:
40     //=====  internal  ========================================================
41     ScAccessiblePreviewCell(
42         const ::com::sun::star::uno::Reference<
43             ::com::sun::star::accessibility::XAccessible>& rxParent,
44         ScPreviewShell* pViewShell, /* const */ ScAddress& rCellAddress, sal_Int32 nIndex );
45 
46 protected:
47     virtual ~ScAccessiblePreviewCell();
48 
49     using ScAccessibleCellBase::IsDefunc;
50 
51 public:
52     using ScAccessibleCellBase::disposing;
53     virtual void SAL_CALL disposing();
54 
55     ///=====  SfxListener  =====================================================
56 
57     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
58 
59     //=====  XAccessibleComponent  ============================================
60 
61     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
62                             getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint );
63     virtual void SAL_CALL   grabFocus();
64 
65     //=====  XAccessibleContext  ==============================================
66 
67     // overloaded to calculate this on demand
68     virtual sal_Int32 SAL_CALL getAccessibleChildCount();
69     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
70                             getAccessibleChild( sal_Int32 i );
71 
72     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL
73                             getAccessibleStateSet();
74 
75     //=====  XServiceInfo  ====================================================
76 
77     virtual ::rtl::OUString SAL_CALL getImplementationName();
78     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
79 
80     ///=====  XTypeProvider  ===================================================
81 
82     /** Returns a implementation id.
83     */
84     virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
85         getImplementationId(void);
86 
87 protected:
88     virtual Rectangle GetBoundingBoxOnScreen(void) const;
89     virtual Rectangle GetBoundingBox(void) const;
90 
91 private:
92     ScPreviewShell* mpViewShell;
93 
94     accessibility::AccessibleTextHelper* mpTextHelper;
95 
96     sal_Bool IsDefunc(
97         const com::sun::star::uno::Reference<
98         ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
99     virtual sal_Bool IsEditable(
100         const com::sun::star::uno::Reference<
101         ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
102     sal_Bool IsOpaque(
103         const com::sun::star::uno::Reference<
104         ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
105 
106     void CreateTextHelper();
107 
108 };
109 
110 #endif
111