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