Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #ifndef _SC_ACCESSIBLEPAGEHEADERAREA_HXX
22 : #define _SC_ACCESSIBLEPAGEHEADERAREA_HXX
23 :
24 : #include "AccessibleContextBase.hxx"
25 : #include <editeng/svxenum.hxx>
26 :
27 : class EditTextObject;
28 : namespace accessibility
29 : {
30 : class AccessibleTextHelper;
31 : }
32 : class ScPreviewShell;
33 :
34 : class ScAccessiblePageHeaderArea
35 : : public ScAccessibleContextBase
36 : {
37 : public:
38 : //===== internal ========================================================
39 : ScAccessiblePageHeaderArea(
40 : const ::com::sun::star::uno::Reference<
41 : ::com::sun::star::accessibility::XAccessible>& rxParent,
42 : ScPreviewShell* pViewShell,
43 : const EditTextObject* pEditObj,
44 : sal_Bool bHeader,
45 : SvxAdjust eAdjust);
46 : protected:
47 : virtual ~ScAccessiblePageHeaderArea (void);
48 : public:
49 0 : const EditTextObject* GetEditTextObject() const { return mpEditObj; }
50 :
51 : using ScAccessibleContextBase::disposing;
52 : virtual void SAL_CALL disposing();
53 :
54 : ///===== SfxListener =====================================================
55 :
56 : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
57 :
58 : ///===== XAccessibleComponent ============================================
59 :
60 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
61 : SAL_CALL getAccessibleAtPoint(
62 : const ::com::sun::star::awt::Point& rPoint )
63 : throw (::com::sun::star::uno::RuntimeException);
64 :
65 : ///===== XAccessibleContext ==============================================
66 :
67 : /// Return the number of currently visible children.
68 : // is overloaded to calculate this on demand
69 : virtual sal_Int32 SAL_CALL
70 : getAccessibleChildCount(void)
71 : throw (::com::sun::star::uno::RuntimeException);
72 :
73 : /// Return the specified child or NULL if index is invalid.
74 : // is overloaded to calculate this on demand
75 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
76 : getAccessibleChild(sal_Int32 nIndex)
77 : throw (::com::sun::star::uno::RuntimeException,
78 : ::com::sun::star::lang::IndexOutOfBoundsException);
79 :
80 : /// Return the set of current states.
81 : virtual ::com::sun::star::uno::Reference<
82 : ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
83 : getAccessibleStateSet(void)
84 : throw (::com::sun::star::uno::RuntimeException);
85 :
86 : ///===== XServiceInfo ====================================================
87 :
88 : /** Returns an identifier for the implementation of this object.
89 : */
90 : virtual ::rtl::OUString SAL_CALL
91 : getImplementationName(void)
92 : throw (::com::sun::star::uno::RuntimeException);
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 : throw (::com::sun::star::uno::RuntimeException);
100 :
101 : ///===== XTypeProvider ===================================================
102 :
103 : /** Returns a implementation id.
104 : */
105 : virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
106 : getImplementationId(void)
107 : throw (::com::sun::star::uno::RuntimeException);
108 :
109 : protected:
110 : virtual ::rtl::OUString SAL_CALL createAccessibleDescription(void) throw(::com::sun::star::uno::RuntimeException);
111 : virtual ::rtl::OUString SAL_CALL createAccessibleName(void) throw (::com::sun::star::uno::RuntimeException);
112 :
113 : virtual Rectangle GetBoundingBoxOnScreen(void) const throw(::com::sun::star::uno::RuntimeException);
114 : virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException);
115 :
116 : private:
117 : EditTextObject* mpEditObj;
118 : accessibility::AccessibleTextHelper* mpTextHelper;
119 : ScPreviewShell* mpViewShell;
120 : sal_Bool mbHeader;
121 : SvxAdjust meAdjust;
122 :
123 : void CreateTextHelper();
124 : };
125 :
126 :
127 : #endif
128 :
129 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|