LibreOffice Module accessibility (master) 1
AccessibleGridControlHeaderCell.cxx
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#include <com/sun/star/accessibility/AccessibleStateType.hpp>
21#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
24#include <vcl/svapp.hxx>
25
26namespace accessibility
27{
28 using namespace ::com::sun::star::accessibility;
29 using namespace ::com::sun::star::lang;
30 using namespace ::com::sun::star::uno;
31 using namespace ::vcl;
32 using namespace ::vcl::table;
33
35 const Reference< XAccessible >& rxParent,
36 IAccessibleTable& rTable,
38: AccessibleGridControlCell( rxParent, rTable, _nColumnRowId, 0, eObjType)
39, m_nColumnRowId(_nColumnRowId)
40{
41}
45{
46 sal_Int64 nStateSet = 0;
47
48 if( isAlive() )
49 {
50 // SHOWING done with mxParent
51 if( implIsShowing() )
52 nStateSet |= AccessibleStateType::SHOWING;
53
54 nStateSet |= AccessibleStateType::VISIBLE;
55 nStateSet |= AccessibleStateType::FOCUSABLE;
56 nStateSet |= AccessibleStateType::TRANSIENT;
57 nStateSet |= AccessibleStateType::SELECTABLE;
58
60 nStateSet |= AccessibleStateType::SELECTED;
61 }
62 else
63 nStateSet |= AccessibleStateType::DEFUNC;
64
65 return nStateSet;
66}
67
72{
73 return 0;
74}
75
76
81{
82 throw IndexOutOfBoundsException();
83}
84// XInterface -------------------------------------------------------------
85
87 css::uno::Any SAL_CALL AccessibleGridControlHeaderCell::queryInterface( const css::uno::Type& rType )
88 {
89 Any aRet = AccessibleGridControlCell::queryInterface(rType);
90 return aRet;
91 }
92
95 {
96 AccessibleGridControlCell::acquire();
97 }
98
101 {
102 AccessibleGridControlCell::release();
103 }
106 {
108 return this;
109 }
110
111
114{
115}
116
121{
122 return "com.sun.star.accessibility.AccessibleGridControlHeaderCell";
123}
124
126{
128 tools::Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( *pParent ) );
130 tools::Rectangle aCellRect;
132 aCellRect = m_aTable.calcHeaderCellRect(true, nIndex);
133 else
134 aCellRect = m_aTable.calcHeaderCellRect(false, nIndex);
135 return tools::Rectangle(Point(aGridRect.Left()+aCellRect.Left(),aGridRect.Top()+aCellRect.Top()), aCellRect.GetSize());
136}
137
138
140{
143 tools::Rectangle aCellRect;
145 aCellRect = m_aTable.calcHeaderCellRect(true, nIndex);
146 else
147 aCellRect = m_aTable.calcHeaderCellRect(false, nIndex);
148 return tools::Rectangle(Point(aGridRect.Left()+aCellRect.Left(),aGridRect.Top()+aCellRect.Top()), aCellRect.GetSize());
149}
150
152{
154
156 return m_nColumnRowId;
157}
158
159} // namespace accessibility
160
161
162/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::vcl::table::IAccessibleTable & m_aTable
The SVT Table control.
bool implIsShowing()
Determines whether the Grid control is really showing inside of its parent accessible window.
::vcl::table::AccessibleTableControlObjType m_eObjType
The type of this object (for names, descriptions, state sets, ...).
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Queries for a new interface.
AccessibleGridControlHeaderCell(sal_Int32 _nColumnRowId, const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ::vcl::table::IAccessibleTable &_rTable, ::vcl::table::AccessibleTableControlObjType _eObjType)
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
virtual void SAL_CALL grabFocus() override
Grabs the focus to the GridControl.
sal_Int64 implCreateStateSet() override
Return a bitset of states of the current object.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nChildIndex) override
virtual void SAL_CALL release() noexcept override
Releases the object (calls release() on base class).
virtual tools::Rectangle implGetBoundingBoxOnScreen() override
‍** Derived classes return the bounding box in screen coordinates.
virtual tools::Rectangle implGetBoundingBox() override
Derived classes return the bounding box relative to the parent window.
virtual void SAL_CALL acquire() noexcept override
Acquires the object (calls acquire() on base class).
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
constexpr tools::Long Top() const
constexpr Size GetSize() const
constexpr tools::Long Left() const
virtual vcl::Window * GetAccessibleParentWindow() const=0
virtual bool IsRowSelected(sal_Int32 const i_rowIndex) const=0
virtual tools::Rectangle calcHeaderCellRect(bool _bColHeader, sal_Int32 _nPos)=0
virtual tools::Rectangle GetWindowExtentsRelative(const vcl::Window &rRelativeWindow) const=0
virtual tools::Rectangle GetWindowExtentsAbsolute() const=0
sal_Int32 nIndex
AccessibleTableControlObjType
TCTYPE_COLUMNHEADERCELL