LibreOffice Module sc (master) 1
AccessibleDocument.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
23#include "viewdata.hxx"
24#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
25#include <com/sun/star/view/XSelectionChangeListener.hpp>
27#include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
29
30class ScTabViewShell;
34class VclWindowEvent;
35
36namespace utl
37{
38 class AccessibleRelationSetHelper;
39}
40
46typedef cppu::ImplHelper3< css::accessibility::XAccessibleSelection,
47 css::accessibility::XAccessibleExtendedAttributes,
48 css::view::XSelectionChangeListener >
50
55{
56public:
57 //===== internal ========================================================
59 const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
60 ScTabViewShell* pViewShell,
61 ScSplitPos eSplitPos);
62
63 void PreInit();
64
65 virtual void Init() override;
66
67 DECL_LINK( WindowChildEventListener, VclWindowEvent&, void );
68protected:
69 virtual ~ScAccessibleDocument() override;
70
72
73public:
74
75 virtual void SAL_CALL disposing() override;
76
78
79 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
80
82
83 virtual css::uno::Any SAL_CALL queryInterface(
84 css::uno::Type const & rType ) override;
85
86 virtual void SAL_CALL acquire() noexcept override;
87
88 virtual void SAL_CALL release() noexcept override;
89
91
92 virtual css::uno::Reference< css::accessibility::XAccessible >
93 SAL_CALL getAccessibleAtPoint(
94 const css::awt::Point& rPoint ) override;
95
96 virtual void SAL_CALL grabFocus( ) override;
97
99
101 virtual sal_Int32 SAL_CALL
102 getAccessibleChildCount() override;
103
105 virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
106 getAccessibleChild(sal_Int32 nIndex) override;
107
109 virtual sal_Int64 SAL_CALL
110 getAccessibleStateSet() override;
111
112 virtual OUString SAL_CALL
113 getAccessibleName() override;
114
115 virtual css::uno::Any SAL_CALL getExtendedAttributes() override ;
117
118 virtual void SAL_CALL
119 selectAccessibleChild( sal_Int32 nChildIndex ) override;
120
121 virtual sal_Bool SAL_CALL
122 isAccessibleChildSelected( sal_Int32 nChildIndex ) override;
123
124 virtual void SAL_CALL
125 clearAccessibleSelection( ) override;
126
127 virtual void SAL_CALL
128 selectAllAccessibleChildren( ) override;
129
130 virtual sal_Int32 SAL_CALL
132
133 virtual css::uno::Reference<
134 css::accessibility::XAccessible > SAL_CALL
135 getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) override;
136
137 virtual void SAL_CALL
138 deselectAccessibleChild( sal_Int32 nChildIndex ) override;
139
141
142 virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent ) override;
143
144 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
145
147
150 virtual OUString SAL_CALL
151 getImplementationName() override;
152
155 virtual css::uno::Sequence< OUString> SAL_CALL
156 getSupportedServiceNames() override;
157
159
161 virtual css::uno::Sequence< css::uno::Type > SAL_CALL
162 getTypes() override;
163
166 virtual css::uno::Sequence<sal_Int8> SAL_CALL
167 getImplementationId() override;
168
170
178 virtual tools::Rectangle GetVisibleArea() const override;
179
190 virtual Point LogicToPixel (const Point& rPoint) const override;
191
201 virtual Size LogicToPixel (const Size& rSize) const override;
202
204
205 rtl::Reference<utl::AccessibleRelationSetHelper> GetRelationSet(const ScAddress* pAddress) const;
206
207 css::uno::Reference< css::accessibility::XAccessible >
209
210protected:
212 virtual OUString
214
216 virtual OUString
217 createAccessibleName() override;
218
220 virtual tools::Rectangle GetBoundingBoxOnScreen() const override;
221
223 virtual tools::Rectangle GetBoundingBox() const override;
224
225private:
231 css::uno::Reference<css::accessibility::XAccessible> mxTempAcc;
232 tools::Rectangle maVisArea;
234
235public:
236 SCTAB getVisibleTable() const; // use it in ScChildrenShapes
237
238private:
240
241 bool IsTableSelected() const;
242
243 bool IsDefunc(sal_Int64 nParentStates);
244
245 void AddChild(const css::uno::Reference<css::accessibility::XAccessible>& xAcc, bool bFireEvent);
246 void RemoveChild(const css::uno::Reference<css::accessibility::XAccessible>& xAcc, bool bFireEvent);
247
248 OUString GetCurrentCellName() const;
249 static OUString GetCurrentCellDescription();
250
251 tools::Rectangle GetVisibleArea_Impl() const;
252public:
253 ScDocument *GetDocument() const ;
255
256 virtual sal_Int32 SAL_CALL getForeground( ) override;
257
258 virtual sal_Int32 SAL_CALL getBackground( ) override;
259};
260
261/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
cppu::ImplHelper3< css::accessibility::XAccessibleSelection, css::accessibility::XAccessibleExtendedAttributes, css::view::XSelectionChangeListener > ScAccessibleDocumentImpl
@descr This base class provides an implementation of the AccessibleContext service.
tools::Rectangle GetVisibleArea_Impl() const
===== IAccessibleViewForwarder ========================================
virtual void SAL_CALL selectAllAccessibleChildren() override
void AddChild(const css::uno::Reference< css::accessibility::XAccessible > &xAcc, bool bFireEvent)
ScAddress GetCurCellAddress() const
virtual void SAL_CALL clearAccessibleSelection() override
virtual void Init() override
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
===== XAccessibleContext ==============================================
virtual void SAL_CALL release() noexcept override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Returns an implementation id.
rtl::Reference< ScAccessibleSpreadsheet > mpAccessibleSpreadsheet
ScAccessibleDocument(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ScTabViewShell *pViewShell, ScSplitPos eSplitPos)
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex) override
virtual tools::Rectangle GetVisibleArea() const override
===== IAccessibleViewForwarder ========================================
virtual tools::Rectangle GetBoundingBoxOnScreen() const override
Return the object's current bounding box relative to the desktop.
css::uno::Reference< css::accessibility::XAccessible > GetAccessibleSpreadsheet()
ScDocument * GetDocument() const
virtual OUString createAccessibleName() override
Return the object's current name.
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) override
===== XInterface =====================================================
virtual void SAL_CALL acquire() noexcept override
DECL_LINK(WindowChildEventListener, VclWindowEvent &, void)
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
virtual OUString SAL_CALL getAccessibleName() override
Return the object's current name.
std::unique_ptr< ScChildrenShapes > mpChildrenShapes
static OUString GetCurrentCellDescription()
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &rPoint) override
===== XAccessibleComponent ============================================
virtual void SAL_CALL grabFocus() override
virtual tools::Rectangle GetBoundingBox() const override
Return the object's current bounding box relative to the parent object.
OUString GetCurrentCellName() const
virtual Point LogicToPixel(const Point &rPoint) const override
Transform the specified point from internal coordinates to an absolute screen position.
virtual void SAL_CALL selectionChanged(const css::lang::EventObject &aEvent) override
===== XSelectionListener =============================================
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
===== SfxListener =====================================================
virtual sal_Int32 SAL_CALL getForeground() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int32 nSelectedChildIndex) override
virtual void SAL_CALL disposing() override
ScTabViewShell * mpViewShell
virtual sal_Int32 SAL_CALL getBackground() override
virtual ~ScAccessibleDocument() override
tools::Rectangle maVisArea
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) override
===== XAccessibleSelection ===========================================
rtl::Reference< ScAccessibleEditObject > mpTempAccEdit
virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() override
rtl::Reference< utl::AccessibleRelationSetHelper > GetRelationSet(const ScAddress *pAddress) const
======== internal =====================================================
css::uno::Reference< css::accessibility::XAccessible > mxTempAcc
virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nChildIndex) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 nIndex) override
Return the specified child or NULL if index is invalid.
void RemoveChild(const css::uno::Reference< css::accessibility::XAccessible > &xAcc, bool bFireEvent)
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Return the set of current states.
virtual OUString SAL_CALL getImplementationName() override
===== XServiceInfo ===================================================
virtual OUString createAccessibleDescription() override
Return this object's description.
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
===== XTypeProvider ===================================================
@descr This base class provides an implementation of the AccessibleCell service.
@descr This base class provides an implementation of the AccessibleTable service.
Type
unsigned char sal_Bool
signed char sal_Int8
sal_Int16 SCTAB
Definition: types.hxx:22
ScSplitPos
Definition: viewdata.hxx:44