LibreOffice Module editeng (master) 1
AccessibleContextBase.hxx
Go to the documentation of this file.
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_EDITENG_ACCESSIBLECONTEXTBASE_HXX
21#define INCLUDED_EDITENG_ACCESSIBLECONTEXTBASE_HXX
22
23#include <com/sun/star/accessibility/XAccessible.hpp>
24#include <com/sun/star/accessibility/XAccessibleContext.hpp>
25#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
26#include <com/sun/star/uno/Reference.hxx>
27#include <com/sun/star/lang/XServiceInfo.hpp>
31#include <rtl/ref.hxx>
32
33namespace com::sun::star::accessibility { class XAccessibleRelationSet; }
34namespace com::sun::star::accessibility { struct AccessibleEventObject; }
35
36namespace accessibility {
37
45 : public cppu::BaseMutex,
46 public cppu::WeakComponentImplHelper<
47 css::accessibility::XAccessible,
48 css::accessibility::XAccessibleContext,
49 css::accessibility::XAccessibleEventBroadcaster,
50 css::lang::XServiceInfo
51 >
52{
53public:
54
55 //===== internal ========================================================
56
63 NotSet
64 };
65
67 css::uno::Reference< css::accessibility::XAccessible> xParent,
68 const sal_Int16 aRole);
69 virtual ~AccessibleContextBase() override;
70
71
83 void CommitChange (sal_Int16 aEventId,
84 const css::uno::Any& rNewValue,
85 const css::uno::Any& rOldValue,
86 sal_Int32 nValueIndex);
87
99 void SetAccessibleDescription (
100 const OUString& rsDescription,
101 StringOrigin eDescriptionOrigin);
102
113 void SetAccessibleName (
114 const OUString& rsName,
115 StringOrigin eNameOrigin);
116
127 virtual bool SetState (sal_Int64 aState);
128
139 virtual bool ResetState (sal_Int64 aState);
140
150 bool GetState (sal_Int64 aState);
151
160 void SetRelationSet (
161 const css::uno::Reference< css::accessibility::XAccessibleRelationSet>& rxRelationSet);
162
163
164 //===== XAccessible =====================================================
165
167 virtual css::uno::Reference< css::accessibility::XAccessibleContext> SAL_CALL
168 getAccessibleContext() override;
169
170
171 //===== XAccessibleContext ==============================================
172
174 virtual sal_Int64 SAL_CALL
175 getAccessibleChildCount() override;
176
178 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
179 getAccessibleChild (sal_Int64 nIndex) override;
180
182 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
183 getAccessibleParent() override;
184
186 virtual sal_Int64 SAL_CALL
187 getAccessibleIndexInParent() override;
188
190 virtual sal_Int16 SAL_CALL
191 getAccessibleRole() override;
192
194 virtual OUString SAL_CALL
195 getAccessibleDescription() override;
196
198 virtual OUString SAL_CALL
199 getAccessibleName() override;
200
202 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet> SAL_CALL
203 getAccessibleRelationSet() override;
204
206 virtual sal_Int64 SAL_CALL getAccessibleStateSet() override;
207
211 virtual css::lang::Locale SAL_CALL
212 getLocale() override;
213
214 //===== XAccessibleEventBroadcaster ========================================
215
216 virtual void SAL_CALL
217 addAccessibleEventListener (
218 const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener) override;
219
220 virtual void SAL_CALL
221 removeAccessibleEventListener (
222 const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener) override;
223
224
225 //===== XServiceInfo ====================================================
226
229 virtual OUString SAL_CALL
230 getImplementationName() override;
231
234 virtual sal_Bool SAL_CALL
235 supportsService (const OUString& sServiceName) override;
236
240 virtual css::uno::Sequence< OUString> SAL_CALL
241 getSupportedServiceNames() override;
242
243
244 //===== XTypeProvider ===================================================
245
248 virtual css::uno::Sequence<sal_Int8> SAL_CALL
249 getImplementationId() override;
250
257 bool IsDisposed() const;
258
259protected:
262 sal_Int64 mnStateSet;
263
267 css::uno::Reference< css::accessibility::XAccessibleRelationSet> mxRelationSet;
268
269 // This method is called from the component helper base class while disposing.
270 virtual void SAL_CALL disposing() override;
271
279 virtual OUString CreateAccessibleName();
280
281 void FireEvent (const css::accessibility::AccessibleEventObject& aEvent);
282
289 void ThrowIfDisposed();
290
297 void SetAccessibleRole( sal_Int16 _nRole );
298
299private:
301 css::uno::Reference< css::accessibility::XAccessible> mxParent;
302
308
314
318 OUString msName;
319
325
328 sal_uInt32 mnClientId;
329
332 sal_Int16 maRole;
333};
334
335}
336
337#endif
338
339/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@descr This base class provides an implementation of the AccessibleContext service.
StringOrigin
The origin of the accessible name or description.
sal_Int16 maRole
This is the role of this object.
StringOrigin meNameOrigin
The origin of the name is used to determine whether new name given to the SetAccessibleName is ignore...
css::uno::Reference< css::accessibility::XAccessible > mxParent
Reference to the parent object.
css::uno::Reference< css::accessibility::XAccessibleRelationSet > mxRelationSet
The relation set.
OUString msDescription
Description of this object.
sal_uInt32 mnClientId
client id in the AccessibleEventNotifier queue
StringOrigin meDescriptionOrigin
The origin of the description is used to determine whether new descriptions given to the SetAccessibl...
#define EDITENG_DLLPUBLIC
Definition: editengdllapi.h:28
const LanguageTag & getLocale()
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
void GetState(const SdrMarkView *pSdrView, SfxItemSet &rSet)
unsigned char sal_Bool