/src/libreoffice/svx/source/table/accessiblecell.hxx
Line | Count | Source |
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 | | |
26 | | #include <editeng/AccessibleContextBase.hxx> |
27 | | #include <svx/IAccessibleViewForwarderListener.hxx> |
28 | | #include <svx/AccessibleTextHelper.hxx> |
29 | | #include <svx/AccessibleShapeTreeInfo.hxx> |
30 | | #include <AccessibleTableShape.hxx> |
31 | | |
32 | | #include <cppuhelper/implbase.hxx> |
33 | | |
34 | | #include <celltypes.hxx> |
35 | | |
36 | | |
37 | | namespace accessibility |
38 | | { |
39 | | |
40 | | class AccessibleCell : public AccessibleContextBase |
41 | | , public IAccessibleViewForwarderListener |
42 | | { |
43 | | public: |
44 | | AccessibleCell( const rtl::Reference<AccessibleTableShape>& rxParent, sdr::table::CellRef xCell, sal_Int32 nIndex, const AccessibleShapeTreeInfo& rShapeTreeInfo); |
45 | | virtual ~AccessibleCell() override; |
46 | | AccessibleCell(const AccessibleCell&) = delete; |
47 | | AccessibleCell& operator=(const AccessibleCell&) = delete; |
48 | | |
49 | | void Init(); |
50 | | |
51 | | virtual bool SetState (sal_Int64 aState) override; |
52 | | virtual bool ResetState (sal_Int64 aState) override; |
53 | | |
54 | | // XAccessibleContext |
55 | | virtual sal_Int64 SAL_CALL getAccessibleChildCount() override; |
56 | | virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL getAccessibleChild(sal_Int64 nIndex) override; |
57 | | virtual sal_Int64 SAL_CALL getAccessibleStateSet() override; |
58 | | virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override; |
59 | | virtual OUString SAL_CALL getAccessibleName() override; |
60 | 0 | const sdr::table::CellRef& getCellRef() const { return mxCell;} |
61 | | void UpdateChildren(); |
62 | | static OUString getCellName( sal_Int32 nCol, sal_Int32 nRow ); |
63 | | |
64 | | // OAccessible |
65 | | virtual css::awt::Rectangle implGetBounds() override; |
66 | | |
67 | | // XAccessibleComponent |
68 | | virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point& aPoint) override; |
69 | | virtual sal_Int32 SAL_CALL getForeground() override; |
70 | | virtual sal_Int32 SAL_CALL getBackground() override; |
71 | | |
72 | | // XAccessibleEventBroadcaster |
73 | | virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& rxListener) override; |
74 | | virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& rxListener) override; |
75 | | |
76 | | // IAccessibleViewForwarderListener |
77 | | virtual void ViewForwarderChanged() override; |
78 | | |
79 | | // Misc |
80 | | |
81 | | /** set the index _nIndex at the accessible cell param _nIndex The new index in parent. |
82 | | */ |
83 | 0 | void setIndexInParent(sal_Int32 _nIndex) { mnIndexInParent = _nIndex; } |
84 | | |
85 | | //Get the parent table |
86 | 0 | AccessibleTableShape* GetParentTable() { return pAccTable; } |
87 | | |
88 | | private: |
89 | | /// Bundle of information passed to all shapes in a document tree. |
90 | | AccessibleShapeTreeInfo maShapeTreeInfo; |
91 | | |
92 | | /// the index in parent. |
93 | | sal_Int32 mnIndexInParent; |
94 | | |
95 | | /// The accessible text engine. May be NULL if it can not be created. |
96 | | std::unique_ptr<AccessibleTextHelper> mpText; |
97 | | |
98 | | sdr::table::CellRef mxCell; |
99 | | |
100 | | /// This method is called from the component helper base class while disposing. |
101 | | virtual void SAL_CALL disposing() override; |
102 | | |
103 | | AccessibleTableShape *pAccTable; |
104 | | }; |
105 | | |
106 | | } // end of namespace accessibility |
107 | | |
108 | | #endif |
109 | | |
110 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |