merge the formfield patch from ooo-build
[ooovba.git] / svtools / source / brwbox / brwimpl.hxx
blobed2e6ac8732013346de13a1b909990b753f60adb
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: brwimpl.hxx,v $
10 * $Revision: 1.5 $
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 ************************************************************************/
30 #ifndef _SVTOOLS_BRWIMPL_HXX
31 #define _SVTOOLS_BRWIMPL_HXX
33 #include "svtaccessiblefactory.hxx"
34 #include <com/sun/star/lang/XComponent.hpp>
36 #include <map>
37 #include <functional>
39 namespace svt
41 class BrowseBoxImpl
43 // member
44 public:
45 typedef ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > AccessibleRef;
46 typedef ::std::map< sal_Int32, AccessibleRef > THeaderCellMap;
48 struct THeaderCellMapFunctorDispose : ::std::unary_function<THeaderCellMap::value_type,void>
50 inline void operator()(const THeaderCellMap::value_type& _aType)
52 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComp(
53 _aType.second, ::com::sun::star::uno::UNO_QUERY );
54 OSL_ENSURE( xComp.is() || !_aType.second.is(), "THeaderCellMapFunctorDispose: invalid accessible cell (no XComponent)!" );
55 if ( xComp.is() )
56 try
58 xComp->dispose();
60 catch( const ::com::sun::star::uno::Exception& )
62 OSL_ENSURE( sal_False, "THeaderCellMapFunctorDispose: caught an exception!" );
67 public:
68 AccessibleFactoryAccess m_aFactoryAccess;
69 IAccessibleBrowseBox* m_pAccessible;
70 THeaderCellMap m_aColHeaderCellMap;
71 THeaderCellMap m_aRowHeaderCellMap;
73 public:
74 BrowseBoxImpl() : m_pAccessible(NULL)
79 /// @see AccessibleBrowseBox::getHeaderBar
80 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
81 getAccessibleHeaderBar( AccessibleBrowseBoxObjType _eObjType );
83 /// @see AccessibleBrowseBox::getTable
84 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
85 getAccessibleTable( );
90 #endif // _SVTOOLS_BRWIMPL_HXX