LibreOffice Module sc (master)  1
AccessiblePreviewTable.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 <com/sun/star/accessibility/XAccessibleTable.hpp>
24 #include <cppuhelper/implbase1.hxx>
25 
26 class ScPreviewShell;
28 
31 
35 {
36 public:
37  ScAccessiblePreviewTable( const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
38  ScPreviewShell* pViewShell, sal_Int32 nIndex );
39 
40 protected:
41  virtual ~ScAccessiblePreviewTable() override;
42 
44 
45 public:
47  virtual void SAL_CALL disposing() override;
48 
49  //===== SfxListener =====================================================
50 
51  virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
52 
54 
55  virtual css::uno::Any SAL_CALL queryInterface(
56  css::uno::Type const & rType ) override;
57 
58  virtual void SAL_CALL acquire() noexcept override;
59 
60  virtual void SAL_CALL release() noexcept override;
61 
62  //===== XAccessibleTable ================================================
63 
64  virtual sal_Int32 SAL_CALL getAccessibleRowCount() override;
65  virtual sal_Int32 SAL_CALL getAccessibleColumnCount() override;
66  virtual OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) override;
67  virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) override;
68  virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
69  virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
70  virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL
71  getAccessibleRowHeaders() override;
72  virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL
73  getAccessibleColumnHeaders() override;
74  virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows() override;
75  virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns() override;
76  virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) override;
77  virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) override;
78  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
79  getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
80  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
81  getAccessibleCaption() override;
82  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
83  getAccessibleSummary() override;
84  virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) override;
85  virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) override;
86  virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) override;
87  virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) override;
88 
89  //===== XAccessibleComponent ============================================
90 
91  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
92  getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
93  virtual void SAL_CALL grabFocus() override;
94 
95  //===== XAccessibleContext ==============================================
96 
97  virtual sal_Int32 SAL_CALL getAccessibleChildCount() override;
98  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
99  getAccessibleChild( sal_Int32 i ) override;
100  virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override;
101  virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL
102  getAccessibleStateSet() override;
103 
104  //===== XServiceInfo ====================================================
105 
106  virtual OUString SAL_CALL getImplementationName() override;
107  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
108 
109  //===== XTypeProvider ===================================================
110 
111  virtual css::uno::Sequence< css::uno::Type > SAL_CALL
112  getTypes() override;
113 
114  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
115 
116 protected:
117  virtual OUString createAccessibleDescription() override;
118  virtual OUString createAccessibleName() override;
119 
120  virtual tools::Rectangle GetBoundingBoxOnScreen() const override;
121  virtual tools::Rectangle GetBoundingBox() const override;
122 
123 private:
125  sal_Int32 mnIndex;
126  mutable std::unique_ptr<ScPreviewTableInfo> mpTableInfo;
127 
128  bool IsDefunc(
129  const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates);
130 
131  void FillTableInfo() const;
132 };
133 
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override
Return this objects index among the parents children.
virtual sal_Int32 SAL_CALL getAccessibleColumnCount() override
virtual void SAL_CALL acquire() noexcept override
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) override
===== XInterface =====================================================
virtual sal_Int32 SAL_CALL getAccessibleIndex(sal_Int32 nRow, sal_Int32 nColumn) override
sal_Int32 nIndex
std::unique_ptr< ScPreviewTableInfo > mpTableInfo
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
===== XAccessibleContext ==============================================
virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
virtual sal_Int32 SAL_CALL getAccessibleRow(sal_Int32 nChildIndex) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
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 getAccessibleCaption() override
virtual void SAL_CALL release() noexcept override
virtual tools::Rectangle GetBoundingBox() const override
Return the object's current bounding box relative to the parent object.
virtual OUString SAL_CALL getAccessibleRowDescription(sal_Int32 nRow) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCellAt(sal_Int32 nRow, sal_Int32 nColumn) override
virtual sal_Bool SAL_CALL isAccessibleSelected(sal_Int32 nRow, sal_Int32 nColumn) override
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows() override
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns() override
cppu::ImplHelper1< css::accessibility::XAccessibleTable > ScAccessiblePreviewTableImpl
virtual sal_Int32 SAL_CALL getAccessibleColumn(sal_Int32 nChildIndex) override
virtual sal_Bool SAL_CALL isAccessibleColumnSelected(sal_Int32 nColumn) override
virtual tools::Rectangle GetBoundingBoxOnScreen() const override
Return the object's current bounding box relative to the desktop.
virtual OUString createAccessibleName() override
Return the object's current name.
virtual ~ScAccessiblePreviewTable() override
virtual sal_Int32 SAL_CALL getAccessibleRowCount() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary() override
int i
virtual void SAL_CALL disposing() override
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
Return the set of current states.
unsigned char sal_Bool
virtual OUString SAL_CALL getImplementationName() override
===== XServiceInfo ====================================================
ScAccessiblePreviewTable(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ScPreviewShell *pViewShell, sal_Int32 nIndex)
virtual void SAL_CALL grabFocus() override
virtual OUString SAL_CALL getAccessibleColumnDescription(sal_Int32 nColumn) override
virtual void SAL_CALL disposing() override
virtual sal_Bool SAL_CALL isAccessibleRowSelected(sal_Int32 nRow) override
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders() override
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 i) override
Return the specified child or NULL if index is invalid.
virtual OUString createAccessibleDescription() override
Return this object's description.
virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
===== SfxListener =====================================================