LibreOffice Module sd (master) 1
AccessibleSlideSorterView.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#pragma once
21
24#include <com/sun/star/accessibility/XAccessible.hpp>
25#include <com/sun/star/accessibility/XAccessibleContext.hpp>
26#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
27#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
28#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
29#include <com/sun/star/lang/XServiceInfo.hpp>
30#include <vcl/vclptr.hxx>
31#include <vcl/window.hxx>
32
33#include <memory>
34
35namespace sd::slidesorter { class SlideSorter; }
36
37namespace accessibility {
38
39class AccessibleSlideSorterObject;
40
41typedef ::cppu::WeakComponentImplHelper<
42 css::accessibility::XAccessible,
43 css::accessibility::XAccessibleEventBroadcaster,
44 css::accessibility::XAccessibleContext,
45 css::accessibility::XAccessibleComponent,
46 css::accessibility::XAccessibleSelection,
47 css::lang::XServiceInfo
49
55 : public cppu::BaseMutex,
57{
58public:
61 vcl::Window* pParentWindow);
62
63 void Init();
64
65 virtual ~AccessibleSlideSorterView() override;
66
70 void Destroyed();
71
73 short nEventId,
74 const css::uno::Any& rOldValue,
75 const css::uno::Any& rNewValue);
76
77 virtual void SAL_CALL disposing() override;
78
84
85 //===== XAccessible =======================================================
86
87 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL
88 getAccessibleContext() override;
89
90 //===== XAccessibleEventBroadcaster =======================================
91 virtual void SAL_CALL
93 const css::uno::Reference< css::accessibility::XAccessibleEventListener >& rxListener) override;
94
95 virtual void SAL_CALL
97 const css::uno::Reference< css::accessibility::XAccessibleEventListener >& rxListener ) override;
98
99 //===== XAccessibleContext ==============================================
100
102 virtual sal_Int64 SAL_CALL
103 getAccessibleChildCount() override;
104
106 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
107 getAccessibleChild (sal_Int64 nIndex) override;
108
110 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
111 getAccessibleParent() override;
112
114 virtual sal_Int64 SAL_CALL
116
118 virtual sal_Int16 SAL_CALL
119 getAccessibleRole() override;
120
122 virtual OUString SAL_CALL
123 getAccessibleDescription() override;
124
126 virtual OUString SAL_CALL
127 getAccessibleName() override;
128
130 virtual css::uno::Reference<
131 css::accessibility::XAccessibleRelationSet> SAL_CALL
132 getAccessibleRelationSet() override;
133
135 virtual sal_Int64 SAL_CALL getAccessibleStateSet() override;
136
140 virtual css::lang::Locale SAL_CALL
141 getLocale() override;
142
143 //===== XAccessibleComponent ================================================
144
149 virtual sal_Bool SAL_CALL containsPoint (
150 const css::awt::Point& aPoint) override;
151
154 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
156 const css::awt::Point& aPoint) override;
157
160 virtual css::awt::Rectangle SAL_CALL getBounds() override;
161
165 virtual css::awt::Point SAL_CALL getLocation() override;
166
170 virtual css::awt::Point SAL_CALL getLocationOnScreen() override;
171
175 virtual css::awt::Size SAL_CALL getSize() override;
176
179 virtual void SAL_CALL grabFocus() override;
180
183 virtual sal_Int32 SAL_CALL getForeground() override;
184
187 virtual sal_Int32 SAL_CALL getBackground() override;
188
189 //===== XAccessibleSelection ==============================================
190
191 virtual void SAL_CALL
192 selectAccessibleChild (sal_Int64 nChildIndex) override;
193
194 virtual sal_Bool SAL_CALL
195 isAccessibleChildSelected( sal_Int64 nChildIndex ) override;
196
197 virtual void SAL_CALL
198 clearAccessibleSelection( ) override;
199
200 virtual void SAL_CALL
201 selectAllAccessibleChildren( ) override;
202
203 virtual sal_Int64 SAL_CALL
205
206 virtual css::uno::Reference<
207 css::accessibility::XAccessible > SAL_CALL
208 getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override;
209
210 virtual void SAL_CALL
211 deselectAccessibleChild( sal_Int64 nSelectedChildIndex ) override;
212
213 //===== XServiceInfo ====================================================
214
217 virtual OUString SAL_CALL
218 getImplementationName() override;
219
222 virtual sal_Bool SAL_CALL
223 supportsService (const OUString& sServiceName) override;
224
227 virtual css::uno::Sequence< OUString> SAL_CALL
228 getSupportedServiceNames() override;
229
230 void SwitchViewActivated();
231private:
232 class Implementation;
233 ::std::unique_ptr<Implementation> mpImpl;
234
236
237 sal_uInt32 mnClientId;
238
240
248 void ThrowIfDisposed();
249};
250
251} // end of namespace ::accessibility
252
253/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OUStringLiteral sServiceName
This class makes page objects of the slide sorter accessible.
Inner implementation class of the AccessibleSlideSorterView.
This class makes the SlideSorterViewShell accessible.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
Return the specified child or throw exception.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Return a reference to the parent.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
The default implementation returns an empty reference.
virtual css::lang::Locale SAL_CALL getLocale() override
Return the parents locale or throw exception if this object has no parent yet/anymore.
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int64 nChildIndex) override
virtual void SAL_CALL deselectAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return NULL to indicate that an empty relation set.
void ThrowIfDisposed()
Check whether or not the object has been disposed (or is in the state of being disposed).
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
The default implementation uses the result of <member>getBounds</member> to determine whether the giv...
virtual sal_Int16 SAL_CALL getAccessibleRole() override
Return this object's role.
::std::unique_ptr< Implementation > mpImpl
virtual OUString SAL_CALL getImplementationName() override
Returns an identifier for the implementation of this object.
virtual OUString SAL_CALL getAccessibleDescription() override
Return this object's description.
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
The default implementation returns an empty position, i.e.
virtual css::awt::Point SAL_CALL getLocation() override
The default implementation uses the result of <member>getBounds</member> to determine the location.
virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
Return the number of currently visible children.
virtual void SAL_CALL selectAllAccessibleChildren() override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Return the set of current states.
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual void SAL_CALL selectAccessibleChild(sal_Int64 nChildIndex) override
virtual css::awt::Rectangle SAL_CALL getBounds() override
The default implementation returns an empty rectangle.
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
Return this objects index among the parents children.
virtual sal_Int32 SAL_CALL getForeground() override
Returns black as the default foreground color.
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
Return whether the specified service is supported by this class.
void FireAccessibleEvent(short nEventId, const css::uno::Any &rOldValue, const css::uno::Any &rNewValue)
virtual OUString SAL_CALL getAccessibleName() override
Return the object's current name.
virtual void SAL_CALL grabFocus() override
The default implementation does nothing.
AccessibleSlideSorterObject * GetAccessibleChildImplementation(sal_Int32 nIndex)
Return the implementation object of the specified child.
AccessibleSlideSorterView(::sd::slidesorter::SlideSorter &rSlideSorter, vcl::Window *pParentWindow)
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &rxListener) override
virtual css::awt::Size SAL_CALL getSize() override
The default implementation uses the result of <member>getBounds</member> to determine the size.
void Destroyed()
This method acts like a dispose call.
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &rxListener) override
virtual sal_Int32 SAL_CALL getBackground() override
Returns white as the default background color.
virtual void SAL_CALL clearAccessibleSelection() override
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
Definition: SlideSorter.hxx:62
sal_Int32 nIndex
::cppu::WeakComponentImplHelper< css::accessibility::XAccessible, css::accessibility::XAccessibleEventBroadcaster, css::accessibility::XAccessibleContext, css::accessibility::XAccessibleComponent, css::accessibility::XAccessibleSelection, css::lang::XServiceInfo > AccessibleSlideSorterViewBase
unsigned char sal_Bool