xref: /AOO41X/main/sc/source/ui/inc/AccessiblePageHeaderArea.hxx (revision 38d50f7b14e1cf975d8c6468d9633894cd59b523)
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         throw (::com::sun::star::uno::RuntimeException);
70 
71     ///=====  XAccessibleContext  ==============================================
72 
73     /// Return the number of currently visible children.
74     // is overloaded to calculate this on demand
75     virtual sal_Int32 SAL_CALL
76         getAccessibleChildCount(void)
77                     throw (::com::sun::star::uno::RuntimeException);
78 
79     /// Return the specified child or NULL if index is invalid.
80     // is overloaded to calculate this on demand
81     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
82         getAccessibleChild(sal_Int32 nIndex)
83         throw (::com::sun::star::uno::RuntimeException,
84                 ::com::sun::star::lang::IndexOutOfBoundsException);
85 
86     /// Return the set of current states.
87     virtual ::com::sun::star::uno::Reference<
88             ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
89         getAccessibleStateSet(void)
90         throw (::com::sun::star::uno::RuntimeException);
91 
92     ///=====  XServiceInfo  ====================================================
93 
94     /** Returns an identifier for the implementation of this object.
95     */
96     virtual ::rtl::OUString SAL_CALL
97         getImplementationName(void)
98         throw (::com::sun::star::uno::RuntimeException);
99 
100     /** Returns a list of all supported services.  In this case that is just
101         the AccessibleContext and Accessible service.
102     */
103     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
104         getSupportedServiceNames(void)
105         throw (::com::sun::star::uno::RuntimeException);
106 
107     ///=====  XTypeProvider  ===================================================
108 
109     /** Returns a implementation id.
110     */
111     virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
112         getImplementationId(void)
113         throw (::com::sun::star::uno::RuntimeException);
114 
115 protected:
116     virtual ::rtl::OUString SAL_CALL createAccessibleDescription(void) throw(::com::sun::star::uno::RuntimeException);
117     virtual ::rtl::OUString SAL_CALL createAccessibleName(void) throw (::com::sun::star::uno::RuntimeException);
118 
119     virtual Rectangle GetBoundingBoxOnScreen(void) const throw(::com::sun::star::uno::RuntimeException);
120     virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException);
121 
122 private:
123     EditTextObject* mpEditObj;
124     accessibility::AccessibleTextHelper* mpTextHelper;
125     ScPreviewShell* mpViewShell;
126     sal_Bool mbHeader;
127     SvxAdjust meAdjust;
128 
129     void CreateTextHelper();
130 };
131 
132 
133 #endif
134 
135