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 #ifndef INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLECELL_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLECELL_HXX
22 
23 #include <memory>
24 #include "AccessibleCellBase.hxx"
25 #include "viewdata.hxx"
26 #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp>
27 #include <rtl/ref.hxx>
29 #include <comphelper/uno3.hxx>
30 
31 namespace com::sun::star::accessibility { class XAccessibleRelationSet; }
32 namespace utl { class AccessibleRelationSetHelper; }
33 
34 class ScTabViewShell;
36 
39 
45  : public ScAccessibleCellBase,
48 {
49 public:
51  const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
52  ScTabViewShell* pViewShell,
53  const ScAddress& rCellAddress,
54  sal_Int32 nIndex,
55  ScSplitPos eSplitPos,
56  ScAccessibleDocument* pAccDoc);
57 
58 private:
60  const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
61  ScTabViewShell* pViewShell,
62  const ScAddress& rCellAddress,
63  sal_Int32 nIndex,
64  ScSplitPos eSplitPos,
65  ScAccessibleDocument* pAccDoc);
66 
67  virtual void Init() override;
68 
70  virtual void SAL_CALL disposing() override;
71 
72 protected:
73  virtual ~ScAccessibleCell() override;
74 
76 
77 public:
79 
81 
82 
83 
85 
86 
87 
88  virtual css::uno::Reference< css::accessibility::XAccessible >
89  SAL_CALL getAccessibleAtPoint( const css::awt::Point& rPoint ) override;
90 
91  virtual void SAL_CALL grabFocus( ) override;
92 
93 protected:
95  virtual tools::Rectangle GetBoundingBoxOnScreen() const override;
96 
98  virtual tools::Rectangle GetBoundingBox() const override;
99 
100 public:
102 
105  virtual sal_Int32 SAL_CALL
106  getAccessibleChildCount() override;
107 
110  virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
111  getAccessibleChild(sal_Int32 nIndex) override;
112 
114  virtual css::uno::Reference<
115  css::accessibility::XAccessibleStateSet> SAL_CALL
116  getAccessibleStateSet() override;
117 
118  virtual css::uno::Reference<
119  css::accessibility::XAccessibleRelationSet> SAL_CALL
120  getAccessibleRelationSet() override;
121 
123 
126  virtual OUString SAL_CALL
127  getImplementationName() override;
128 
131  virtual css::uno::Sequence< OUString> SAL_CALL
132  getSupportedServiceNames() override;
133 
134  virtual css::uno::Any SAL_CALL getExtendedAttributes() override;
135 
136  // Override this method to handle cell's ParaIndent attribute specially.
137  virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) override;
138 private:
141 
143 
144  bool IsDefunc(
145  const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates);
146  virtual bool IsEditable(
147  const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates) override;
148  bool IsOpaque() const;
149  bool IsSelected();
150 
151  static ScDocument* GetDocument(ScTabViewShell* mpViewShell);
152 
153  ::std::unique_ptr< SvxEditSource > CreateEditSource(ScTabViewShell* pViewShell, ScAddress aCell, ScSplitPos eSplitPos);
154 
157  void AddRelation(const ScAddress& rCell,
158  const sal_uInt16 aRelationType,
159  ::utl::AccessibleRelationSetHelper* pRelationSet);
160  void AddRelation(const ScRange& rRange,
161  const sal_uInt16 aRelationType,
162  ::utl::AccessibleRelationSetHelper* pRelationSet);
163  bool IsFormulaMode();
164  bool IsDropdown() const;
165 };
166 
167 #endif
168 
169 /* 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:45
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()