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 #ifndef INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLEDOCUMENT_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLEDOCUMENT_HXX
22 
24 #include "viewdata.hxx"
25 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
26 #include <com/sun/star/view/XSelectionChangeListener.hpp>
27 #include <cppuhelper/implbase3.hxx>
28 #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
30 
31 class ScTabViewShell;
33 class ScChildrenShapes;
35 class VclWindowEvent;
36 
37 namespace utl
38 {
39  class AccessibleRelationSetHelper;
40 }
41 
47 typedef cppu::ImplHelper3< css::accessibility::XAccessibleSelection,
48  css::accessibility::XAccessibleExtendedAttributes,
49  css::view::XSelectionChangeListener >
51 
53  : public ScAccessibleDocumentBase,
56 {
57 public:
58  //===== internal ========================================================
60  const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
61  ScTabViewShell* pViewShell,
62  ScSplitPos eSplitPos);
63 
64  void PreInit();
65 
66  virtual void Init() override;
67 
68  DECL_LINK( WindowChildEventListener, VclWindowEvent&, void );
69 protected:
70  virtual ~ScAccessibleDocument() override;
71 
73 
74 public:
75 
76  virtual void SAL_CALL disposing() override;
77 
79 
80  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
81 
83 
84  virtual css::uno::Any SAL_CALL queryInterface(
85  css::uno::Type const & rType ) override;
86 
87  virtual void SAL_CALL acquire() throw () override;
88 
89  virtual void SAL_CALL release() throw () override;
90 
92 
93  virtual css::uno::Reference< css::accessibility::XAccessible >
94  SAL_CALL getAccessibleAtPoint(
95  const css::awt::Point& rPoint ) override;
96 
97  virtual void SAL_CALL grabFocus( ) override;
98 
100 
102  virtual sal_Int32 SAL_CALL
103  getAccessibleChildCount() override;
104 
106  virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
107  getAccessibleChild(sal_Int32 nIndex) override;
108 
110  virtual css::uno::Reference<
111  css::accessibility::XAccessibleStateSet> SAL_CALL
112  getAccessibleStateSet() override;
113 
114  virtual OUString SAL_CALL
115  getAccessibleName() override;
116 
117  virtual css::uno::Any SAL_CALL getExtendedAttributes() override ;
119 
120  virtual void SAL_CALL
121  selectAccessibleChild( sal_Int32 nChildIndex ) override;
122 
123  virtual sal_Bool SAL_CALL
124  isAccessibleChildSelected( sal_Int32 nChildIndex ) override;
125 
126  virtual void SAL_CALL
127  clearAccessibleSelection( ) override;
128 
129  virtual void SAL_CALL
130  selectAllAccessibleChildren( ) override;
131 
132  virtual sal_Int32 SAL_CALL
134 
135  virtual css::uno::Reference<
136  css::accessibility::XAccessible > SAL_CALL
137  getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) override;
138 
139  virtual void SAL_CALL
140  deselectAccessibleChild( sal_Int32 nChildIndex ) override;
141 
143 
144  virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent ) override;
145 
146  virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
147 
149 
152  virtual OUString SAL_CALL
153  getImplementationName() override;
154 
157  virtual css::uno::Sequence< OUString> SAL_CALL
158  getSupportedServiceNames() override;
159 
161 
163  virtual css::uno::Sequence< css::uno::Type > SAL_CALL
164  getTypes() override;
165 
168  virtual css::uno::Sequence<sal_Int8> SAL_CALL
169  getImplementationId() override;
170 
172 
180  virtual tools::Rectangle GetVisibleArea() const override;
181 
192  virtual Point LogicToPixel (const Point& rPoint) const override;
193 
203  virtual Size LogicToPixel (const Size& rSize) const override;
204 
206 
208 
209  css::uno::Reference< css::accessibility::XAccessible >
211 
212 protected:
214  virtual OUString
215  createAccessibleDescription() override;
216 
218  virtual OUString
219  createAccessibleName() override;
220 
222  virtual tools::Rectangle GetBoundingBoxOnScreen() const override;
223 
225  virtual tools::Rectangle GetBoundingBox() const override;
226 
227 private:
231  std::unique_ptr<ScChildrenShapes> mpChildrenShapes;
233  css::uno::Reference<css::accessibility::XAccessible> mxTempAcc;
236 
237 public:
238  SCTAB getVisibleTable() const; // use it in ScChildrenShapes
239 
240 private:
242 
243  bool IsTableSelected() const;
244 
245  bool IsDefunc(
246  const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates);
247 
248  void AddChild(const css::uno::Reference<css::accessibility::XAccessible>& xAcc, bool bFireEvent);
249  void RemoveChild(const css::uno::Reference<css::accessibility::XAccessible>& xAcc, bool bFireEvent);
250 
251  OUString GetCurrentCellName() const;
252  static OUString GetCurrentCellDescription();
253 
255 public:
256  ScDocument *GetDocument() const ;
258 
259  virtual sal_Int32 SAL_CALL getForeground( ) override;
260 
261  virtual sal_Int32 SAL_CALL getBackground( ) override;
262 };
263 
264 #endif
265 
266 /* 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
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() override
virtual void SAL_CALL grabFocus() 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:45
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 void SAL_CALL release() override
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.
ScAccessibleEditObject * mpTempAccEdit
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 =====================================================
utl::AccessibleRelationSetHelper * GetRelationSet(const ScAddress *pAddress) const
======== internal =====================================================
void RemoveChild(const css::uno::Reference< css::accessibility::XAccessible > &xAcc, bool bFireEvent)
virtual ~ScAccessibleDocument() override
AnyEventRef aEvent
sal_Int16 SCTAB
Definition: types.hxx:23
This base class provides an implementation of the AccessibleCell service.