1*01aa44aaSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*01aa44aaSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*01aa44aaSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*01aa44aaSAndrew Rist * distributed with this work for additional information 6*01aa44aaSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*01aa44aaSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*01aa44aaSAndrew Rist * "License"); you may not use this file except in compliance 9*01aa44aaSAndrew Rist * with the License. You may obtain a copy of the License at 10*01aa44aaSAndrew Rist * 11*01aa44aaSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*01aa44aaSAndrew Rist * 13*01aa44aaSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*01aa44aaSAndrew Rist * software distributed under the License is distributed on an 15*01aa44aaSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*01aa44aaSAndrew Rist * KIND, either express or implied. See the License for the 17*01aa44aaSAndrew Rist * specific language governing permissions and limitations 18*01aa44aaSAndrew Rist * under the License. 19*01aa44aaSAndrew Rist * 20*01aa44aaSAndrew Rist *************************************************************/ 21*01aa44aaSAndrew Rist 22*01aa44aaSAndrew Rist 23cdf0e10cSrcweir #ifndef _SVTOOLS_BRWIMPL_HXX 24cdf0e10cSrcweir #define _SVTOOLS_BRWIMPL_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include "svtaccessiblefactory.hxx" 27cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp> 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include <map> 30cdf0e10cSrcweir #include <functional> 31cdf0e10cSrcweir 32cdf0e10cSrcweir namespace svt 33cdf0e10cSrcweir { 34cdf0e10cSrcweir class BrowseBoxImpl 35cdf0e10cSrcweir { 36cdf0e10cSrcweir // member 37cdf0e10cSrcweir public: 38cdf0e10cSrcweir typedef ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > AccessibleRef; 39cdf0e10cSrcweir typedef ::std::map< sal_Int32, AccessibleRef > THeaderCellMap; 40cdf0e10cSrcweir 41cdf0e10cSrcweir struct THeaderCellMapFunctorDispose : ::std::unary_function<THeaderCellMap::value_type,void> 42cdf0e10cSrcweir { operator ()svt::BrowseBoxImpl::THeaderCellMapFunctorDispose43cdf0e10cSrcweir inline void operator()(const THeaderCellMap::value_type& _aType) 44cdf0e10cSrcweir { 45cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComp( 46cdf0e10cSrcweir _aType.second, ::com::sun::star::uno::UNO_QUERY ); 47cdf0e10cSrcweir OSL_ENSURE( xComp.is() || !_aType.second.is(), "THeaderCellMapFunctorDispose: invalid accessible cell (no XComponent)!" ); 48cdf0e10cSrcweir if ( xComp.is() ) 49cdf0e10cSrcweir try 50cdf0e10cSrcweir { 51cdf0e10cSrcweir xComp->dispose(); 52cdf0e10cSrcweir } 53cdf0e10cSrcweir catch( const ::com::sun::star::uno::Exception& ) 54cdf0e10cSrcweir { 55cdf0e10cSrcweir OSL_ENSURE( sal_False, "THeaderCellMapFunctorDispose: caught an exception!" ); 56cdf0e10cSrcweir } 57cdf0e10cSrcweir } 58cdf0e10cSrcweir }; 59cdf0e10cSrcweir 60cdf0e10cSrcweir public: 61cdf0e10cSrcweir AccessibleFactoryAccess m_aFactoryAccess; 62cdf0e10cSrcweir IAccessibleBrowseBox* m_pAccessible; 63cdf0e10cSrcweir THeaderCellMap m_aColHeaderCellMap; 64cdf0e10cSrcweir THeaderCellMap m_aRowHeaderCellMap; 65cdf0e10cSrcweir 66cdf0e10cSrcweir public: BrowseBoxImpl()67cdf0e10cSrcweir BrowseBoxImpl() : m_pAccessible(NULL) 68cdf0e10cSrcweir { 69cdf0e10cSrcweir } 70cdf0e10cSrcweir 71cdf0e10cSrcweir 72cdf0e10cSrcweir /// @see AccessibleBrowseBox::getHeaderBar 73cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > 74cdf0e10cSrcweir getAccessibleHeaderBar( AccessibleBrowseBoxObjType _eObjType ); 75cdf0e10cSrcweir 76cdf0e10cSrcweir /// @see AccessibleBrowseBox::getTable 77cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > 78cdf0e10cSrcweir getAccessibleTable( ); 79cdf0e10cSrcweir 80cdf0e10cSrcweir }; 81cdf0e10cSrcweir } 82cdf0e10cSrcweir 83cdf0e10cSrcweir #endif // _SVTOOLS_BRWIMPL_HXX 84