/src/libreoffice/sc/source/ui/inc/AccessiblePageHeaderArea.hxx
Line | Count | Source |
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 | | #pragma once |
21 | | |
22 | | #include "AccessibleContextBase.hxx" |
23 | | #include <editeng/svxenum.hxx> |
24 | | |
25 | | class EditTextObject; |
26 | | namespace accessibility |
27 | | { |
28 | | class AccessibleTextHelper; |
29 | | } |
30 | | class ScPreviewShell; |
31 | | |
32 | | class ScAccessiblePageHeaderArea final |
33 | | : public ScAccessibleContextBase |
34 | | { |
35 | | public: |
36 | | ScAccessiblePageHeaderArea( |
37 | | const css::uno::Reference<css::accessibility::XAccessible>& rxParent, |
38 | | ScPreviewShell* pViewShell, |
39 | | const EditTextObject* pEditObj, |
40 | | SvxAdjust eAdjust); |
41 | | protected: |
42 | | virtual ~ScAccessiblePageHeaderArea() override; |
43 | | public: |
44 | 0 | const EditTextObject* GetEditTextObject() const { return mpEditObj.get(); } |
45 | | |
46 | | using ScAccessibleContextBase::disposing; |
47 | | virtual void SAL_CALL disposing() override; |
48 | | |
49 | | ///===== SfxListener ===================================================== |
50 | | |
51 | | virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; |
52 | | |
53 | | ///===== XAccessibleComponent ============================================ |
54 | | |
55 | | virtual css::uno::Reference< css::accessibility::XAccessible > |
56 | | SAL_CALL getAccessibleAtPoint( |
57 | | const css::awt::Point& rPoint ) override; |
58 | | |
59 | | ///===== XAccessibleContext ============================================== |
60 | | |
61 | | /// Return the number of currently visible children. |
62 | | /// override to calculate this on demand |
63 | | virtual sal_Int64 SAL_CALL |
64 | | getAccessibleChildCount() override; |
65 | | |
66 | | /// Return the specified child or NULL if index is invalid. |
67 | | /// override to calculate this on demand |
68 | | virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL |
69 | | getAccessibleChild(sal_Int64 nIndex) override; |
70 | | |
71 | | /// Return the set of current states. |
72 | | virtual sal_Int64 SAL_CALL |
73 | | getAccessibleStateSet() override; |
74 | | |
75 | | protected: |
76 | | virtual OUString createAccessibleDescription() override; |
77 | | virtual OUString createAccessibleName() override; |
78 | | |
79 | | virtual AbsoluteScreenPixelRectangle GetBoundingBoxOnScreen() override; |
80 | | virtual tools::Rectangle GetBoundingBox() override; |
81 | | |
82 | | private: |
83 | | std::unique_ptr<EditTextObject> mpEditObj; |
84 | | std::unique_ptr<accessibility::AccessibleTextHelper> mpTextHelper; |
85 | | ScPreviewShell* mpViewShell; |
86 | | SvxAdjust meAdjust; |
87 | | |
88 | | void CreateTextHelper(); |
89 | | }; |
90 | | |
91 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |