LibreOffice Module svx (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_SVX_SOURCE_TABLE_ACCESSIBLECELL_HXX
21 #define INCLUDED_SVX_SOURCE_TABLE_ACCESSIBLECELL_HXX
22 
23 #include <com/sun/star/accessibility/XAccessible.hpp>
24 #include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
25 
31 #include <AccessibleTableShape.hxx>
32 
33 #include <cppuhelper/implbase.hxx>
34 
35 #include <celltypes.hxx>
36 
37 
38 namespace accessibility
39 {
40 
42 
43 typedef ::cppu::ImplInheritanceHelper< AccessibleContextBase, css::accessibility::XAccessibleExtendedComponent > AccessibleCellBase;
44 
45 class AccessibleCell : public AccessibleCellBase
48 {
49 public:
50  AccessibleCell( const css::uno::Reference< css::accessibility::XAccessible>& rxParent, const sdr::table::CellRef& rCell, sal_Int32 nIndex, const AccessibleShapeTreeInfo& rShapeTreeInfo);
51  virtual ~AccessibleCell() override;
52  AccessibleCell(const AccessibleCell&) = delete;
53  AccessibleCell& operator=(const AccessibleCell&) = delete;
54 
55  void Init();
56 
57  virtual bool SetState (sal_Int16 aState) override;
58  virtual bool ResetState (sal_Int16 aState) override;
59 
60  // XInterface
61  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
62  virtual void SAL_CALL acquire( ) throw () override;
63  virtual void SAL_CALL release( ) throw () override;
64 
65  // XAccessibleContext
66  virtual sal_Int32 SAL_CALL getAccessibleChildCount() override;
67  virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int32 nIndex) override;
68  virtual css::uno::Reference< css::accessibility::XAccessibleStateSet> SAL_CALL getAccessibleStateSet() override;
69  virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override;
70  virtual OUString SAL_CALL getAccessibleName() override;
71  const sdr::table::CellRef& getCellRef() const { return mxCell;}
72  void UpdateChildren();
73  static OUString getCellName( sal_Int32 nCol, sal_Int32 nRow );
74 
75  // XAccessibleComponent
76  virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint) override;
77  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point& aPoint) override;
78  virtual css::awt::Rectangle SAL_CALL getBounds() override;
79  virtual css::awt::Point SAL_CALL getLocation() override;
80  virtual css::awt::Point SAL_CALL getLocationOnScreen() override;
81  virtual css::awt::Size SAL_CALL getSize() override;
82  virtual void SAL_CALL grabFocus() override;
83  virtual sal_Int32 SAL_CALL getForeground() override;
84  virtual sal_Int32 SAL_CALL getBackground() override;
85 
86  // XAccessibleExtendedComponent
87  virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override;
88  virtual OUString SAL_CALL getTitledBorderText() override;
89  virtual OUString SAL_CALL getToolTipText() override;
90 
91  // XAccessibleEventBroadcaster
92  virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& rxListener) override;
93  virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& rxListener) override;
94 
95  // XServiceInfo
96  virtual OUString SAL_CALL getImplementationName() override;
97  virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() override;
98 
99  // IAccessibleViewForwarderListener
100  virtual void ViewForwarderChanged() override;
101 
102  // Misc
103 
106  void setIndexInParent(sal_Int32 _nIndex) { mnIndexInParent = _nIndex; }
107 
108  //Get the parent table
110 protected:
113 
115  sal_Int32 mnIndexInParent;
116 
118  std::unique_ptr<AccessibleTextHelper> mpText;
119 
121 
123  virtual void SAL_CALL disposing() override;
124 
126 };
127 
128 } // end of namespace accessibility
129 
130 #endif
131 
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
std::unique_ptr< AccessibleTextHelper > mpText
The accessible text engine. May be NULL if it can not be created.
virtual void ViewForwarderChanged() override
This method is called to indicate a change of the specified view forwarder, specifically, a change in visible area.
AccessibleTableShape * pAccTable
sal_Int32 nIndex
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL release() override
virtual OUString SAL_CALL getTitledBorderText() override
virtual sal_Int32 SAL_CALL getBackground() override
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &rxListener) override
virtual bool ResetState(sal_Int16 aState) override
virtual void SAL_CALL acquire() override
virtual OUString SAL_CALL getAccessibleName() override
virtual bool SetState(sal_Int16 aState) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual void SAL_CALL disposing() override
This method is called from the component helper base class while disposing.
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &rxListener) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
The implementation below is at the moment straightforward.
unsigned char sal_Bool
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
The children of this cell come from the paragraphs of text.
const sdr::table::CellRef & getCellRef() const
AccessibleShapeTreeInfo maShapeTreeInfo
Bundle of information passed to all shapes in a document tree.
virtual void SAL_CALL grabFocus() override
void setIndexInParent(sal_Int32 _nIndex)
set the index _nIndex at the accessible cell param _nIndex The new index in parent.
sal_Int32 mnIndexInParent
the index in parent.
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
Return a copy of the state set.
virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override
AccessibleCell(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, const sdr::table::CellRef &rCell, sal_Int32 nIndex, const AccessibleShapeTreeInfo &rShapeTreeInfo)
virtual ~AccessibleCell() override
virtual sal_Int32 SAL_CALL getForeground() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 nIndex) override
Forward the request to the shape.
virtual css::awt::Size SAL_CALL getSize() override
::cppu::ImplInheritanceHelper< AccessibleContextBase, css::accessibility::XAccessibleExtendedComponent > AccessibleCellBase
static OUString getCellName(sal_Int32 nCol, sal_Int32 nRow)
AccessibleCell & operator=(const AccessibleCell &)=delete
virtual OUString SAL_CALL getToolTipText() override
This class bundles all information that is passed down the tree of accessible shapes so that each sha...
virtual css::awt::Point SAL_CALL getLocation() override
AccessibleTableShape * GetParentTable()
virtual OUString SAL_CALL getImplementationName() override