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 10*0841af79SAndrew Rist * 11*0841af79SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*0841af79SAndrew Rist * 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. 19*0841af79SAndrew Rist * 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/accessibletabbarpage.hxx> 27cdf0e10cSrcweir #include <svtools/tabbar.hxx> 28cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleEventId.hpp> 29cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleRole.hpp> 30cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleStateType.hpp> 31cdf0e10cSrcweir #include <unotools/accessiblestatesethelper.hxx> 32cdf0e10cSrcweir #include <unotools/accessiblerelationsethelper.hxx> 33cdf0e10cSrcweir #include <vcl/svapp.hxx> 34cdf0e10cSrcweir #include <toolkit/helper/convert.hxx> 35cdf0e10cSrcweir 36cdf0e10cSrcweir 37cdf0e10cSrcweir //......................................................................... 38cdf0e10cSrcweir namespace accessibility 39cdf0e10cSrcweir { 40cdf0e10cSrcweir //......................................................................... 41cdf0e10cSrcweir 42cdf0e10cSrcweir using namespace ::com::sun::star::accessibility; 43cdf0e10cSrcweir using namespace ::com::sun::star::uno; 44cdf0e10cSrcweir using namespace ::com::sun::star::lang; 45cdf0e10cSrcweir using namespace ::com::sun::star; 46cdf0e10cSrcweir using namespace ::comphelper; 47cdf0e10cSrcweir 48cdf0e10cSrcweir // ----------------------------------------------------------------------------- 49cdf0e10cSrcweir // class AccessibleTabBarPage 50cdf0e10cSrcweir // ----------------------------------------------------------------------------- 51cdf0e10cSrcweir AccessibleTabBarPage(TabBar * pTabBar,sal_uInt16 nPageId,const Reference<XAccessible> & rxParent)52cdf0e10cSrcweir AccessibleTabBarPage::AccessibleTabBarPage( TabBar* pTabBar, sal_uInt16 nPageId, const Reference< XAccessible >& rxParent ) 53cdf0e10cSrcweir :AccessibleTabBarBase( pTabBar ) 54cdf0e10cSrcweir ,m_nPageId( nPageId ) 55cdf0e10cSrcweir ,m_xParent( rxParent ) 56cdf0e10cSrcweir { 57cdf0e10cSrcweir m_bEnabled = IsEnabled(); 58cdf0e10cSrcweir m_bShowing = IsShowing(); 59cdf0e10cSrcweir m_bSelected = IsSelected(); 60cdf0e10cSrcweir 61cdf0e10cSrcweir if ( m_pTabBar ) 62cdf0e10cSrcweir m_sPageText = m_pTabBar->GetPageText( m_nPageId ); 63cdf0e10cSrcweir } 64cdf0e10cSrcweir 65cdf0e10cSrcweir // ----------------------------------------------------------------------------- 66cdf0e10cSrcweir ~AccessibleTabBarPage()67cdf0e10cSrcweir AccessibleTabBarPage::~AccessibleTabBarPage() 68cdf0e10cSrcweir { 69cdf0e10cSrcweir } 70cdf0e10cSrcweir 71cdf0e10cSrcweir // ----------------------------------------------------------------------------- 72cdf0e10cSrcweir IsEnabled()73cdf0e10cSrcweir sal_Bool AccessibleTabBarPage::IsEnabled() 74cdf0e10cSrcweir { 75cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 76cdf0e10cSrcweir 77cdf0e10cSrcweir sal_Bool bEnabled = sal_False; 78cdf0e10cSrcweir if ( m_pTabBar ) 79cdf0e10cSrcweir bEnabled = m_pTabBar->IsPageEnabled( m_nPageId ); 80cdf0e10cSrcweir 81cdf0e10cSrcweir return bEnabled; 82cdf0e10cSrcweir } 83cdf0e10cSrcweir 84cdf0e10cSrcweir // ----------------------------------------------------------------------------- 85cdf0e10cSrcweir IsShowing()86cdf0e10cSrcweir sal_Bool AccessibleTabBarPage::IsShowing() 87cdf0e10cSrcweir { 88cdf0e10cSrcweir sal_Bool bShowing = sal_False; 89cdf0e10cSrcweir 90cdf0e10cSrcweir if ( m_pTabBar && m_pTabBar->IsVisible() ) 91cdf0e10cSrcweir bShowing = sal_True; 92cdf0e10cSrcweir 93cdf0e10cSrcweir return bShowing; 94cdf0e10cSrcweir } 95cdf0e10cSrcweir 96cdf0e10cSrcweir // ----------------------------------------------------------------------------- 97cdf0e10cSrcweir IsSelected()98cdf0e10cSrcweir sal_Bool AccessibleTabBarPage::IsSelected() 99cdf0e10cSrcweir { 100cdf0e10cSrcweir sal_Bool bSelected = sal_False; 101cdf0e10cSrcweir 102cdf0e10cSrcweir if ( m_pTabBar && m_pTabBar->GetCurPageId() == m_nPageId ) 103cdf0e10cSrcweir bSelected = sal_True; 104cdf0e10cSrcweir 105cdf0e10cSrcweir return bSelected; 106cdf0e10cSrcweir } 107cdf0e10cSrcweir 108cdf0e10cSrcweir // ----------------------------------------------------------------------------- 109cdf0e10cSrcweir SetEnabled(sal_Bool bEnabled)110cdf0e10cSrcweir void AccessibleTabBarPage::SetEnabled( sal_Bool bEnabled ) 111cdf0e10cSrcweir { 112cdf0e10cSrcweir if ( m_bEnabled != bEnabled ) 113cdf0e10cSrcweir { 114cdf0e10cSrcweir Any aOldValue[2], aNewValue[2]; 115cdf0e10cSrcweir if ( m_bEnabled ) 116cdf0e10cSrcweir { 117cdf0e10cSrcweir aOldValue[0] <<= AccessibleStateType::SENSITIVE; 118cdf0e10cSrcweir aOldValue[1] <<= AccessibleStateType::ENABLED; 119cdf0e10cSrcweir } 120cdf0e10cSrcweir else 121cdf0e10cSrcweir { 122cdf0e10cSrcweir 123cdf0e10cSrcweir aNewValue[0] <<= AccessibleStateType::ENABLED; 124cdf0e10cSrcweir aNewValue[1] <<= AccessibleStateType::SENSITIVE; 125cdf0e10cSrcweir } 126cdf0e10cSrcweir m_bEnabled = bEnabled; 127cdf0e10cSrcweir NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue[0], aNewValue[0] ); 128cdf0e10cSrcweir NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue[1], aNewValue[1] ); 129cdf0e10cSrcweir } 130cdf0e10cSrcweir } 131cdf0e10cSrcweir 132cdf0e10cSrcweir // ----------------------------------------------------------------------------- 133cdf0e10cSrcweir SetShowing(sal_Bool bShowing)134cdf0e10cSrcweir void AccessibleTabBarPage::SetShowing( sal_Bool bShowing ) 135cdf0e10cSrcweir { 136cdf0e10cSrcweir if ( m_bShowing != bShowing ) 137cdf0e10cSrcweir { 138cdf0e10cSrcweir Any aOldValue, aNewValue; 139cdf0e10cSrcweir if ( m_bShowing ) 140cdf0e10cSrcweir aOldValue <<= AccessibleStateType::SHOWING; 141cdf0e10cSrcweir else 142cdf0e10cSrcweir aNewValue <<= AccessibleStateType::SHOWING; 143cdf0e10cSrcweir m_bShowing = bShowing; 144cdf0e10cSrcweir NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue ); 145cdf0e10cSrcweir } 146cdf0e10cSrcweir } 147cdf0e10cSrcweir 148cdf0e10cSrcweir // ----------------------------------------------------------------------------- 149cdf0e10cSrcweir SetSelected(sal_Bool bSelected)150cdf0e10cSrcweir void AccessibleTabBarPage::SetSelected( sal_Bool bSelected ) 151cdf0e10cSrcweir { 152cdf0e10cSrcweir if ( m_bSelected != bSelected ) 153cdf0e10cSrcweir { 154cdf0e10cSrcweir Any aOldValue, aNewValue; 155cdf0e10cSrcweir if ( m_bSelected ) 156cdf0e10cSrcweir aOldValue <<= AccessibleStateType::SELECTED; 157cdf0e10cSrcweir else 158cdf0e10cSrcweir aNewValue <<= AccessibleStateType::SELECTED; 159cdf0e10cSrcweir m_bSelected = bSelected; 160cdf0e10cSrcweir NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue ); 161cdf0e10cSrcweir } 162cdf0e10cSrcweir } 163cdf0e10cSrcweir 164cdf0e10cSrcweir // ----------------------------------------------------------------------------- 165cdf0e10cSrcweir SetPageText(const::rtl::OUString & sPageText)166cdf0e10cSrcweir void AccessibleTabBarPage::SetPageText( const ::rtl::OUString& sPageText ) 167cdf0e10cSrcweir { 168cdf0e10cSrcweir if ( !m_sPageText.equals( sPageText ) ) 169cdf0e10cSrcweir { 170cdf0e10cSrcweir Any aOldValue, aNewValue; 171cdf0e10cSrcweir aOldValue <<= m_sPageText; 172cdf0e10cSrcweir aNewValue <<= sPageText; 173cdf0e10cSrcweir m_sPageText = sPageText; 174cdf0e10cSrcweir NotifyAccessibleEvent( AccessibleEventId::NAME_CHANGED, aOldValue, aNewValue ); 175cdf0e10cSrcweir } 176cdf0e10cSrcweir } 177cdf0e10cSrcweir 178cdf0e10cSrcweir // ----------------------------------------------------------------------------- 179cdf0e10cSrcweir FillAccessibleStateSet(utl::AccessibleStateSetHelper & rStateSet)180cdf0e10cSrcweir void AccessibleTabBarPage::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) 181cdf0e10cSrcweir { 182cdf0e10cSrcweir if ( IsEnabled() ) 183cdf0e10cSrcweir { 184cdf0e10cSrcweir rStateSet.AddState( AccessibleStateType::ENABLED ); 185cdf0e10cSrcweir rStateSet.AddState( AccessibleStateType::SENSITIVE ); 186cdf0e10cSrcweir } 187cdf0e10cSrcweir 188cdf0e10cSrcweir rStateSet.AddState( AccessibleStateType::VISIBLE ); 189cdf0e10cSrcweir 190cdf0e10cSrcweir if ( IsShowing() ) 191cdf0e10cSrcweir rStateSet.AddState( AccessibleStateType::SHOWING ); 192cdf0e10cSrcweir 193cdf0e10cSrcweir rStateSet.AddState( AccessibleStateType::SELECTABLE ); 194cdf0e10cSrcweir 195cdf0e10cSrcweir if ( IsSelected() ) 196cdf0e10cSrcweir rStateSet.AddState( AccessibleStateType::SELECTED ); 197cdf0e10cSrcweir } 198cdf0e10cSrcweir 199cdf0e10cSrcweir // ----------------------------------------------------------------------------- 200cdf0e10cSrcweir // OCommonAccessibleComponent 201cdf0e10cSrcweir // ----------------------------------------------------------------------------- 202cdf0e10cSrcweir implGetBounds()203cdf0e10cSrcweir awt::Rectangle AccessibleTabBarPage::implGetBounds() throw (RuntimeException) 204cdf0e10cSrcweir { 205cdf0e10cSrcweir awt::Rectangle aBounds; 206cdf0e10cSrcweir if ( m_pTabBar ) 207cdf0e10cSrcweir { 208cdf0e10cSrcweir // get bounding rectangle relative to the AccessibleTabBar 209cdf0e10cSrcweir aBounds = AWTRectangle( m_pTabBar->GetPageRect( m_nPageId ) ); 210cdf0e10cSrcweir 211cdf0e10cSrcweir // get position of the AccessibleTabBarPageList relative to the AccessibleTabBar 212cdf0e10cSrcweir Reference< XAccessible > xParent = getAccessibleParent(); 213cdf0e10cSrcweir if ( xParent.is() ) 214cdf0e10cSrcweir { 215cdf0e10cSrcweir Reference< XAccessibleComponent > xParentComponent( xParent->getAccessibleContext(), UNO_QUERY ); 216cdf0e10cSrcweir if ( xParentComponent.is() ) 217cdf0e10cSrcweir { 218cdf0e10cSrcweir awt::Point aParentLoc = xParentComponent->getLocation(); 219cdf0e10cSrcweir 220cdf0e10cSrcweir // calculate bounding rectangle relative to the AccessibleTabBarPageList 221cdf0e10cSrcweir aBounds.X -= aParentLoc.X; 222cdf0e10cSrcweir aBounds.Y -= aParentLoc.Y; 223cdf0e10cSrcweir } 224cdf0e10cSrcweir } 225cdf0e10cSrcweir } 226cdf0e10cSrcweir 227cdf0e10cSrcweir return aBounds; 228cdf0e10cSrcweir } 229cdf0e10cSrcweir 230cdf0e10cSrcweir // ----------------------------------------------------------------------------- 231cdf0e10cSrcweir // XInterface 232cdf0e10cSrcweir // ----------------------------------------------------------------------------- 233cdf0e10cSrcweir IMPLEMENT_FORWARD_XINTERFACE2(AccessibleTabBarPage,AccessibleExtendedComponentHelper_BASE,AccessibleTabBarPage_BASE)234cdf0e10cSrcweir IMPLEMENT_FORWARD_XINTERFACE2( AccessibleTabBarPage, AccessibleExtendedComponentHelper_BASE, AccessibleTabBarPage_BASE ) 235cdf0e10cSrcweir 236cdf0e10cSrcweir // ----------------------------------------------------------------------------- 237cdf0e10cSrcweir // XTypeProvider 238cdf0e10cSrcweir // ----------------------------------------------------------------------------- 239cdf0e10cSrcweir 240cdf0e10cSrcweir IMPLEMENT_FORWARD_XTYPEPROVIDER2( AccessibleTabBarPage, AccessibleExtendedComponentHelper_BASE, AccessibleTabBarPage_BASE ) 241cdf0e10cSrcweir 242cdf0e10cSrcweir // ----------------------------------------------------------------------------- 243cdf0e10cSrcweir // XComponent 244cdf0e10cSrcweir // ----------------------------------------------------------------------------- 245cdf0e10cSrcweir 246cdf0e10cSrcweir void AccessibleTabBarPage::disposing() 247cdf0e10cSrcweir { 248cdf0e10cSrcweir AccessibleTabBarBase::disposing(); 249cdf0e10cSrcweir m_sPageText = ::rtl::OUString(); 250cdf0e10cSrcweir } 251cdf0e10cSrcweir 252cdf0e10cSrcweir // ----------------------------------------------------------------------------- 253cdf0e10cSrcweir // XServiceInfo 254cdf0e10cSrcweir // ----------------------------------------------------------------------------- 255cdf0e10cSrcweir getImplementationName()256cdf0e10cSrcweir ::rtl::OUString AccessibleTabBarPage::getImplementationName() throw (RuntimeException) 257cdf0e10cSrcweir { 258cdf0e10cSrcweir return ::rtl::OUString::createFromAscii( "com.sun.star.comp.svtools.AccessibleTabBarPage" ); 259cdf0e10cSrcweir } 260cdf0e10cSrcweir 261cdf0e10cSrcweir // ----------------------------------------------------------------------------- 262cdf0e10cSrcweir supportsService(const::rtl::OUString & rServiceName)263cdf0e10cSrcweir sal_Bool AccessibleTabBarPage::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) 264cdf0e10cSrcweir { 265cdf0e10cSrcweir Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() ); 266cdf0e10cSrcweir const ::rtl::OUString* pNames = aNames.getConstArray(); 267cdf0e10cSrcweir const ::rtl::OUString* pEnd = pNames + aNames.getLength(); 268cdf0e10cSrcweir for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) 269cdf0e10cSrcweir ; 270cdf0e10cSrcweir 271cdf0e10cSrcweir return pNames != pEnd; 272cdf0e10cSrcweir } 273cdf0e10cSrcweir 274cdf0e10cSrcweir // ----------------------------------------------------------------------------- 275cdf0e10cSrcweir getSupportedServiceNames()276cdf0e10cSrcweir Sequence< ::rtl::OUString > AccessibleTabBarPage::getSupportedServiceNames() throw (RuntimeException) 277cdf0e10cSrcweir { 278cdf0e10cSrcweir Sequence< ::rtl::OUString > aNames(1); 279cdf0e10cSrcweir aNames[0] = ::rtl::OUString::createFromAscii( "com.sun.star.awt.AccessibleTabBarPage" ); 280cdf0e10cSrcweir return aNames; 281cdf0e10cSrcweir } 282cdf0e10cSrcweir 283cdf0e10cSrcweir // ----------------------------------------------------------------------------- 284cdf0e10cSrcweir // XAccessible 285cdf0e10cSrcweir // ----------------------------------------------------------------------------- 286cdf0e10cSrcweir getAccessibleContext()287cdf0e10cSrcweir Reference< XAccessibleContext > AccessibleTabBarPage::getAccessibleContext( ) throw (RuntimeException) 288cdf0e10cSrcweir { 289cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 290cdf0e10cSrcweir 291cdf0e10cSrcweir return this; 292cdf0e10cSrcweir } 293cdf0e10cSrcweir 294cdf0e10cSrcweir // ----------------------------------------------------------------------------- 295cdf0e10cSrcweir // XAccessibleContext 296cdf0e10cSrcweir // ----------------------------------------------------------------------------- 297cdf0e10cSrcweir getAccessibleChildCount()298cdf0e10cSrcweir sal_Int32 AccessibleTabBarPage::getAccessibleChildCount() throw (RuntimeException) 299cdf0e10cSrcweir { 300cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 301cdf0e10cSrcweir 302cdf0e10cSrcweir return 0; 303cdf0e10cSrcweir } 304cdf0e10cSrcweir 305cdf0e10cSrcweir // ----------------------------------------------------------------------------- 306cdf0e10cSrcweir getAccessibleChild(sal_Int32 i)307cdf0e10cSrcweir Reference< XAccessible > AccessibleTabBarPage::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException, RuntimeException) 308cdf0e10cSrcweir { 309cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 310cdf0e10cSrcweir 311cdf0e10cSrcweir if ( i < 0 || i >= getAccessibleChildCount() ) 312cdf0e10cSrcweir throw IndexOutOfBoundsException(); 313cdf0e10cSrcweir 314cdf0e10cSrcweir return Reference< XAccessible >(); 315cdf0e10cSrcweir } 316cdf0e10cSrcweir 317cdf0e10cSrcweir // ----------------------------------------------------------------------------- 318cdf0e10cSrcweir getAccessibleParent()319cdf0e10cSrcweir Reference< XAccessible > AccessibleTabBarPage::getAccessibleParent( ) throw (RuntimeException) 320cdf0e10cSrcweir { 321cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 322cdf0e10cSrcweir 323cdf0e10cSrcweir return m_xParent; 324cdf0e10cSrcweir } 325cdf0e10cSrcweir 326cdf0e10cSrcweir // ----------------------------------------------------------------------------- 327cdf0e10cSrcweir getAccessibleIndexInParent()328cdf0e10cSrcweir sal_Int32 AccessibleTabBarPage::getAccessibleIndexInParent( ) throw (RuntimeException) 329cdf0e10cSrcweir { 330cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 331cdf0e10cSrcweir 332cdf0e10cSrcweir sal_Int32 nIndexInParent = -1; 333cdf0e10cSrcweir if ( m_pTabBar ) 334cdf0e10cSrcweir nIndexInParent = m_pTabBar->GetPagePos( m_nPageId ); 335cdf0e10cSrcweir 336cdf0e10cSrcweir return nIndexInParent; 337cdf0e10cSrcweir } 338cdf0e10cSrcweir 339cdf0e10cSrcweir // ----------------------------------------------------------------------------- 340cdf0e10cSrcweir getAccessibleRole()341cdf0e10cSrcweir sal_Int16 AccessibleTabBarPage::getAccessibleRole( ) throw (RuntimeException) 342cdf0e10cSrcweir { 343cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 344cdf0e10cSrcweir 345cdf0e10cSrcweir return AccessibleRole::PAGE_TAB; 346cdf0e10cSrcweir } 347cdf0e10cSrcweir 348cdf0e10cSrcweir // ----------------------------------------------------------------------------- 349cdf0e10cSrcweir getAccessibleDescription()350cdf0e10cSrcweir ::rtl::OUString AccessibleTabBarPage::getAccessibleDescription( ) throw (RuntimeException) 351cdf0e10cSrcweir { 352cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 353cdf0e10cSrcweir 354cdf0e10cSrcweir ::rtl::OUString sDescription; 355cdf0e10cSrcweir if ( m_pTabBar ) 356cdf0e10cSrcweir sDescription = m_pTabBar->GetHelpText( m_nPageId ); 357cdf0e10cSrcweir 358cdf0e10cSrcweir return sDescription; 359cdf0e10cSrcweir } 360cdf0e10cSrcweir 361cdf0e10cSrcweir // ----------------------------------------------------------------------------- 362cdf0e10cSrcweir getAccessibleName()363cdf0e10cSrcweir ::rtl::OUString AccessibleTabBarPage::getAccessibleName( ) throw (RuntimeException) 364cdf0e10cSrcweir { 365cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 366cdf0e10cSrcweir 367cdf0e10cSrcweir return m_sPageText; 368cdf0e10cSrcweir } 369cdf0e10cSrcweir 370cdf0e10cSrcweir // ----------------------------------------------------------------------------- 371cdf0e10cSrcweir getAccessibleRelationSet()372cdf0e10cSrcweir Reference< XAccessibleRelationSet > AccessibleTabBarPage::getAccessibleRelationSet( ) throw (RuntimeException) 373cdf0e10cSrcweir { 374cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 375cdf0e10cSrcweir 376cdf0e10cSrcweir utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper; 377cdf0e10cSrcweir Reference< XAccessibleRelationSet > xSet = pRelationSetHelper; 378cdf0e10cSrcweir return xSet; 379cdf0e10cSrcweir } 380cdf0e10cSrcweir 381cdf0e10cSrcweir // ----------------------------------------------------------------------------- 382cdf0e10cSrcweir getAccessibleStateSet()383cdf0e10cSrcweir Reference< XAccessibleStateSet > AccessibleTabBarPage::getAccessibleStateSet( ) throw (RuntimeException) 384cdf0e10cSrcweir { 385cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 386cdf0e10cSrcweir 387cdf0e10cSrcweir utl::AccessibleStateSetHelper* pStateSetHelper = new utl::AccessibleStateSetHelper; 388cdf0e10cSrcweir Reference< XAccessibleStateSet > xSet = pStateSetHelper; 389cdf0e10cSrcweir 390cdf0e10cSrcweir if ( !rBHelper.bDisposed && !rBHelper.bInDispose ) 391cdf0e10cSrcweir { 392cdf0e10cSrcweir FillAccessibleStateSet( *pStateSetHelper ); 393cdf0e10cSrcweir } 394cdf0e10cSrcweir else 395cdf0e10cSrcweir { 396cdf0e10cSrcweir pStateSetHelper->AddState( AccessibleStateType::DEFUNC ); 397cdf0e10cSrcweir } 398cdf0e10cSrcweir 399cdf0e10cSrcweir return xSet; 400cdf0e10cSrcweir } 401cdf0e10cSrcweir 402cdf0e10cSrcweir // ----------------------------------------------------------------------------- 403cdf0e10cSrcweir getLocale()404cdf0e10cSrcweir Locale AccessibleTabBarPage::getLocale( ) throw (IllegalAccessibleComponentStateException, RuntimeException) 405cdf0e10cSrcweir { 406cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 407cdf0e10cSrcweir 408cdf0e10cSrcweir return Application::GetSettings().GetLocale(); 409cdf0e10cSrcweir } 410cdf0e10cSrcweir 411cdf0e10cSrcweir // ----------------------------------------------------------------------------- 412cdf0e10cSrcweir // XAccessibleComponent 413cdf0e10cSrcweir // ----------------------------------------------------------------------------- 414cdf0e10cSrcweir getAccessibleAtPoint(const awt::Point &)415cdf0e10cSrcweir Reference< XAccessible > AccessibleTabBarPage::getAccessibleAtPoint( const awt::Point& ) throw (RuntimeException) 416cdf0e10cSrcweir { 417cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 418cdf0e10cSrcweir 419cdf0e10cSrcweir return Reference< XAccessible >(); 420cdf0e10cSrcweir } 421cdf0e10cSrcweir 422cdf0e10cSrcweir // ----------------------------------------------------------------------------- 423cdf0e10cSrcweir grabFocus()424cdf0e10cSrcweir void AccessibleTabBarPage::grabFocus( ) throw (RuntimeException) 425cdf0e10cSrcweir { 426cdf0e10cSrcweir // no focus 427cdf0e10cSrcweir } 428cdf0e10cSrcweir 429cdf0e10cSrcweir // ----------------------------------------------------------------------------- 430cdf0e10cSrcweir getForeground()431cdf0e10cSrcweir sal_Int32 AccessibleTabBarPage::getForeground( ) throw (RuntimeException) 432cdf0e10cSrcweir { 433cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 434cdf0e10cSrcweir 435cdf0e10cSrcweir sal_Int32 nColor = 0; 436cdf0e10cSrcweir Reference< XAccessible > xParent = getAccessibleParent(); 437cdf0e10cSrcweir if ( xParent.is() ) 438cdf0e10cSrcweir { 439cdf0e10cSrcweir Reference< XAccessibleComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); 440cdf0e10cSrcweir if ( xParentComp.is() ) 441cdf0e10cSrcweir nColor = xParentComp->getForeground(); 442cdf0e10cSrcweir } 443cdf0e10cSrcweir 444cdf0e10cSrcweir return nColor; 445cdf0e10cSrcweir } 446cdf0e10cSrcweir 447cdf0e10cSrcweir // ----------------------------------------------------------------------------- 448cdf0e10cSrcweir getBackground()449cdf0e10cSrcweir sal_Int32 AccessibleTabBarPage::getBackground( ) throw (RuntimeException) 450cdf0e10cSrcweir { 451cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 452cdf0e10cSrcweir 453cdf0e10cSrcweir sal_Int32 nColor = 0; 454cdf0e10cSrcweir Reference< XAccessible > xParent = getAccessibleParent(); 455cdf0e10cSrcweir if ( xParent.is() ) 456cdf0e10cSrcweir { 457cdf0e10cSrcweir Reference< XAccessibleComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); 458cdf0e10cSrcweir if ( xParentComp.is() ) 459cdf0e10cSrcweir nColor = xParentComp->getBackground(); 460cdf0e10cSrcweir } 461cdf0e10cSrcweir 462cdf0e10cSrcweir return nColor; 463cdf0e10cSrcweir } 464cdf0e10cSrcweir 465cdf0e10cSrcweir // ----------------------------------------------------------------------------- 466cdf0e10cSrcweir // XAccessibleExtendedComponent 467cdf0e10cSrcweir // ----------------------------------------------------------------------------- 468cdf0e10cSrcweir getFont()469cdf0e10cSrcweir Reference< awt::XFont > AccessibleTabBarPage::getFont( ) throw (RuntimeException) 470cdf0e10cSrcweir { 471cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 472cdf0e10cSrcweir 473cdf0e10cSrcweir Reference< awt::XFont > xFont; 474cdf0e10cSrcweir Reference< XAccessible > xParent = getAccessibleParent(); 475cdf0e10cSrcweir if ( xParent.is() ) 476cdf0e10cSrcweir { 477cdf0e10cSrcweir Reference< XAccessibleExtendedComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); 478cdf0e10cSrcweir if ( xParentComp.is() ) 479cdf0e10cSrcweir xFont = xParentComp->getFont(); 480cdf0e10cSrcweir } 481cdf0e10cSrcweir 482cdf0e10cSrcweir return xFont; 483cdf0e10cSrcweir } 484cdf0e10cSrcweir 485cdf0e10cSrcweir // ----------------------------------------------------------------------------- 486cdf0e10cSrcweir getTitledBorderText()487cdf0e10cSrcweir ::rtl::OUString AccessibleTabBarPage::getTitledBorderText( ) throw (RuntimeException) 488cdf0e10cSrcweir { 489cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 490cdf0e10cSrcweir 491cdf0e10cSrcweir return m_sPageText; 492cdf0e10cSrcweir } 493cdf0e10cSrcweir 494cdf0e10cSrcweir // ----------------------------------------------------------------------------- 495cdf0e10cSrcweir getToolTipText()496cdf0e10cSrcweir ::rtl::OUString AccessibleTabBarPage::getToolTipText( ) throw (RuntimeException) 497cdf0e10cSrcweir { 498cdf0e10cSrcweir OExternalLockGuard aGuard( this ); 499cdf0e10cSrcweir 500cdf0e10cSrcweir return ::rtl::OUString(); 501cdf0e10cSrcweir } 502cdf0e10cSrcweir 503cdf0e10cSrcweir // ----------------------------------------------------------------------------- 504cdf0e10cSrcweir 505cdf0e10cSrcweir //......................................................................... 506cdf0e10cSrcweir } // namespace accessibility 507cdf0e10cSrcweir //......................................................................... 508