LibreOffice Module sw (master) 1
accdoc.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
22#include "acccontext.hxx"
23#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
24#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
26#include <vcl/window.hxx>
27
28// base class for SwAccessibleDocument (in this same header file) and
29// SwAccessiblePreview
31{
32 css::uno::Reference< css::accessibility::XAccessible> mxParent;
33
34 VclPtr<vcl::Window> mpChildWin; // protected by solar mutex
35
37
38protected:
39 virtual ~SwAccessibleDocumentBase() override;
40
41public:
42 SwAccessibleDocumentBase(std::shared_ptr<SwAccessibleMap> const& pInitMap);
43
44 void SetVisArea();
45
46 void AddChild( vcl::Window *pWin, bool bFireEvent = true );
47 void RemoveChild( vcl::Window *pWin );
48
49 // XAccessibleContext
50
51 // Return the number of currently visible children.
52 virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
53
54 // Return the specified child or NULL if index is invalid.
55 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
56 getAccessibleChild (sal_Int64 nIndex) override;
57
58 // Return a reference to the parent.
59 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
60 getAccessibleParent() override;
61
62 // Return this objects index among the parents children.
63 virtual sal_Int64 SAL_CALL
65
66 // Return this object's description.
67 virtual OUString SAL_CALL
68 getAccessibleDescription() override;
69
70 virtual OUString SAL_CALL getAccessibleName() override;
71
72 // XAccessibleComponent
73 virtual sal_Bool SAL_CALL containsPoint(
74 const css::awt::Point& aPoint ) override;
75
76 virtual css::uno::Reference<
77 css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(
78 const css::awt::Point& aPoint ) override;
79
80 virtual css::awt::Rectangle SAL_CALL getBounds() override;
81
82 virtual css::awt::Point SAL_CALL getLocation() override;
83
84 virtual css::awt::Point SAL_CALL getLocationOnScreen() override;
85
86 virtual css::awt::Size SAL_CALL getSize() override;
87};
88
93 public css::accessibility::XAccessibleSelection,
94 public css::accessibility::XAccessibleExtendedAttributes
95{
96 // Implementation for XAccessibleSelection interface
98
99protected:
100 // Set states for getAccessibleStateSet.
101 // This derived class additionally sets MULTISELECTABLE(1)
102 virtual void GetStates( sal_Int64& rStateSet ) override;
103
104 virtual ~SwAccessibleDocument() override;
105
106public:
107 SwAccessibleDocument(std::shared_ptr<SwAccessibleMap> const& pInitMap);
108
109 DECL_LINK( WindowChildEventListener, VclWindowEvent&, void );
110
111 // XServiceInfo
112
113 // Returns an identifier for the implementation of this object.
114 virtual OUString SAL_CALL
115 getImplementationName() override;
116
117 // Return whether the specified service is supported by this class.
118 virtual sal_Bool SAL_CALL
119 supportsService (const OUString& sServiceName) override;
120
121 // Returns a list of all supported services. In this case that is just
122 // the AccessibleContext service.
123 virtual css::uno::Sequence< OUString> SAL_CALL
124 getSupportedServiceNames() override;
125
126 // XInterface
127
128 // XInterface is inherited through SwAccessibleContext and
129 // XAccessibleSelection. These methods are needed to avoid
130 // ambiguities.
131
132 virtual css::uno::Any SAL_CALL queryInterface(
133 const css::uno::Type& aType ) override;
134
135 virtual void SAL_CALL acquire( ) noexcept override
136 { SwAccessibleContext::acquire(); };
137
138 virtual void SAL_CALL release( ) noexcept override
139 { SwAccessibleContext::release(); };
140
141 // XTypeProvider
142 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
143 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
144
145 // XAccessibleSelection
146
147 virtual void SAL_CALL selectAccessibleChild(
148 sal_Int64 nChildIndex ) override;
149
150 virtual sal_Bool SAL_CALL isAccessibleChildSelected(
151 sal_Int64 nChildIndex ) override;
152 virtual void SAL_CALL clearAccessibleSelection( ) override;
153 virtual void SAL_CALL selectAllAccessibleChildren( ) override;
154 virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount( ) override;
155 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(
156 sal_Int64 nSelectedChildIndex ) override;
157
158 // index has to be treated as global child index.
159 virtual void SAL_CALL deselectAccessibleChild(
160 sal_Int64 nChildIndex ) override;
161
162 virtual css::uno::Any SAL_CALL getExtendedAttributes() override;
163
164 // thread safe C++ interface
165
166 // The object is not visible any longer and should be destroyed
167 virtual void Dispose(bool bRecursive, bool bCanSkipInvisible = true) override;
168
169 // XAccessibleComponent
170 sal_Int32 SAL_CALL getBackground() override;
171};
172
173/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OUStringLiteral sServiceName
Definition: accdoc.cxx:54
virtual OUString SAL_CALL getAccessibleName() override
Definition: accdoc.cxx:195
css::uno::Reference< css::accessibility::XAccessible > mxParent
Definition: accdoc.hxx:32
void AddChild(vcl::Window *pWin, bool bFireEvent=true)
Definition: accdoc.cxx:94
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
Definition: accdoc.cxx:262
virtual css::awt::Point SAL_CALL getLocation() override
Definition: accdoc.cxx:246
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
Definition: accdoc.cxx:131
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Definition: accdoc.cxx:312
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
Definition: accdoc.cxx:167
virtual ~SwAccessibleDocumentBase() override
Definition: accdoc.cxx:74
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
Definition: accdoc.cxx:294
virtual css::awt::Size SAL_CALL getSize() override
Definition: accdoc.cxx:278
SwAccessibleDocumentBase(std::shared_ptr< SwAccessibleMap > const &pInitMap)
Definition: accdoc.cxx:65
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Definition: accdoc.cxx:162
virtual css::awt::Rectangle SAL_CALL getBounds() override
Definition: accdoc.cxx:222
void RemoveChild(vcl::Window *pWin)
Definition: accdoc.cxx:114
VclPtr< vcl::Window > mpChildWin
Definition: accdoc.hxx:34
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
Definition: accdoc.cxx:145
virtual OUString SAL_CALL getAccessibleDescription() override
Definition: accdoc.cxx:190
access to an accessible Writer document
Definition: accdoc.hxx:95
SwAccessibleSelectionHelper maSelectionHelper
Definition: accdoc.hxx:97
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
Definition: accdoc.cxx:512
virtual void SAL_CALL selectAccessibleChild(sal_Int64 nChildIndex) override
Definition: accdoc.cxx:473
virtual ~SwAccessibleDocument() override
Definition: accdoc.cxx:369
virtual void SAL_CALL selectAllAccessibleChildren() override
Definition: accdoc.cxx:489
virtual void SAL_CALL release() noexcept override
Definition: accdoc.hxx:138
SwAccessibleDocument(std::shared_ptr< SwAccessibleMap > const &pInitMap)
Definition: accdoc.cxx:348
sal_Int32 SAL_CALL getBackground() override
Definition: accdoc.cxx:715
virtual void Dispose(bool bRecursive, bool bCanSkipInvisible=true) override
Definition: accdoc.cxx:376
virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override
Definition: accdoc.cxx:494
virtual void SAL_CALL clearAccessibleSelection() override
Definition: accdoc.cxx:485
DECL_LINK(WindowChildEventListener, VclWindowEvent &, void)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: accdoc.cxx:439
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int64 nChildIndex) override
Definition: accdoc.cxx:479
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex) override
Definition: accdoc.cxx:499
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: accdoc.cxx:459
virtual void SAL_CALL deselectAccessibleChild(sal_Int64 nChildIndex) override
Definition: accdoc.cxx:506
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
Return whether the specified service is supported by this class.
Definition: accdoc.cxx:427
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: accdoc.cxx:432
virtual void GetStates(sal_Int64 &rStateSet) override
Definition: accdoc.cxx:339
virtual void SAL_CALL acquire() noexcept override
Definition: accdoc.hxx:135
virtual OUString SAL_CALL getImplementationName() override
Definition: accdoc.cxx:422
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: accdoc.cxx:466
void SetVisArea(const SwRect &rNewVisArea)
Definition: accframe.hxx:130
unsigned char sal_Bool