LibreOffice Module accessibility (master) 1
accessiblebrowseboxcell.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 <sal/types.h>
23
24namespace accessibility
25{
26 using namespace ::com::sun::star::uno;
27 using namespace ::com::sun::star::awt;
28 using namespace ::com::sun::star::accessibility;
29
30 // AccessibleBrowseBoxCell
32 const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, ::vcl::IAccessibleTableProvider& _rBrowseBox,
33 const css::uno::Reference< css::awt::XWindow >& _xFocusWindow,
34 sal_Int32 _nRowPos, sal_uInt16 _nColPos, AccessibleBrowseBoxObjType _eType )
35 :AccessibleBrowseBoxBase( _rxParent, _rBrowseBox, _xFocusWindow, _eType )
36 ,m_nRowPos( _nRowPos )
37 ,m_nColPos( _nColPos )
38 {
39 // set accessible name here, because for that we need the position of the cell
40 // and so the base class isn't capable of doing this
41 sal_Int32 nPos = _nRowPos * _rBrowseBox.GetColumnCount() + _nColPos;
42 OUString aAccName = _rBrowseBox.GetAccessibleObjectName( AccessibleBrowseBoxObjType::TableCell, nPos );
43 implSetName( aAccName );
44 }
45
47 {
48 }
49
51 {
52 SolarMethodGuard aGuard(getMutex());
54
56 }
57
59 {
60 return mpBrowseBox->GetFieldRectPixel( m_nRowPos, m_nColPos, false, /*bOnScreen*/false );
61 }
62
64 {
65 return mpBrowseBox->GetFieldRectPixel( m_nRowPos, m_nColPos, false, /*bOnScreen*/true );
66 }
67} // namespace accessibility
68
69/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AccessibleBrowseBoxObjType
The BrowseBox accessible objects inherit from this base class.
::vcl::IAccessibleTableProvider * mpBrowseBox
The VCL BrowseBox control.
void implSetName(const OUString &rName)
Changes the name of the object (flat assignment, no notify).
AccessibleBrowseBoxCell(const css::uno::Reference< css::accessibility::XAccessible > &_rxParent, ::vcl::IAccessibleTableProvider &_rBrowseBox, const css::uno::Reference< css::awt::XWindow > &_xFocusWindow, sal_Int32 _nRowPos, sal_uInt16 _nColPos, AccessibleBrowseBoxObjType _eType=AccessibleBrowseBoxObjType::TableCell)
virtual void SAL_CALL grabFocus() override
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 sal_uInt16 GetColumnCount() const=0
virtual tools::Rectangle GetFieldRectPixel(sal_Int32 _nRow, sal_uInt16 _nColumnPos, bool _bIsHeader, bool _bOnScreen)=0
virtual OUString GetAccessibleObjectName(AccessibleBrowseBoxObjType _eType, sal_Int32 _nPos=-1) const=0
virtual bool GoToCell(sal_Int32 _nRow, sal_uInt16 _nColumnPos)=0
sal_uInt16 nPos