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