LibreOffice Module sc (master)  1
AccessibleCell.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 <memory>
23 #include "AccessibleCellBase.hxx"
24 #include "viewdata.hxx"
25 #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
26 #include <rtl/ref.hxx>
28 #include <comphelper/uno3.hxx>
29 
30 namespace com::sun::star::accessibility { class XAccessibleRelationSet; }
31 namespace utl { class AccessibleRelationSetHelper; }
32 
33 class ScTabViewShell;
35 
38 
44  : public ScAccessibleCellBase,
47 {
48 public:
50  const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
51  ScTabViewShell* pViewShell,
52  const ScAddress& rCellAddress,
53  sal_Int32 nIndex,
54  ScSplitPos eSplitPos,
55  ScAccessibleDocument* pAccDoc);
56 
57 private:
59  const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
60  ScTabViewShell* pViewShell,
61  const ScAddress& rCellAddress,
62  sal_Int32 nIndex,
63  ScSplitPos eSplitPos,
64  ScAccessibleDocument* pAccDoc);
65 
66  virtual void Init() override;
67 
69  virtual void SAL_CALL disposing() override;
70 
71 protected:
72  virtual ~ScAccessibleCell() override;
73 
75 
76 public:
78 
80 
81 
82 
84 
85 
86 
87  virtual css::uno::Reference< css::accessibility::XAccessible >
88  SAL_CALL getAccessibleAtPoint( const css::awt::Point& rPoint ) override;
89 
90  virtual void SAL_CALL grabFocus( ) override;
91 
92 protected:
94  virtual tools::Rectangle GetBoundingBoxOnScreen() const override;
95 
97  virtual tools::Rectangle GetBoundingBox() const override;
98 
99 public:
101 
104  virtual sal_Int32 SAL_CALL
105  getAccessibleChildCount() override;
106 
109  virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
110  getAccessibleChild(sal_Int32 nIndex) override;
111 
113  virtual css::uno::Reference<
114  css::accessibility::XAccessibleStateSet> SAL_CALL
115  getAccessibleStateSet() override;
116 
117  virtual css::uno::Reference<
118  css::accessibility::XAccessibleRelationSet> SAL_CALL
119  getAccessibleRelationSet() override;
120 
122 
125  virtual OUString SAL_CALL
126  getImplementationName() override;
127 
130  virtual css::uno::Sequence< OUString> SAL_CALL
131  getSupportedServiceNames() override;
132 
133  virtual css::uno::Any SAL_CALL getExtendedAttributes() override;
134 
135  // Override this method to handle cell's ParaIndent attribute specially.
136  virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) override;
137 private:
140 
142 
143  bool IsDefunc(
144  const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates);
145  virtual bool IsEditable(
146  const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates) override;
147  bool IsOpaque() const;
148  bool IsSelected();
149 
150  static ScDocument* GetDocument(ScTabViewShell* mpViewShell);
151 
152  ::std::unique_ptr< SvxEditSource > CreateEditSource(ScTabViewShell* pViewShell, ScAddress aCell, ScSplitPos eSplitPos);
153 
156  void AddRelation(const ScAddress& rCell,
157  const sal_uInt16 aRelationType,
158  ::utl::AccessibleRelationSetHelper* pRelationSet);
159  void AddRelation(const ScRange& rRange,
160  const sal_uInt16 aRelationType,
161  ::utl::AccessibleRelationSetHelper* pRelationSet);
162  bool IsFormulaMode();
163  bool IsDropdown() const;
164 };
165 
166 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes(sal_Int32 nIndex, const css::uno::Sequence< OUString > &aRequestedAttributes) override
sal_Int32 nIndex
virtual void SAL_CALL grabFocus() override
ScTabViewShell * mpViewShell
static ScDocument * GetDocument(ScTabViewShell *mpViewShell)
static rtl::Reference< ScAccessibleCell > create(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ScTabViewShell *pViewShell, const ScAddress &rCellAddress, sal_Int32 nIndex, ScSplitPos eSplitPos, ScAccessibleDocument *pAccDoc)
virtual OUString SAL_CALL getImplementationName() override
===== XServiceInfo ====================================================
void FillDependents(utl::AccessibleRelationSetHelper *pRelationSet)
ScSplitPos
Definition: viewdata.hxx:44
void AddRelation(const ScAddress &rCell, const sal_uInt16 aRelationType,::utl::AccessibleRelationSetHelper *pRelationSet)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 nIndex) override
Return the specified child or NULL if index is invalid.
bool IsDropdown() const
virtual bool IsEditable(const css::uno::Reference< css::accessibility::XAccessibleStateSet > &rxParentStates) override
ScAccessibleDocument * mpAccDoc
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return NULL to indicate that an empty relation set.
virtual void SAL_CALL disposing() override
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
Return the set of current states.
virtual tools::Rectangle GetBoundingBoxOnScreen() const override
Return the object's current bounding box relative to the desktop.
cppu::ImplHelper1< css::accessibility::XAccessibleExtendedAttributes > ScAccessibleCellAttributeImpl
#define DECLARE_XTYPEPROVIDER()
This base class provides an implementation of the AccessibleCell service.
bool IsOpaque() const
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
===== XAccessibleContext ==============================================
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &rPoint) override
===== XInterface =====================================================
virtual void SAL_CALL disposing() override
virtual void Init() override
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
virtual tools::Rectangle GetBoundingBox() const override
Return the object's current bounding box relative to the parent object.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
::std::unique_ptr< SvxEditSource > CreateEditSource(ScTabViewShell *pViewShell, ScAddress aCell, ScSplitPos eSplitPos)
void FillPrecedents(utl::AccessibleRelationSetHelper *pRelationSet)
ScAccessibleCell(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ScTabViewShell *pViewShell, const ScAddress &rCellAddress, sal_Int32 nIndex, ScSplitPos eSplitPos, ScAccessibleDocument *pAccDoc)
virtual ~ScAccessibleCell() override
#define DECLARE_XINTERFACE()