/src/libreoffice/chart2/source/controller/accessibility/AccessibleTextHelper.cxx
Line | Count | Source (jump to first uncovered line) |
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 | | #include <sal/config.h> |
21 | | |
22 | | #include <memory> |
23 | | |
24 | | #include <AccessibleTextHelper.hxx> |
25 | | #include <DrawViewWrapper.hxx> |
26 | | |
27 | | #include <vcl/svapp.hxx> |
28 | | |
29 | | #include <svx/AccessibleTextHelper.hxx> |
30 | | #include <svx/unoshtxt.hxx> |
31 | | #include <toolkit/helper/vclunohelper.hxx> |
32 | | #include <vcl/window.hxx> |
33 | | |
34 | | #include <com/sun/star/awt/XWindow.hpp> |
35 | | #include <com/sun/star/accessibility/AccessibleRole.hpp> |
36 | | #include <osl/diagnose.h> |
37 | | |
38 | | using namespace ::com::sun::star; |
39 | | using namespace ::com::sun::star::accessibility; |
40 | | |
41 | | using ::com::sun::star::uno::Reference; |
42 | | |
43 | | namespace chart |
44 | | { |
45 | | |
46 | | AccessibleTextHelper::AccessibleTextHelper( |
47 | | DrawViewWrapper * pDrawViewWrapper ) : |
48 | 0 | m_pDrawViewWrapper( pDrawViewWrapper ) |
49 | 0 | {} Unexecuted instantiation: chart::AccessibleTextHelper::AccessibleTextHelper(chart::DrawViewWrapper*) Unexecuted instantiation: chart::AccessibleTextHelper::AccessibleTextHelper(chart::DrawViewWrapper*) |
50 | | |
51 | | AccessibleTextHelper::~AccessibleTextHelper() |
52 | 0 | { |
53 | 0 | } |
54 | | |
55 | | void AccessibleTextHelper::initialize(const OUString& aCID, |
56 | | const rtl::Reference<comphelper::OAccessible>& rEventSource, |
57 | | vcl::Window* pWindow) |
58 | 0 | { |
59 | 0 | OSL_ENSURE( !aCID.isEmpty(), "Empty CID" ); |
60 | 0 | assert(rEventSource.is() && "Empty Event Source"); |
61 | 0 | if (aCID.isEmpty()) |
62 | 0 | return; |
63 | | |
64 | 0 | SolarMutexGuard aSolarGuard; |
65 | |
|
66 | 0 | m_oTextHelper.reset(); |
67 | |
|
68 | 0 | if( pWindow ) |
69 | 0 | { |
70 | 0 | if (m_pDrawViewWrapper) |
71 | 0 | { |
72 | 0 | SdrObject * pTextObj = m_pDrawViewWrapper->getNamedSdrObject( aCID ); |
73 | 0 | if( pTextObj ) |
74 | 0 | { |
75 | 0 | m_oTextHelper.emplace(std::make_unique<SvxTextEditSource>(*pTextObj, nullptr, *m_pDrawViewWrapper, *pWindow->GetOutDev())); |
76 | 0 | m_oTextHelper->SetEventSource(rEventSource); |
77 | 0 | } |
78 | 0 | } |
79 | 0 | } |
80 | |
|
81 | 0 | OSL_ENSURE( m_oTextHelper, "Couldn't create text helper" ); |
82 | 0 | } |
83 | | |
84 | | // ____ XAccessibleContext ____ |
85 | | sal_Int64 SAL_CALL AccessibleTextHelper::getAccessibleChildCount() |
86 | 0 | { |
87 | 0 | if( m_oTextHelper ) |
88 | 0 | { |
89 | 0 | SolarMutexGuard aSolarGuard; |
90 | 0 | return m_oTextHelper->GetChildCount(); |
91 | 0 | } |
92 | 0 | return 0; |
93 | 0 | } |
94 | | |
95 | | Reference< XAccessible > SAL_CALL AccessibleTextHelper::getAccessibleChild( sal_Int64 i ) |
96 | 0 | { |
97 | 0 | if( m_oTextHelper ) |
98 | 0 | { |
99 | 0 | SolarMutexGuard aSolarGuard; |
100 | 0 | return m_oTextHelper->GetChild( i ); |
101 | 0 | } |
102 | 0 | return Reference< XAccessible >(); |
103 | 0 | } |
104 | | |
105 | | Reference< XAccessible > SAL_CALL AccessibleTextHelper::getAccessibleParent() |
106 | 0 | { |
107 | 0 | OSL_FAIL( "Not implemented in this helper" ); |
108 | 0 | return Reference< XAccessible >(); |
109 | 0 | } |
110 | | |
111 | | sal_Int64 SAL_CALL AccessibleTextHelper::getAccessibleIndexInParent() |
112 | 0 | { |
113 | 0 | OSL_FAIL( "Not implemented in this helper" ); |
114 | 0 | return -1; |
115 | 0 | } |
116 | | |
117 | | ::sal_Int16 SAL_CALL AccessibleTextHelper::getAccessibleRole() |
118 | 0 | { |
119 | 0 | OSL_FAIL( "Not implemented in this helper" ); |
120 | 0 | return AccessibleRole::UNKNOWN; |
121 | 0 | } |
122 | | |
123 | | OUString SAL_CALL AccessibleTextHelper::getAccessibleDescription() |
124 | 0 | { |
125 | 0 | OSL_FAIL( "Not implemented in this helper" ); |
126 | 0 | return OUString(); |
127 | 0 | } |
128 | | |
129 | | OUString SAL_CALL AccessibleTextHelper::getAccessibleName() |
130 | 0 | { |
131 | 0 | OSL_FAIL( "Not implemented in this helper" ); |
132 | 0 | return OUString(); |
133 | 0 | } |
134 | | |
135 | | Reference< XAccessibleRelationSet > SAL_CALL AccessibleTextHelper::getAccessibleRelationSet() |
136 | 0 | { |
137 | 0 | OSL_FAIL( "Not implemented in this helper" ); |
138 | 0 | return Reference< XAccessibleRelationSet >(); |
139 | 0 | } |
140 | | |
141 | | sal_Int64 SAL_CALL AccessibleTextHelper::getAccessibleStateSet() |
142 | 0 | { |
143 | 0 | OSL_FAIL( "Not implemented in this helper" ); |
144 | 0 | return 0; |
145 | 0 | } |
146 | | |
147 | | lang::Locale SAL_CALL AccessibleTextHelper::getLocale() |
148 | 0 | { |
149 | 0 | OSL_FAIL( "Not implemented in this helper" ); |
150 | 0 | return lang::Locale(); |
151 | 0 | } |
152 | | |
153 | | } // namespace chart |
154 | | |
155 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |