1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: accessiblebrowseboxcell.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_accessibility.hxx"
33 #include "accessibility/extended/accessiblebrowseboxcell.hxx"
34 #include <svtools/accessibletableprovider.hxx>
36 // .................................................................................
37 namespace accessibility
39 // .................................................................................
41 using namespace ::com::sun::star::uno
;
42 using namespace ::com::sun::star::awt
;
43 using namespace ::com::sun::star::accessibility
;
44 using namespace ::svt
;
46 // =============================================================================
47 // = AccessibleBrowseBoxCell
48 // =============================================================================
49 DBG_NAME( svt_AccessibleBrowseBoxCell
)
50 // -----------------------------------------------------------------------------
51 AccessibleBrowseBoxCell::AccessibleBrowseBoxCell(
52 const Reference
< XAccessible
>& _rxParent
, IAccessibleTableProvider
& _rBrowseBox
,
53 const Reference
< XWindow
>& _xFocusWindow
,
54 sal_Int32 _nRowPos
, sal_uInt16 _nColPos
, AccessibleBrowseBoxObjType _eType
)
55 :AccessibleBrowseBoxBase( _rxParent
, _rBrowseBox
, _xFocusWindow
, _eType
)
56 ,m_nRowPos( _nRowPos
)
57 ,m_nColPos( _nColPos
)
59 DBG_CTOR( svt_AccessibleBrowseBoxCell
, NULL
);
60 // set accessible name here, because for that we need the position of the cell
61 // and so the base class isn't capable of doing this
62 sal_Int32 nPos
= _nRowPos
* _rBrowseBox
.GetColumnCount() + _nColPos
;
63 ::rtl::OUString aAccName
= _rBrowseBox
.GetAccessibleObjectName( BBTYPE_TABLECELL
, nPos
);
64 implSetName( aAccName
);
67 // -----------------------------------------------------------------------------
68 AccessibleBrowseBoxCell::~AccessibleBrowseBoxCell()
70 DBG_DTOR( svt_AccessibleBrowseBoxCell
, NULL
);
73 // -----------------------------------------------------------------------------
74 void SAL_CALL
AccessibleBrowseBoxCell::grabFocus() throw ( RuntimeException
)
76 SolarMethodGuard
aGuard( *this );
77 mpBrowseBox
->GoToCell( m_nRowPos
, m_nColPos
);
79 // -----------------------------------------------------------------------------
80 ::Rectangle
AccessibleBrowseBoxCell::implGetBoundingBox()
82 return mpBrowseBox
->GetFieldRectPixelAbs( m_nRowPos
, m_nColPos
, FALSE
, FALSE
);
85 // -----------------------------------------------------------------------------
86 ::Rectangle
AccessibleBrowseBoxCell::implGetBoundingBoxOnScreen()
88 return mpBrowseBox
->GetFieldRectPixelAbs( m_nRowPos
, m_nColPos
, FALSE
);
91 // .................................................................................
92 } // namespace accessibility
93 // .................................................................................