LibreOffice Module sd (master) 1
AccessibleDocumentViewBase.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_SD_SOURCE_UI_INC_ACCESSIBLEDOCUMENTVIEWBASE_HXX
21#define INCLUDED_SD_SOURCE_UI_INC_ACCESSIBLEDOCUMENTVIEWBASE_HXX
22
29
30#include <com/sun/star/awt/XWindowListener.hpp>
31#include <com/sun/star/awt/XFocusListener.hpp>
32#include <com/sun/star/beans/XPropertyChangeListener.hpp>
33#include <tools/link.hxx>
34
35#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
36
37#include "Window.hxx"
38
39namespace com::sun::star::accessibility { class XAccessible; }
40namespace com::sun::star::frame { class XModel; }
41namespace com::sun::star::awt { class XWindow; }
42
43class VclWindowEvent;
44
45namespace sd {
46class ViewShell;
47}
48
49namespace accessibility {
50
82 : public AccessibleContextBase,
86 public css::beans::XPropertyChangeListener,
87 public css::awt::XWindowListener,
88 public css::awt::XFocusListener,
89 public css::accessibility::XAccessibleExtendedAttributes
90{
91public:
92 //===== internal ========================================================
93
107 ::sd::Window* pSdWindow,
108 ::sd::ViewShell* pViewShell,
109 css::uno::Reference<css::frame::XController> xController,
110 const css::uno::Reference<css::accessibility::XAccessible>& rxParent);
111
112 virtual ~AccessibleDocumentViewBase() override;
113
118 virtual void Init();
119
123 DECL_LINK( WindowChildEventListener, VclWindowEvent&, void );
124
125 //===== IAccessibleViewForwarderListener ================================
126
132 virtual void ViewForwarderChanged() override;
133
134 //===== XAccessibleContext ==============================================
135
136 virtual css::uno::Reference<css::accessibility::XAccessible> SAL_CALL
137 getAccessibleParent() override;
138
142 virtual sal_Int64 SAL_CALL
143 getAccessibleChildCount() override;
144
148 virtual css::uno::Reference<css::accessibility::XAccessible> SAL_CALL
149 getAccessibleChild (sal_Int64 nIndex) override;
150
151 //===== XAccessibleComponent ============================================
152
153 virtual css::uno::Reference<css::accessibility::XAccessible > SAL_CALL
154 getAccessibleAtPoint (const css::awt::Point& aPoint) override;
155
156 virtual css::awt::Rectangle SAL_CALL getBounds() override;
157
158 virtual css::awt::Point SAL_CALL getLocation() override;
159
160 virtual css::awt::Point SAL_CALL getLocationOnScreen() override;
161
162 virtual css::awt::Size SAL_CALL getSize() override;
163
164 //===== XInterface ======================================================
165
166 virtual css::uno::Any SAL_CALL
167 queryInterface (const css::uno::Type & rType) override;
168
169 virtual void SAL_CALL
170 acquire()
171 noexcept override;
172
173 virtual void SAL_CALL
174 release()
175 noexcept override;
176
177 //===== XServiceInfo ====================================================
178
181 virtual OUString SAL_CALL
182 getImplementationName() override;
183
184 virtual css::uno::Sequence< OUString> SAL_CALL
185 getSupportedServiceNames() override;
186
187 //===== XTypeProvider ===================================================
188
189 virtual css::uno::Sequence< css::uno::Type> SAL_CALL
190 getTypes() override;
191
192 //===== lang::XEventListener ============================================
193
194 virtual void SAL_CALL
195 disposing (const css::lang::EventObject& rEventObject) override;
196
197 //===== XPropertyChangeListener =========================================
198
199 virtual void SAL_CALL
200 propertyChange (const css::beans::PropertyChangeEvent& rEventObject) override;
201
202 //===== XWindowListener =================================================
203
204 virtual void SAL_CALL
205 windowResized (const css::awt::WindowEvent& e) override;
206
207 virtual void SAL_CALL
208 windowMoved (const css::awt::WindowEvent& e) override;
209
210 virtual void SAL_CALL
211 windowShown (const css::lang::EventObject& e) override;
212
213 virtual void SAL_CALL
214 windowHidden (const css::lang::EventObject& e) override;
215
216 //===== XFocusListener =================================================
217
218 virtual void SAL_CALL focusGained (const css::awt::FocusEvent& e) override;
219 virtual void SAL_CALL focusLost (const css::awt::FocusEvent& e) override;
220 //----------------------------xAttribute----------------------------
221 virtual css::uno::Any SAL_CALL getExtendedAttributes() override;
222 ::sd::ViewShell* mpViewShell;
223private:
224
225 // return the member maMutex;
226 virtual ::osl::Mutex&
227 implGetMutex() override;
228
229 // return ourself as context in default case
230 virtual css::uno::Reference< css::accessibility::XAccessibleContext >
231 implGetAccessibleContext() override;
232
233 // return sal_False in default case
234 virtual bool
235 implIsSelected( sal_Int64 nAccessibleChildIndex ) override;
236
237 // return nothing in default case
238 virtual void
239 implSelect( sal_Int64 nAccessibleChildIndex, bool bSelect ) override;
240
241protected:
243 css::uno::Reference< css::awt::XWindow>
245
247 css::uno::Reference< css::frame::XController>
249
251 css::uno::Reference < css::frame::XModel>
253
254 // Bundle of information that is passed down the shape tree.
256
259
263 css::uno::Reference< css::accessibility::XAccessible>
265
267
268 // This method is called from the component helper base class while
269 // disposing.
270 virtual void SAL_CALL disposing() override;
271
278 virtual OUString
279 CreateAccessibleName () override;
280
288 virtual void Activated();
289
297 virtual void Deactivated();
298
310 const css::uno::Reference<css::accessibility::XAccessible>& xOLEObject);
311
312public:
314 virtual sal_Int32 SAL_CALL getForeground( ) override;
315
316 virtual sal_Int32 SAL_CALL getBackground( ) override;
317 virtual void impl_dispose();
318};
319
320} // end of namespace accessibility
321
322#endif
323
324/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class for the various document views of the Draw and Impress applications.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual void SAL_CALL windowShown(const css::lang::EventObject &e) override
virtual sal_Int32 SAL_CALL getBackground() override
virtual void SAL_CALL release() noexcept override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
This implementation either returns the active accessible OLE object if it exists and the given index ...
virtual void SAL_CALL focusLost(const css::awt::FocusEvent &e) override
virtual void SAL_CALL windowHidden(const css::lang::EventObject &e) override
void SetAccessibleOLEObject(const css::uno::Reference< css::accessibility::XAccessible > &xOLEObject)
Set or remove the currently active accessible OLE object.
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Iterate over all children and test whether the specified point lies within one of their bounding boxe...
virtual css::awt::Size SAL_CALL getSize() override
virtual sal_Int32 SAL_CALL getForeground() override
AccessibleDocumentViewBase(::sd::Window *pSdWindow, ::sd::ViewShell *pViewShell, css::uno::Reference< css::frame::XController > xController, const css::uno::Reference< css::accessibility::XAccessible > &rxParent)
Create a new object.
virtual css::awt::Point SAL_CALL getLocation() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
This implementation returns either 1 or 0 depending on whether there is an active accessible OLE obje...
virtual void Deactivated()
This method is called when (before or after?) the frame containing this document has been deactivated...
virtual void Activated()
This method is called when (after) the frame containing this document has been activated.
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
virtual bool implIsSelected(sal_Int64 nAccessibleChildIndex) override
virtual void ViewForwarderChanged() override
A view forwarder change is signalled for instance when any of the window events is received.
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &rEventObject) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > implGetAccessibleContext() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void implSelect(sal_Int64 nAccessibleChildIndex, bool bSelect) override
virtual void Init()
Initialize a new object.
css::uno::Reference< css::awt::XWindow > mxWindow
The API window that is made accessible.
css::uno::Reference< css::frame::XModel > mxModel
Model of the document.
css::uno::Reference< css::frame::XController > mxController
The controller of the window in which this view is displayed.
virtual void SAL_CALL focusGained(const css::awt::FocusEvent &e) override
virtual void SAL_CALL windowMoved(const css::awt::WindowEvent &e) override
css::uno::Reference< css::accessibility::XAccessible > mxAccessibleOLEObject
Accessible OLE object.
AccessibleViewForwarder maViewForwarder
The view forwarder passed to the children manager.
virtual OUString SAL_CALL getImplementationName() override
Returns an identifier for the implementation of this object.
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual void SAL_CALL acquire() noexcept override
virtual OUString CreateAccessibleName() override
Create a name string.
virtual void SAL_CALL windowResized(const css::awt::WindowEvent &e) override
DECL_LINK(WindowChildEventListener, VclWindowEvent &, void)
Define callback for listening to window child events of VCL.
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
Type
Reference< XController > xController