xref: /AOO41X/main/accessibility/source/extended/accessiblebrowseboxcell.cxx (revision 0841af799a0c15bc22ec7bb30da88488e7283293)
1*0841af79SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*0841af79SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*0841af79SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*0841af79SAndrew Rist  * distributed with this work for additional information
6*0841af79SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*0841af79SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*0841af79SAndrew Rist  * "License"); you may not use this file except in compliance
9*0841af79SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*0841af79SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*0841af79SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*0841af79SAndrew Rist  * software distributed under the License is distributed on an
15*0841af79SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*0841af79SAndrew Rist  * KIND, either express or implied.  See the License for the
17*0841af79SAndrew Rist  * specific language governing permissions and limitations
18*0841af79SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*0841af79SAndrew Rist  *************************************************************/
21*0841af79SAndrew Rist 
22*0841af79SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_accessibility.hxx"
26cdf0e10cSrcweir #include "accessibility/extended/accessiblebrowseboxcell.hxx"
27cdf0e10cSrcweir #include <svtools/accessibletableprovider.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir // .................................................................................
30cdf0e10cSrcweir namespace accessibility
31cdf0e10cSrcweir {
32cdf0e10cSrcweir // .................................................................................
33cdf0e10cSrcweir 
34cdf0e10cSrcweir 	using namespace ::com::sun::star::uno;
35cdf0e10cSrcweir 	using namespace ::com::sun::star::awt;
36cdf0e10cSrcweir 	using namespace ::com::sun::star::accessibility;
37cdf0e10cSrcweir     using namespace ::svt;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir 	// =============================================================================
40cdf0e10cSrcweir 	// = AccessibleBrowseBoxCell
41cdf0e10cSrcweir 	// =============================================================================
DBG_NAME(svt_AccessibleBrowseBoxCell)42cdf0e10cSrcweir 	DBG_NAME( svt_AccessibleBrowseBoxCell )
43cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
44cdf0e10cSrcweir 	AccessibleBrowseBoxCell::AccessibleBrowseBoxCell(
45cdf0e10cSrcweir 			const Reference< XAccessible >& _rxParent, IAccessibleTableProvider& _rBrowseBox,
46cdf0e10cSrcweir 			const Reference< XWindow >& _xFocusWindow,
47cdf0e10cSrcweir             sal_Int32 _nRowPos, sal_uInt16 _nColPos, AccessibleBrowseBoxObjType _eType )
48cdf0e10cSrcweir         :AccessibleBrowseBoxBase( _rxParent, _rBrowseBox, _xFocusWindow, _eType )
49cdf0e10cSrcweir 		,m_nRowPos( _nRowPos )
50cdf0e10cSrcweir 		,m_nColPos( _nColPos )
51cdf0e10cSrcweir 	{
52cdf0e10cSrcweir 		DBG_CTOR( svt_AccessibleBrowseBoxCell, NULL );
53cdf0e10cSrcweir 		// set accessible name here, because for that we need the position of the cell
54cdf0e10cSrcweir 		// and so the base class isn't capable of doing this
55cdf0e10cSrcweir 		sal_Int32 nPos = _nRowPos * _rBrowseBox.GetColumnCount() + _nColPos;
56cdf0e10cSrcweir 		::rtl::OUString aAccName = _rBrowseBox.GetAccessibleObjectName( BBTYPE_TABLECELL, nPos );
57cdf0e10cSrcweir 		implSetName( aAccName );
58cdf0e10cSrcweir 	}
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
~AccessibleBrowseBoxCell()61cdf0e10cSrcweir 	AccessibleBrowseBoxCell::~AccessibleBrowseBoxCell()
62cdf0e10cSrcweir 	{
63cdf0e10cSrcweir 		DBG_DTOR( svt_AccessibleBrowseBoxCell, NULL );
64cdf0e10cSrcweir 	}
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
grabFocus()67cdf0e10cSrcweir 	void SAL_CALL AccessibleBrowseBoxCell::grabFocus() throw ( RuntimeException )
68cdf0e10cSrcweir 	{
69cdf0e10cSrcweir 		SolarMethodGuard aGuard( *this );
70cdf0e10cSrcweir 		mpBrowseBox->GoToCell( m_nRowPos, m_nColPos );
71cdf0e10cSrcweir 	}
72cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
implGetBoundingBox()73cdf0e10cSrcweir 	::Rectangle AccessibleBrowseBoxCell::implGetBoundingBox()
74cdf0e10cSrcweir 	{
75cdf0e10cSrcweir 		return mpBrowseBox->GetFieldRectPixelAbs( m_nRowPos, m_nColPos, sal_False, sal_False );
76cdf0e10cSrcweir 	}
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
implGetBoundingBoxOnScreen()79cdf0e10cSrcweir 	::Rectangle AccessibleBrowseBoxCell::implGetBoundingBoxOnScreen()
80cdf0e10cSrcweir 	{
81cdf0e10cSrcweir 		return mpBrowseBox->GetFieldRectPixelAbs( m_nRowPos, m_nColPos, sal_False );
82cdf0e10cSrcweir 	}
83cdf0e10cSrcweir 
84cdf0e10cSrcweir // .................................................................................
85cdf0e10cSrcweir }	// namespace accessibility
86cdf0e10cSrcweir // .................................................................................
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 
89