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>
26 #include <cppuhelper/implbase3.hxx>
27 #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
29 
30 class ScTabViewShell;
32 class ScChildrenShapes;
34 class VclWindowEvent;
35 
36 namespace utl
37 {
38  class AccessibleRelationSetHelper;
39 }
40 
46 typedef cppu::ImplHelper3< css::accessibility::XAccessibleSelection,
47  css::accessibility::XAccessibleExtendedAttributes,
48  css::view::XSelectionChangeListener >
50 
52  : public ScAccessibleDocumentBase,
55 {
56 public:
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 );
68 protected:
69  virtual ~ScAccessibleDocument() override;
70 
72 
73 public:
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 css::uno::Reference<
110  css::accessibility::XAccessibleStateSet> SAL_CALL
111  getAccessibleStateSet() override;
112 
113  virtual OUString SAL_CALL
114  getAccessibleName() override;
115 
116  virtual css::uno::Any SAL_CALL getExtendedAttributes() override ;
118 
119  virtual void SAL_CALL
120  selectAccessibleChild( sal_Int32 nChildIndex ) override;
121 
122  virtual sal_Bool SAL_CALL
123  isAccessibleChildSelected( sal_Int32 nChildIndex ) override;
124 
125  virtual void SAL_CALL
126  clearAccessibleSelection( ) override;
127 
128  virtual void SAL_CALL
129  selectAllAccessibleChildren( ) override;
130 
131  virtual sal_Int32 SAL_CALL
133 
134  virtual css::uno::Reference<
135  css::accessibility::XAccessible > SAL_CALL
136  getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) override;
137 
138  virtual void SAL_CALL
139  deselectAccessibleChild( sal_Int32 nChildIndex ) override;
140 
142 
143  virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent ) override;
144 
145  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
146 
148 
151  virtual OUString SAL_CALL
152  getImplementationName() override;
153 
156  virtual css::uno::Sequence< OUString> SAL_CALL
157  getSupportedServiceNames() override;
158 
160 
162  virtual css::uno::Sequence< css::uno::Type > SAL_CALL
163  getTypes() override;
164 
167  virtual css::uno::Sequence<sal_Int8> SAL_CALL
168  getImplementationId() override;
169 
171 
179  virtual tools::Rectangle GetVisibleArea() const override;
180 
191  virtual Point LogicToPixel (const Point& rPoint) const override;
192 
202  virtual Size LogicToPixel (const Size& rSize) const override;
203 
205 
207 
208  css::uno::Reference< css::accessibility::XAccessible >
210 
211 protected:
213  virtual OUString
214  createAccessibleDescription() override;
215 
217  virtual OUString
218  createAccessibleName() override;
219 
221  virtual tools::Rectangle GetBoundingBoxOnScreen() const override;
222 
224  virtual tools::Rectangle GetBoundingBox() const override;
225 
226 private:
230  std::unique_ptr<ScChildrenShapes> mpChildrenShapes;
232  css::uno::Reference<css::accessibility::XAccessible> mxTempAcc;
235 
236 public:
237  SCTAB getVisibleTable() const; // use it in ScChildrenShapes
238 
239 private:
241 
242  bool IsTableSelected() const;
243 
244  bool IsDefunc(
245  const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates);
246 
247  void AddChild(const css::uno::Reference<css::accessibility::XAccessible>& xAcc, bool bFireEvent);
248  void RemoveChild(const css::uno::Reference<css::accessibility::XAccessible>& xAcc, bool bFireEvent);
249 
250  OUString GetCurrentCellName() const;
251  static OUString GetCurrentCellDescription();
252 
254 public:
255  ScDocument *GetDocument() const ;
257 
258  virtual sal_Int32 SAL_CALL getForeground( ) override;
259 
260  virtual sal_Int32 SAL_CALL getBackground( ) override;
261 };
262 
263 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual Point LogicToPixel(const Point &rPoint) const override
Transform the specified point from internal coordinates to an absolute screen position.
sal_Int32 nIndex
rtl::Reference< utl::AccessibleRelationSetHelper > GetRelationSet(const ScAddress *pAddress) const
======== internal =====================================================
virtual OUString createAccessibleDescription() override
Return this object's description.
virtual void SAL_CALL selectionChanged(const css::lang::EventObject &aEvent) override
===== XSelectionListener =============================================
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 nIndex) override
Return the specified child or NULL if index is invalid.
ScAddress GetCurCellAddress() const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
===== SfxListener =====================================================
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int32 nSelectedChildIndex) override
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex) override
virtual void SAL_CALL acquire() noexcept override
rtl::Reference< ScAccessibleEditObject > mpTempAccEdit
virtual void SAL_CALL grabFocus() override
virtual void SAL_CALL release() noexcept override
static OUString GetCurrentCellDescription()
virtual tools::Rectangle GetBoundingBox() const override
Return the object's current bounding box relative to the parent object.
virtual sal_Int32 SAL_CALL getBackground() override
ScSplitPos
Definition: viewdata.hxx:44
virtual OUString createAccessibleName() override
Return the object's current name.
virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nChildIndex) override
virtual OUString SAL_CALL getImplementationName() override
===== XServiceInfo ===================================================
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Returns an implementation id.
virtual OUString SAL_CALL getAccessibleName() override
Return the object's current name.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &rPoint) override
===== XAccessibleComponent ============================================
virtual void SAL_CALL disposing() override
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
===== XAccessibleContext ==============================================
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) override
===== XAccessibleSelection ===========================================
ScAccessibleDocument(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ScTabViewShell *pViewShell, ScSplitPos eSplitPos)
css::uno::Reference< css::accessibility::XAccessible > mxTempAcc
css::uno::Reference< css::accessibility::XAccessible > GetAccessibleSpreadsheet()
unsigned char sal_Bool
ScTabViewShell * mpViewShell
This base class provides an implementation of the AccessibleTable service.
virtual void SAL_CALL selectAllAccessibleChildren() override
virtual tools::Rectangle GetBoundingBoxOnScreen() const override
Return the object's current bounding box relative to the desktop.
tools::Rectangle GetVisibleArea_Impl() const
===== IAccessibleViewForwarder ========================================
void AddChild(const css::uno::Reference< css::accessibility::XAccessible > &xAcc, bool bFireEvent)
DECL_LINK(WindowChildEventListener, VclWindowEvent &, void)
virtual sal_Int32 SAL_CALL getForeground() override
virtual void SAL_CALL clearAccessibleSelection() override
cppu::ImplHelper3< css::accessibility::XAccessibleSelection, css::accessibility::XAccessibleExtendedAttributes, css::view::XSelectionChangeListener > ScAccessibleDocumentImpl
This base class provides an implementation of the AccessibleContext service.
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
Return the set of current states.
rtl::Reference< ScAccessibleSpreadsheet > mpAccessibleSpreadsheet
std::unique_ptr< ScChildrenShapes > mpChildrenShapes
tools::Rectangle maVisArea
virtual void Init() override
OUString GetCurrentCellName() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
===== XTypeProvider ===================================================
virtual tools::Rectangle GetVisibleArea() const override
===== IAccessibleViewForwarder ========================================
ScDocument * GetDocument() const
virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() override
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) override
===== XInterface =====================================================
void RemoveChild(const css::uno::Reference< css::accessibility::XAccessible > &xAcc, bool bFireEvent)
virtual ~ScAccessibleDocument() override
AnyEventRef aEvent
sal_Int16 SCTAB
Definition: types.hxx:22
This base class provides an implementation of the AccessibleCell service.