Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / ui / inc / AccessiblePageHeaderArea.hxx
blobe32b2c29972dc2b893d39bff51885b187743461b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLEPAGEHEADERAREA_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLEPAGEHEADERAREA_HXX
23 #include "AccessibleContextBase.hxx"
24 #include <editeng/svxenum.hxx>
26 class EditTextObject;
27 namespace accessibility
29 class AccessibleTextHelper;
31 class ScPreviewShell;
33 class ScAccessiblePageHeaderArea
34 : public ScAccessibleContextBase
36 public:
37 //===== internal ========================================================
38 ScAccessiblePageHeaderArea(
39 const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
40 ScPreviewShell* pViewShell,
41 const EditTextObject* pEditObj,
42 bool bHeader,
43 SvxAdjust eAdjust);
44 protected:
45 virtual ~ScAccessiblePageHeaderArea();
46 public:
47 const EditTextObject* GetEditTextObject() const { return mpEditObj; }
49 using ScAccessibleContextBase::disposing;
50 virtual void SAL_CALL disposing() override;
52 ///===== SfxListener =====================================================
54 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
56 ///===== XAccessibleComponent ============================================
58 virtual css::uno::Reference< css::accessibility::XAccessible >
59 SAL_CALL getAccessibleAtPoint(
60 const css::awt::Point& rPoint )
61 throw (css::uno::RuntimeException, std::exception) override;
63 ///===== XAccessibleContext ==============================================
65 /// Return the number of currently visible children.
66 /// override to calculate this on demand
67 virtual sal_Int32 SAL_CALL
68 getAccessibleChildCount()
69 throw (css::uno::RuntimeException, std::exception) override;
71 /// Return the specified child or NULL if index is invalid.
72 /// override to calculate this on demand
73 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
74 getAccessibleChild(sal_Int32 nIndex)
75 throw (css::uno::RuntimeException,
76 css::lang::IndexOutOfBoundsException, std::exception) override;
78 /// Return the set of current states.
79 virtual css::uno::Reference<
80 css::accessibility::XAccessibleStateSet> SAL_CALL
81 getAccessibleStateSet()
82 throw (css::uno::RuntimeException, std::exception) override;
84 ///===== XServiceInfo ====================================================
86 /** Returns an identifier for the implementation of this object.
88 virtual OUString SAL_CALL
89 getImplementationName()
90 throw (css::uno::RuntimeException, std::exception) override;
92 /** Returns a list of all supported services. In this case that is just
93 the AccessibleContext and Accessible service.
95 virtual css::uno::Sequence< OUString> SAL_CALL
96 getSupportedServiceNames()
97 throw (css::uno::RuntimeException, std::exception) override;
99 ///===== XTypeProvider ===================================================
101 /** Returns a implementation id.
103 virtual css::uno::Sequence<sal_Int8> SAL_CALL
104 getImplementationId()
105 throw (css::uno::RuntimeException, std::exception) override;
107 protected:
108 virtual OUString SAL_CALL createAccessibleDescription() throw(css::uno::RuntimeException, std::exception) override;
109 virtual OUString SAL_CALL createAccessibleName() throw (css::uno::RuntimeException, std::exception) override;
111 virtual Rectangle GetBoundingBoxOnScreen() const throw(css::uno::RuntimeException, std::exception) override;
112 virtual Rectangle GetBoundingBox() const throw (css::uno::RuntimeException, std::exception) override;
114 private:
115 EditTextObject* mpEditObj;
116 accessibility::AccessibleTextHelper* mpTextHelper;
117 ScPreviewShell* mpViewShell;
118 bool mbHeader;
119 SvxAdjust meAdjust;
121 void CreateTextHelper();
124 #endif
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */