LibreOffice Module accessibility (master) 1
AccessibleBrowseBoxHeaderCell.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
23#include <com/sun/star/accessibility/AccessibleStateType.hpp>
24#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
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
33 const Reference< XAccessible >& rxParent,
35 const css::uno::Reference< css::awt::XWindow >& _xFocusWindow,
38 rBrowseBox,
39 _xFocusWindow,
40 eObjType,
41 rBrowseBox.GetAccessibleObjectName( eObjType ,_nColumnRowId),
42 rBrowseBox.GetAccessibleObjectDescription( eObjType ,_nColumnRowId))
43, m_nColumnRowId(_nColumnRowId)
44{
45}
49{
50 SolarMethodGuard aGuard( getMutex() );
51
52 sal_Int64 nStateSet = 0;
53
54 if( isAlive() )
55 {
56 // SHOWING done with mxParent
57 if( implIsShowing() )
58 nStateSet |= AccessibleStateType::SHOWING;
59
61 nStateSet |= AccessibleStateType::VISIBLE;
62 nStateSet |= AccessibleStateType::FOCUSABLE;
63 nStateSet |= AccessibleStateType::TRANSIENT;
64 nStateSet |= AccessibleStateType::SELECTABLE;
65
67 if ( bSelected )
68 nStateSet |= AccessibleStateType::SELECTED;
69 }
70 else
71 nStateSet |= AccessibleStateType::DEFUNC;
72
73 return nStateSet;
74}
75
80{
81 return 0;
82}
83
84
89{
90 throw IndexOutOfBoundsException();
91}
92
93
96{
97 SolarMethodGuard aGuard(getMutex());
99
100 if ( isRowBarCell() )
102 else
103 mpBrowseBox->SelectColumn(static_cast<sal_uInt16>(m_nColumnRowId));
104}
105
110{
111 return "com.sun.star.comp.svtools.AccessibleBrowseBoxHeaderCell";
112}
113
114namespace
115{
116 tools::Rectangle getRectangle(vcl::IAccessibleTableProvider* _pBrowseBox,sal_Int32 _nRowColIndex, bool _bOnScreen,bool _bRowBar)
117 {
118 sal_Int32 nRow = 0;
119 sal_uInt16 nCol = static_cast<sal_uInt16>(_nRowColIndex);
120 if ( _bRowBar )
121 {
122 nRow = _nRowColIndex + 1;
123 nCol = 0;
124 }
125
126 tools::Rectangle aRet(_pBrowseBox->GetFieldRectPixel( nRow , nCol, true, _bOnScreen));
127 return tools::Rectangle(aRet.TopLeft() - Point(0,aRet.GetHeight()),aRet.GetSize());
128 }
129}
130
132{
133 return getRectangle(mpBrowseBox,m_nColumnRowId,false,isRowBarCell());
134}
135
136
138{
139 return getRectangle(mpBrowseBox,m_nColumnRowId,true,isRowBarCell());
140}
141
143{
144 ::osl::MutexGuard aGuard( getMutex() );
146 sal_Int64 nIndex = m_nColumnRowId;
147 if ( mpBrowseBox->HasRowHeader() )
148 --nIndex;
149 return nIndex;
150}
151
152} // namespace accessibility
153
154
155/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AccessibleBrowseBoxObjType
::vcl::IAccessibleTableProvider * mpBrowseBox
The VCL BrowseBox control.
AccessibleBrowseBoxObjType getType() const
bool implIsShowing()
Determines whether the BrowseBox control is really showing inside of its parent accessible window.
virtual tools::Rectangle implGetBoundingBox() override
Derived classes return the bounding box relative to the parent window.
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nChildIndex) override
sal_Int64 implCreateStateSet() override
Return a bitset of states of the current object.
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL grabFocus() override
Grabs the focus to the BrowseBox.
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
virtual tools::Rectangle implGetBoundingBoxOnScreen() override
Derived classes return the bounding box in screen coordinates.
AccessibleBrowseBoxHeaderCell(sal_Int32 _nColumnRowId, const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ::vcl::IAccessibleTableProvider &_rBrowseBox, const css::uno::Reference< css::awt::XWindow > &_xFocusWindow, AccessibleBrowseBoxObjType _eObjType)
virtual void SelectRow(sal_Int32 _nRow, bool _bSelect=true, bool bExpand=true)=0
virtual bool IsRowSelected(sal_Int32 _nRow) const=0
virtual void SelectColumn(sal_uInt16 _nColumnPos, bool _bSelect=true)=0
virtual bool HasRowHeader() const=0
virtual tools::Rectangle GetFieldRectPixel(sal_Int32 _nRow, sal_uInt16 _nColumnPos, bool _bIsHeader, bool _bOnScreen)=0
virtual bool IsColumnSelected(sal_Int32 _nColumnPos) const=0
virtual void FillAccessibleStateSet(sal_Int64 &_rStateSet, AccessibleBrowseBoxObjType _eType) const=0
sal_Int32 nIndex