xref: /trunk/main/sc/source/ui/inc/AccessiblePageHeaderArea.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_ACCESSIBLEPAGEHEADERAREA_HXX
26 #define _SC_ACCESSIBLEPAGEHEADERAREA_HXX
27 
28 #ifndef _SC_ACCESSIBLE_CONTEXT_BASE_HXX
29 #include "AccessibleContextBase.hxx"
30 #endif
31 #include <editeng/svxenum.hxx>
32 
33 class EditTextObject;
34 namespace accessibility
35 {
36     class AccessibleTextHelper;
37 }
38 class ScPreviewShell;
39 
40 class ScAccessiblePageHeaderArea
41     :   public ScAccessibleContextBase
42 {
43 public:
44     //=====  internal  ========================================================
45     ScAccessiblePageHeaderArea(
46         const ::com::sun::star::uno::Reference<
47         ::com::sun::star::accessibility::XAccessible>& rxParent,
48         ScPreviewShell* pViewShell,
49         const EditTextObject* pEditObj,
50         sal_Bool bHeader,
51         SvxAdjust eAdjust);
52 protected:
53     virtual ~ScAccessiblePageHeaderArea (void);
54 public:
GetEditTextObject() const55     const EditTextObject* GetEditTextObject() const { return mpEditObj; }
56 
57     using ScAccessibleContextBase::disposing;
58     virtual void SAL_CALL disposing();
59 
60    ///=====  SfxListener  =====================================================
61 
62     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
63 
64     ///=====  XAccessibleComponent  ============================================
65 
66     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
67         SAL_CALL getAccessibleAtPoint(
68         const ::com::sun::star::awt::Point& rPoint );
69 
70     ///=====  XAccessibleContext  ==============================================
71 
72     /// Return the number of currently visible children.
73     // is overloaded to calculate this on demand
74     virtual sal_Int32 SAL_CALL
75         getAccessibleChildCount(void);
76 
77     /// Return the specified child or NULL if index is invalid.
78     // is overloaded to calculate this on demand
79     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
80         getAccessibleChild(sal_Int32 nIndex);
81 
82     /// Return the set of current states.
83     virtual ::com::sun::star::uno::Reference<
84             ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
85         getAccessibleStateSet(void);
86 
87     ///=====  XServiceInfo  ====================================================
88 
89     /** Returns an identifier for the implementation of this object.
90     */
91     virtual ::rtl::OUString SAL_CALL
92         getImplementationName(void);
93 
94     /** Returns a list of all supported services.  In this case that is just
95         the AccessibleContext and Accessible service.
96     */
97     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
98         getSupportedServiceNames(void);
99 
100     ///=====  XTypeProvider  ===================================================
101 
102     /** Returns a implementation id.
103     */
104     virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
105         getImplementationId(void);
106 
107 protected:
108     virtual ::rtl::OUString SAL_CALL createAccessibleDescription(void);
109     virtual ::rtl::OUString SAL_CALL createAccessibleName(void);
110 
111     virtual Rectangle GetBoundingBoxOnScreen(void) const;
112     virtual Rectangle GetBoundingBox(void) const;
113 
114 private:
115     EditTextObject* mpEditObj;
116     accessibility::AccessibleTextHelper* mpTextHelper;
117     ScPreviewShell* mpViewShell;
118     sal_Bool mbHeader;
119     SvxAdjust meAdjust;
120 
121     void CreateTextHelper();
122 };
123 
124 
125 #endif
126