Debian Codegraph @

chart2/source/controller/inc/AccessibleTextHelper.hxx

raw
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 #pragma once
20
21 #include <comphelper/OAccessible.hxx>
22 #include <comphelper/compbase.hxx>
23 #include <svx/AccessibleTextHelper.hxx>
24 #include <vcl/window.hxx>
25 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
26
27
28 namespace chart
29 {
30
31 class DrawViewWrapper;
32
33 namespace impl
34 {
35 typedef comphelper::WeakComponentImplHelper<
36 css::accessibility::XAccessibleContext >
37 AccessibleTextHelper_Base;
38 }
39
40 class AccessibleTextHelper final :
41 public impl::AccessibleTextHelper_Base
42 {
43 public:
44 explicit AccessibleTextHelper( DrawViewWrapper * pDrawViewWrapper );
45 virtual ~AccessibleTextHelper() override;
46
47 /** Must be called at least once for this helper class to work.
48
49 mandatory parameter 0: type string. This is the CID that is used to find
50 the corresponding drawing object that contains the text that should
51 be handled by this helper class.
52 1
53 mandatory parameter 1: type XAccessible. Is used as EventSource for the
54 ::accessibility::AccessibleTextHelper (svx)
55
56 mandatory parameter 2: type vcl::Window. The Window that shows the
57 text currently.
58 */
59 void initialize(const OUString& aCID,
60 const rtl::Reference<comphelper::OAccessible>& rEventSource,
61 vcl::Window* pWindow);
62
63 // ____ XAccessibleContext ____
64 virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
65 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(
66 sal_Int64 i ) override;
67 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override;
68 virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override;
69 virtual ::sal_Int16 SAL_CALL getAccessibleRole() override;
70 virtual OUString SAL_CALL getAccessibleDescription() override;
71 virtual OUString SAL_CALL getAccessibleName() override;
72 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override;
73 virtual sal_Int64 SAL_CALL getAccessibleStateSet() override;
74 virtual css::lang::Locale SAL_CALL getLocale() override;
75
76 private:
77 std::optional<::accessibility::AccessibleTextHelper> m_oTextHelper;
78 DrawViewWrapper * m_pDrawViewWrapper;
79 };
80
81 } // namespace chart
82
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */