vclxaccessibletabpage.cxx (c82f2877) | vclxaccessibletabpage.cxx (aa5a148e) |
---|---|
1/************************************************************** | 1/************************************************************** |
2 * | 2 * |
3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at | 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at |
10 * | 10 * |
11 * http://www.apache.org/licenses/LICENSE-2.0 | 11 * http://www.apache.org/licenses/LICENSE-2.0 |
12 * | 12 * |
13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. | 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. |
19 * | 19 * |
20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_accessibility.hxx" 26#include <accessibility/standard/vclxaccessibletabpage.hxx> 27#include <toolkit/helper/externallock.hxx> --- 31 unchanged lines hidden (view full) --- 59VCLXAccessibleTabPage::VCLXAccessibleTabPage( TabControl* pTabControl, sal_uInt16 nPageId ) 60 :AccessibleTextHelper_BASE( new VCLExternalSolarLock() ) 61 ,m_pTabControl( pTabControl ) 62 ,m_nPageId( nPageId ) 63{ 64 m_pExternalLock = static_cast< VCLExternalSolarLock* >( getExternalLock() ); 65 m_bFocused = IsFocused(); 66 m_bSelected = IsSelected(); | 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_accessibility.hxx" 26#include <accessibility/standard/vclxaccessibletabpage.hxx> 27#include <toolkit/helper/externallock.hxx> --- 31 unchanged lines hidden (view full) --- 59VCLXAccessibleTabPage::VCLXAccessibleTabPage( TabControl* pTabControl, sal_uInt16 nPageId ) 60 :AccessibleTextHelper_BASE( new VCLExternalSolarLock() ) 61 ,m_pTabControl( pTabControl ) 62 ,m_nPageId( nPageId ) 63{ 64 m_pExternalLock = static_cast< VCLExternalSolarLock* >( getExternalLock() ); 65 m_bFocused = IsFocused(); 66 m_bSelected = IsSelected(); |
67 m_sPageText = GetPageText(); | 67 m_sPageText = GetPageText(); |
68} 69 70// ----------------------------------------------------------------------------- 71 72VCLXAccessibleTabPage::~VCLXAccessibleTabPage() 73{ 74 delete m_pExternalLock; 75 m_pExternalLock = NULL; 76} 77 78// ----------------------------------------------------------------------------- 79 80bool VCLXAccessibleTabPage::IsFocused() 81{ | 68} 69 70// ----------------------------------------------------------------------------- 71 72VCLXAccessibleTabPage::~VCLXAccessibleTabPage() 73{ 74 delete m_pExternalLock; 75 m_pExternalLock = NULL; 76} 77 78// ----------------------------------------------------------------------------- 79 80bool VCLXAccessibleTabPage::IsFocused() 81{ |
82 bool bFocused = false; | 82 bool bFocused = false; |
83 | 83 |
84 if ( m_pTabControl && m_pTabControl->HasFocus() && m_pTabControl->GetCurPageId() == m_nPageId ) 85 bFocused = true; | 84 if ( m_pTabControl && m_pTabControl->HasFocus() && m_pTabControl->GetCurPageId() == m_nPageId ) 85 bFocused = true; |
86 | 86 |
87 return bFocused; | 87 return bFocused; |
88} 89 90// ----------------------------------------------------------------------------- 91 92bool VCLXAccessibleTabPage::IsSelected() 93{ | 88} 89 90// ----------------------------------------------------------------------------- 91 92bool VCLXAccessibleTabPage::IsSelected() 93{ |
94 bool bSelected = false; | 94 bool bSelected = false; |
95 | 95 |
96 if ( m_pTabControl && m_pTabControl->GetCurPageId() == m_nPageId ) 97 bSelected = true; | 96 if ( m_pTabControl && m_pTabControl->GetCurPageId() == m_nPageId ) 97 bSelected = true; |
98 | 98 |
99 return bSelected; | 99 return bSelected; |
100} 101 102// ----------------------------------------------------------------------------- 103 104void VCLXAccessibleTabPage::SetFocused( bool bFocused ) 105{ 106 if ( m_bFocused != bFocused ) 107 { --- 14 unchanged lines hidden (view full) --- 122 if ( m_bSelected != bSelected ) 123 { 124 Any aOldValue, aNewValue; 125 if ( m_bSelected ) 126 aOldValue <<= AccessibleStateType::SELECTED; 127 else 128 aNewValue <<= AccessibleStateType::SELECTED; 129 m_bSelected = bSelected; | 100} 101 102// ----------------------------------------------------------------------------- 103 104void VCLXAccessibleTabPage::SetFocused( bool bFocused ) 105{ 106 if ( m_bFocused != bFocused ) 107 { --- 14 unchanged lines hidden (view full) --- 122 if ( m_bSelected != bSelected ) 123 { 124 Any aOldValue, aNewValue; 125 if ( m_bSelected ) 126 aOldValue <<= AccessibleStateType::SELECTED; 127 else 128 aNewValue <<= AccessibleStateType::SELECTED; 129 m_bSelected = bSelected; |
130 NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue ); | 130 NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue ); |
131 } 132} 133 134// ----------------------------------------------------------------------------- 135 136void VCLXAccessibleTabPage::SetPageText( const ::rtl::OUString& sPageText ) 137{ | 131 } 132} 133 134// ----------------------------------------------------------------------------- 135 136void VCLXAccessibleTabPage::SetPageText( const ::rtl::OUString& sPageText ) 137{ |
138 Any aOldValue, aNewValue; 139 if ( OCommonAccessibleText::implInitTextChangedEvent( m_sPageText, sPageText, aOldValue, aNewValue ) ) 140 { 141 Any aOldName, aNewName; 142 aOldName <<= m_sPageText; 143 aNewName <<= sPageText; 144 m_sPageText = sPageText; 145 NotifyAccessibleEvent( AccessibleEventId::NAME_CHANGED, aOldName, aNewName ); 146 NotifyAccessibleEvent( AccessibleEventId::TEXT_CHANGED, aOldValue, aNewValue ); 147 } | 138 Any aOldValue, aNewValue; 139 if ( OCommonAccessibleText::implInitTextChangedEvent( m_sPageText, sPageText, aOldValue, aNewValue ) ) 140 { 141 Any aOldName, aNewName; 142 aOldName <<= m_sPageText; 143 aNewName <<= sPageText; 144 m_sPageText = sPageText; 145 NotifyAccessibleEvent( AccessibleEventId::NAME_CHANGED, aOldName, aNewName ); 146 NotifyAccessibleEvent( AccessibleEventId::TEXT_CHANGED, aOldValue, aNewValue ); 147 } |
148} 149 150// ----------------------------------------------------------------------------- 151 152::rtl::OUString VCLXAccessibleTabPage::GetPageText() 153{ 154 ::rtl::OUString sText; 155 if ( m_pTabControl ) 156 sText = OutputDevice::GetNonMnemonicString( m_pTabControl->GetPageText( m_nPageId ) ); 157 158 return sText; 159} 160 161// ----------------------------------------------------------------------------- 162 163void VCLXAccessibleTabPage::Update( bool bNew ) 164{ | 148} 149 150// ----------------------------------------------------------------------------- 151 152::rtl::OUString VCLXAccessibleTabPage::GetPageText() 153{ 154 ::rtl::OUString sText; 155 if ( m_pTabControl ) 156 sText = OutputDevice::GetNonMnemonicString( m_pTabControl->GetPageText( m_nPageId ) ); 157 158 return sText; 159} 160 161// ----------------------------------------------------------------------------- 162 163void VCLXAccessibleTabPage::Update( bool bNew ) 164{ |
165 if ( m_pTabControl ) 166 { 167 TabPage* pTabPage = m_pTabControl->GetTabPage( m_nPageId ); 168 if ( pTabPage ) 169 { 170 Reference< XAccessible > xChild( pTabPage->GetAccessible( bNew ) ); 171 if ( xChild.is() ) 172 { 173 Any aOldValue, aNewValue; 174 if ( bNew ) 175 aNewValue <<= xChild; 176 else 177 aOldValue <<= xChild; 178 NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldValue, aNewValue ); 179 } 180 } 181 } | 165 if ( m_pTabControl ) 166 { 167 TabPage* pTabPage = m_pTabControl->GetTabPage( m_nPageId ); 168 if ( pTabPage ) 169 { 170 Reference< XAccessible > xChild( pTabPage->GetAccessible( bNew ) ); 171 if ( xChild.is() ) 172 { 173 Any aOldValue, aNewValue; 174 if ( bNew ) 175 aNewValue <<= xChild; 176 else 177 aOldValue <<= xChild; 178 NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldValue, aNewValue ); 179 } 180 } 181 } |
182} 183 184// ----------------------------------------------------------------------------- 185 186void VCLXAccessibleTabPage::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) 187{ 188 rStateSet.AddState( AccessibleStateType::ENABLED ); | 182} 183 184// ----------------------------------------------------------------------------- 185 186void VCLXAccessibleTabPage::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) 187{ 188 rStateSet.AddState( AccessibleStateType::ENABLED ); |
189 rStateSet.AddState( AccessibleStateType::SENSITIVE ); | 189 rStateSet.AddState( AccessibleStateType::SENSITIVE ); |
190 191 rStateSet.AddState( AccessibleStateType::FOCUSABLE ); 192 193 if ( IsFocused() ) 194 rStateSet.AddState( AccessibleStateType::FOCUSED ); 195 196 rStateSet.AddState( AccessibleStateType::VISIBLE ); 197 198 rStateSet.AddState( AccessibleStateType::SHOWING ); 199 | 190 191 rStateSet.AddState( AccessibleStateType::FOCUSABLE ); 192 193 if ( IsFocused() ) 194 rStateSet.AddState( AccessibleStateType::FOCUSED ); 195 196 rStateSet.AddState( AccessibleStateType::VISIBLE ); 197 198 rStateSet.AddState( AccessibleStateType::SHOWING ); 199 |
200 rStateSet.AddState( AccessibleStateType::SELECTABLE ); | 200 rStateSet.AddState( AccessibleStateType::SELECTABLE ); |
201 202 if ( IsSelected() ) | 201 202 if ( IsSelected() ) |
203 rStateSet.AddState( AccessibleStateType::SELECTED ); | 203 rStateSet.AddState( AccessibleStateType::SELECTED ); |
204} 205 206// ----------------------------------------------------------------------------- | 204} 205 206// ----------------------------------------------------------------------------- |
207// OCommonAccessibleComponent | 207// OCommonAccessibleComponent |
208// ----------------------------------------------------------------------------- 209 210awt::Rectangle VCLXAccessibleTabPage::implGetBounds() throw (RuntimeException) 211{ | 208// ----------------------------------------------------------------------------- 209 210awt::Rectangle VCLXAccessibleTabPage::implGetBounds() throw (RuntimeException) 211{ |
212 awt::Rectangle aBounds( 0, 0, 0, 0 ); | 212 awt::Rectangle aBounds( 0, 0, 0, 0 ); |
213 214 if ( m_pTabControl ) | 213 214 if ( m_pTabControl ) |
215 aBounds = AWTRectangle( m_pTabControl->GetTabBounds( m_nPageId ) ); | 215 aBounds = AWTRectangle( m_pTabControl->GetTabBounds( m_nPageId ) ); |
216 217 return aBounds; 218} 219 220// ----------------------------------------------------------------------------- 221// OCommonAccessibleText 222// ----------------------------------------------------------------------------- 223 224::rtl::OUString VCLXAccessibleTabPage::implGetText() 225{ | 216 217 return aBounds; 218} 219 220// ----------------------------------------------------------------------------- 221// OCommonAccessibleText 222// ----------------------------------------------------------------------------- 223 224::rtl::OUString VCLXAccessibleTabPage::implGetText() 225{ |
226 return GetPageText(); | 226 return GetPageText(); |
227} 228 229// ----------------------------------------------------------------------------- 230 231lang::Locale VCLXAccessibleTabPage::implGetLocale() 232{ 233 return Application::GetSettings().GetLocale(); 234} --- 22 unchanged lines hidden (view full) --- 257// XComponent 258// ----------------------------------------------------------------------------- 259 260void VCLXAccessibleTabPage::disposing() 261{ 262 AccessibleTextHelper_BASE::disposing(); 263 264 m_pTabControl = NULL; | 227} 228 229// ----------------------------------------------------------------------------- 230 231lang::Locale VCLXAccessibleTabPage::implGetLocale() 232{ 233 return Application::GetSettings().GetLocale(); 234} --- 22 unchanged lines hidden (view full) --- 257// XComponent 258// ----------------------------------------------------------------------------- 259 260void VCLXAccessibleTabPage::disposing() 261{ 262 AccessibleTextHelper_BASE::disposing(); 263 264 m_pTabControl = NULL; |
265 m_sPageText = ::rtl::OUString(); | 265 m_sPageText = ::rtl::OUString(); |
266} 267 268// ----------------------------------------------------------------------------- 269// XServiceInfo 270// ----------------------------------------------------------------------------- 271 272::rtl::OUString VCLXAccessibleTabPage::getImplementationName() throw (RuntimeException) 273{ --- 41 unchanged lines hidden (view full) --- 315{ 316 OExternalLockGuard aGuard( this ); 317 318 sal_Int32 nCount = 0; 319 if ( m_pTabControl ) 320 { 321 TabPage* pTabPage = m_pTabControl->GetTabPage( m_nPageId ); 322 if ( pTabPage && pTabPage->IsVisible() ) | 266} 267 268// ----------------------------------------------------------------------------- 269// XServiceInfo 270// ----------------------------------------------------------------------------- 271 272::rtl::OUString VCLXAccessibleTabPage::getImplementationName() throw (RuntimeException) 273{ --- 41 unchanged lines hidden (view full) --- 315{ 316 OExternalLockGuard aGuard( this ); 317 318 sal_Int32 nCount = 0; 319 if ( m_pTabControl ) 320 { 321 TabPage* pTabPage = m_pTabControl->GetTabPage( m_nPageId ); 322 if ( pTabPage && pTabPage->IsVisible() ) |
323 nCount = 1; | 323 nCount = 1; |
324 } 325 326 return nCount; 327} 328 329// ----------------------------------------------------------------------------- 330 331Reference< XAccessible > VCLXAccessibleTabPage::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException, RuntimeException) 332{ 333 OExternalLockGuard aGuard( this ); 334 335 if ( i < 0 || i >= getAccessibleChildCount() ) 336 throw IndexOutOfBoundsException(); 337 338 Reference< XAccessible > xChild; 339 if ( m_pTabControl ) 340 { 341 TabPage* pTabPage = m_pTabControl->GetTabPage( m_nPageId ); 342 if ( pTabPage && pTabPage->IsVisible() ) | 324 } 325 326 return nCount; 327} 328 329// ----------------------------------------------------------------------------- 330 331Reference< XAccessible > VCLXAccessibleTabPage::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException, RuntimeException) 332{ 333 OExternalLockGuard aGuard( this ); 334 335 if ( i < 0 || i >= getAccessibleChildCount() ) 336 throw IndexOutOfBoundsException(); 337 338 Reference< XAccessible > xChild; 339 if ( m_pTabControl ) 340 { 341 TabPage* pTabPage = m_pTabControl->GetTabPage( m_nPageId ); 342 if ( pTabPage && pTabPage->IsVisible() ) |
343 xChild = pTabPage->GetAccessible(); | 343 xChild = pTabPage->GetAccessible(); |
344 } 345 346 return xChild; 347} 348 349// ----------------------------------------------------------------------------- 350 351Reference< XAccessible > VCLXAccessibleTabPage::getAccessibleParent( ) throw (RuntimeException) --- 28 unchanged lines hidden (view full) --- 380 381 return AccessibleRole::PAGE_TAB; 382} 383 384// ----------------------------------------------------------------------------- 385 386::rtl::OUString VCLXAccessibleTabPage::getAccessibleDescription( ) throw (RuntimeException) 387{ | 344 } 345 346 return xChild; 347} 348 349// ----------------------------------------------------------------------------- 350 351Reference< XAccessible > VCLXAccessibleTabPage::getAccessibleParent( ) throw (RuntimeException) --- 28 unchanged lines hidden (view full) --- 380 381 return AccessibleRole::PAGE_TAB; 382} 383 384// ----------------------------------------------------------------------------- 385 386::rtl::OUString VCLXAccessibleTabPage::getAccessibleDescription( ) throw (RuntimeException) 387{ |
388 OExternalLockGuard aGuard( this ); | 388 OExternalLockGuard aGuard( this ); |
389 | 389 |
390 ::rtl::OUString sDescription; 391 if ( m_pTabControl ) 392 sDescription = m_pTabControl->GetHelpText( m_nPageId ); | 390 ::rtl::OUString sDescription; 391 if ( m_pTabControl ) 392 sDescription = m_pTabControl->GetHelpText( m_nPageId ); |
393 | 393 |
394 return sDescription; | 394 return sDescription; |
395} 396 397// ----------------------------------------------------------------------------- 398 399::rtl::OUString VCLXAccessibleTabPage::getAccessibleName( ) throw (RuntimeException) 400{ 401 OExternalLockGuard aGuard( this ); 402 | 395} 396 397// ----------------------------------------------------------------------------- 398 399::rtl::OUString VCLXAccessibleTabPage::getAccessibleName( ) throw (RuntimeException) 400{ 401 OExternalLockGuard aGuard( this ); 402 |
403 return GetPageText(); | 403 return GetPageText(); |
404} 405 406// ----------------------------------------------------------------------------- 407 408Reference< XAccessibleRelationSet > VCLXAccessibleTabPage::getAccessibleRelationSet( ) throw (RuntimeException) 409{ 410 OExternalLockGuard aGuard( this ); 411 | 404} 405 406// ----------------------------------------------------------------------------- 407 408Reference< XAccessibleRelationSet > VCLXAccessibleTabPage::getAccessibleRelationSet( ) throw (RuntimeException) 409{ 410 OExternalLockGuard aGuard( this ); 411 |
412 utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper; | 412 utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper; |
413 Reference< XAccessibleRelationSet > xSet = pRelationSetHelper; | 413 Reference< XAccessibleRelationSet > xSet = pRelationSetHelper; |
414 return xSet; | 414 return xSet; |
415} 416 417// ----------------------------------------------------------------------------- 418 419Reference< XAccessibleStateSet > VCLXAccessibleTabPage::getAccessibleStateSet( ) throw (RuntimeException) 420{ 421 OExternalLockGuard aGuard( this ); 422 423 utl::AccessibleStateSetHelper* pStateSetHelper = new utl::AccessibleStateSetHelper; 424 Reference< XAccessibleStateSet > xSet = pStateSetHelper; 425 426 if ( !rBHelper.bDisposed && !rBHelper.bInDispose ) 427 { 428 FillAccessibleStateSet( *pStateSetHelper ); 429 } 430 else 431 { | 415} 416 417// ----------------------------------------------------------------------------- 418 419Reference< XAccessibleStateSet > VCLXAccessibleTabPage::getAccessibleStateSet( ) throw (RuntimeException) 420{ 421 OExternalLockGuard aGuard( this ); 422 423 utl::AccessibleStateSetHelper* pStateSetHelper = new utl::AccessibleStateSetHelper; 424 Reference< XAccessibleStateSet > xSet = pStateSetHelper; 425 426 if ( !rBHelper.bDisposed && !rBHelper.bInDispose ) 427 { 428 FillAccessibleStateSet( *pStateSetHelper ); 429 } 430 else 431 { |
432 pStateSetHelper->AddState( AccessibleStateType::DEFUNC ); | 432 pStateSetHelper->AddState( AccessibleStateType::DEFUNC ); |
433 } 434 435 return xSet; 436} 437 438// ----------------------------------------------------------------------------- 439 440Locale VCLXAccessibleTabPage::getLocale( ) throw (IllegalAccessibleComponentStateException, RuntimeException) --- 11 unchanged lines hidden (view full) --- 452{ 453 OExternalLockGuard aGuard( this ); 454 455 Reference< XAccessible > xChild; 456 for ( sal_uInt32 i = 0, nCount = getAccessibleChildCount(); i < nCount; ++i ) 457 { 458 Reference< XAccessible > xAcc = getAccessibleChild( i ); 459 if ( xAcc.is() ) | 433 } 434 435 return xSet; 436} 437 438// ----------------------------------------------------------------------------- 439 440Locale VCLXAccessibleTabPage::getLocale( ) throw (IllegalAccessibleComponentStateException, RuntimeException) --- 11 unchanged lines hidden (view full) --- 452{ 453 OExternalLockGuard aGuard( this ); 454 455 Reference< XAccessible > xChild; 456 for ( sal_uInt32 i = 0, nCount = getAccessibleChildCount(); i < nCount; ++i ) 457 { 458 Reference< XAccessible > xAcc = getAccessibleChild( i ); 459 if ( xAcc.is() ) |
460 { 461 Reference< XAccessibleComponent > xComp( xAcc->getAccessibleContext(), UNO_QUERY ); | 460 { 461 Reference< XAccessibleComponent > xComp( xAcc->getAccessibleContext(), UNO_QUERY ); |
462 if ( xComp.is() ) 463 { 464 Rectangle aRect = VCLRectangle( xComp->getBounds() ); 465 Point aPos = VCLPoint( rPoint ); 466 if ( aRect.IsInside( aPos ) ) 467 { 468 xChild = xAcc; 469 break; --- 7 unchanged lines hidden (view full) --- 477 478// ----------------------------------------------------------------------------- 479 480void VCLXAccessibleTabPage::grabFocus( ) throw (RuntimeException) 481{ 482 OExternalLockGuard aGuard( this ); 483 484 if ( m_pTabControl ) | 462 if ( xComp.is() ) 463 { 464 Rectangle aRect = VCLRectangle( xComp->getBounds() ); 465 Point aPos = VCLPoint( rPoint ); 466 if ( aRect.IsInside( aPos ) ) 467 { 468 xChild = xAcc; 469 break; --- 7 unchanged lines hidden (view full) --- 477 478// ----------------------------------------------------------------------------- 479 480void VCLXAccessibleTabPage::grabFocus( ) throw (RuntimeException) 481{ 482 OExternalLockGuard aGuard( this ); 483 484 if ( m_pTabControl ) |
485 { | 485 { |
486 m_pTabControl->SelectTabPage( m_nPageId ); | 486 m_pTabControl->SelectTabPage( m_nPageId ); |
487 m_pTabControl->GrabFocus(); 488 } | 487 m_pTabControl->GrabFocus(); 488 } |
489} 490 491// ----------------------------------------------------------------------------- 492 493sal_Int32 VCLXAccessibleTabPage::getForeground( ) throw (RuntimeException) 494{ 495 OExternalLockGuard aGuard( this ); 496 497 sal_Int32 nColor = 0; 498 Reference< XAccessible > xParent = getAccessibleParent(); 499 if ( xParent.is() ) 500 { 501 Reference< XAccessibleComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); 502 if ( xParentComp.is() ) | 489} 490 491// ----------------------------------------------------------------------------- 492 493sal_Int32 VCLXAccessibleTabPage::getForeground( ) throw (RuntimeException) 494{ 495 OExternalLockGuard aGuard( this ); 496 497 sal_Int32 nColor = 0; 498 Reference< XAccessible > xParent = getAccessibleParent(); 499 if ( xParent.is() ) 500 { 501 Reference< XAccessibleComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); 502 if ( xParentComp.is() ) |
503 nColor = xParentComp->getForeground(); | 503 nColor = xParentComp->getForeground(); |
504 } 505 506 return nColor; 507} 508 509// ----------------------------------------------------------------------------- 510 511sal_Int32 VCLXAccessibleTabPage::getBackground( ) throw (RuntimeException) 512{ 513 OExternalLockGuard aGuard( this ); 514 515 sal_Int32 nColor = 0; 516 Reference< XAccessible > xParent = getAccessibleParent(); 517 if ( xParent.is() ) 518 { 519 Reference< XAccessibleComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); 520 if ( xParentComp.is() ) | 504 } 505 506 return nColor; 507} 508 509// ----------------------------------------------------------------------------- 510 511sal_Int32 VCLXAccessibleTabPage::getBackground( ) throw (RuntimeException) 512{ 513 OExternalLockGuard aGuard( this ); 514 515 sal_Int32 nColor = 0; 516 Reference< XAccessible > xParent = getAccessibleParent(); 517 if ( xParent.is() ) 518 { 519 Reference< XAccessibleComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); 520 if ( xParentComp.is() ) |
521 nColor = xParentComp->getBackground(); | 521 nColor = xParentComp->getBackground(); |
522 } 523 524 return nColor; 525} 526 527// ----------------------------------------------------------------------------- 528// XAccessibleExtendedComponent 529// ----------------------------------------------------------------------------- 530 531Reference< awt::XFont > VCLXAccessibleTabPage::getFont( ) throw (RuntimeException) 532{ 533 OExternalLockGuard aGuard( this ); 534 535 Reference< awt::XFont > xFont; 536 Reference< XAccessible > xParent = getAccessibleParent(); 537 if ( xParent.is() ) 538 { 539 Reference< XAccessibleExtendedComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); 540 if ( xParentComp.is() ) | 522 } 523 524 return nColor; 525} 526 527// ----------------------------------------------------------------------------- 528// XAccessibleExtendedComponent 529// ----------------------------------------------------------------------------- 530 531Reference< awt::XFont > VCLXAccessibleTabPage::getFont( ) throw (RuntimeException) 532{ 533 OExternalLockGuard aGuard( this ); 534 535 Reference< awt::XFont > xFont; 536 Reference< XAccessible > xParent = getAccessibleParent(); 537 if ( xParent.is() ) 538 { 539 Reference< XAccessibleExtendedComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY ); 540 if ( xParentComp.is() ) |
541 xFont = xParentComp->getFont(); | 541 xFont = xParentComp->getFont(); |
542 } 543 544 return xFont; 545} 546 547// ----------------------------------------------------------------------------- 548 549::rtl::OUString VCLXAccessibleTabPage::getTitledBorderText( ) throw (RuntimeException) --- 24 unchanged lines hidden (view full) --- 574} 575 576// ----------------------------------------------------------------------------- 577 578sal_Bool VCLXAccessibleTabPage::setCaretPosition( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException) 579{ 580 OExternalLockGuard aGuard( this ); 581 | 542 } 543 544 return xFont; 545} 546 547// ----------------------------------------------------------------------------- 548 549::rtl::OUString VCLXAccessibleTabPage::getTitledBorderText( ) throw (RuntimeException) --- 24 unchanged lines hidden (view full) --- 574} 575 576// ----------------------------------------------------------------------------- 577 578sal_Bool VCLXAccessibleTabPage::setCaretPosition( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException) 579{ 580 OExternalLockGuard aGuard( this ); 581 |
582 if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) ) 583 throw IndexOutOfBoundsException(); | 582 if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) ) 583 throw IndexOutOfBoundsException(); |
584 585 return sal_False; 586} 587 588// ----------------------------------------------------------------------------- 589 590Sequence< PropertyValue > VCLXAccessibleTabPage::getCharacterAttributes( sal_Int32 nIndex, const Sequence< ::rtl::OUString >& aRequestedAttributes ) throw (IndexOutOfBoundsException, RuntimeException) 591{ 592 OExternalLockGuard aGuard( this ); 593 594 Sequence< PropertyValue > aValues; 595 ::rtl::OUString sText( implGetText() ); 596 | 584 585 return sal_False; 586} 587 588// ----------------------------------------------------------------------------- 589 590Sequence< PropertyValue > VCLXAccessibleTabPage::getCharacterAttributes( sal_Int32 nIndex, const Sequence< ::rtl::OUString >& aRequestedAttributes ) throw (IndexOutOfBoundsException, RuntimeException) 591{ 592 OExternalLockGuard aGuard( this ); 593 594 Sequence< PropertyValue > aValues; 595 ::rtl::OUString sText( implGetText() ); 596 |
597 if ( !implIsValidIndex( nIndex, sText.getLength() ) ) 598 throw IndexOutOfBoundsException(); | 597 if ( !implIsValidIndex( nIndex, sText.getLength() ) ) 598 throw IndexOutOfBoundsException(); |
599 600 if ( m_pTabControl ) 601 { 602 Font aFont = m_pTabControl->GetFont(); 603 sal_Int32 nBackColor = getBackground(); 604 sal_Int32 nColor = getForeground(); | 599 600 if ( m_pTabControl ) 601 { 602 Font aFont = m_pTabControl->GetFont(); 603 sal_Int32 nBackColor = getBackground(); 604 sal_Int32 nColor = getForeground(); |
605 ::std::auto_ptr< CharacterAttributesHelper > pHelper( new CharacterAttributesHelper( aFont, nBackColor, nColor ) ); | 605 ::std::auto_ptr< CharacterAttributesHelper > pHelper( new CharacterAttributesHelper( aFont, nBackColor, nColor ) ); |
606 aValues = pHelper->GetCharacterAttributes( aRequestedAttributes ); 607 } 608 | 606 aValues = pHelper->GetCharacterAttributes( aRequestedAttributes ); 607 } 608 |
609 return aValues; | 609 return aValues; |
610} 611 612// ----------------------------------------------------------------------------- 613 614awt::Rectangle VCLXAccessibleTabPage::getCharacterBounds( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException) 615{ 616 OExternalLockGuard aGuard( this ); 617 | 610} 611 612// ----------------------------------------------------------------------------- 613 614awt::Rectangle VCLXAccessibleTabPage::getCharacterBounds( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException) 615{ 616 OExternalLockGuard aGuard( this ); 617 |
618 if ( !implIsValidIndex( nIndex, implGetText().getLength() ) ) 619 throw IndexOutOfBoundsException(); | 618 if ( !implIsValidIndex( nIndex, implGetText().getLength() ) ) 619 throw IndexOutOfBoundsException(); |
620 621 awt::Rectangle aBounds( 0, 0, 0, 0 ); 622 if ( m_pTabControl ) 623 { 624 Rectangle aPageRect = m_pTabControl->GetTabBounds( m_nPageId ); 625 Rectangle aCharRect = m_pTabControl->GetCharacterBounds( m_nPageId, nIndex ); 626 aCharRect.Move( -aPageRect.Left(), -aPageRect.Top() ); 627 aBounds = AWTRectangle( aCharRect ); --- 8 unchanged lines hidden (view full) --- 636{ 637 OExternalLockGuard aGuard( this ); 638 639 sal_Int32 nIndex = -1; 640 if ( m_pTabControl ) 641 { 642 sal_uInt16 nPageId = 0; 643 Rectangle aPageRect = m_pTabControl->GetTabBounds( m_nPageId ); | 620 621 awt::Rectangle aBounds( 0, 0, 0, 0 ); 622 if ( m_pTabControl ) 623 { 624 Rectangle aPageRect = m_pTabControl->GetTabBounds( m_nPageId ); 625 Rectangle aCharRect = m_pTabControl->GetCharacterBounds( m_nPageId, nIndex ); 626 aCharRect.Move( -aPageRect.Left(), -aPageRect.Top() ); 627 aBounds = AWTRectangle( aCharRect ); --- 8 unchanged lines hidden (view full) --- 636{ 637 OExternalLockGuard aGuard( this ); 638 639 sal_Int32 nIndex = -1; 640 if ( m_pTabControl ) 641 { 642 sal_uInt16 nPageId = 0; 643 Rectangle aPageRect = m_pTabControl->GetTabBounds( m_nPageId ); |
644 Point aPnt( VCLPoint( aPoint ) ); | 644 Point aPnt( VCLPoint( aPoint ) ); |
645 aPnt += aPageRect.TopLeft(); 646 sal_Int32 nI = m_pTabControl->GetIndexForPoint( aPnt, nPageId ); 647 if ( nI != -1 && m_nPageId == nPageId ) 648 nIndex = nI; 649 } 650 | 645 aPnt += aPageRect.TopLeft(); 646 sal_Int32 nI = m_pTabControl->GetIndexForPoint( aPnt, nPageId ); 647 if ( nI != -1 && m_nPageId == nPageId ) 648 nIndex = nI; 649 } 650 |
651 return nIndex; | 651 return nIndex; |
652} 653 654// ----------------------------------------------------------------------------- 655 656sal_Bool VCLXAccessibleTabPage::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (IndexOutOfBoundsException, RuntimeException) 657{ 658 OExternalLockGuard aGuard( this ); 659 | 652} 653 654// ----------------------------------------------------------------------------- 655 656sal_Bool VCLXAccessibleTabPage::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (IndexOutOfBoundsException, RuntimeException) 657{ 658 OExternalLockGuard aGuard( this ); 659 |
660 if ( !implIsValidRange( nStartIndex, nEndIndex, implGetText().getLength() ) ) 661 throw IndexOutOfBoundsException(); | 660 if ( !implIsValidRange( nStartIndex, nEndIndex, implGetText().getLength() ) ) 661 throw IndexOutOfBoundsException(); |
662 663 return sal_False; 664} 665 666// ----------------------------------------------------------------------------- 667 668sal_Bool VCLXAccessibleTabPage::copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (IndexOutOfBoundsException, RuntimeException) 669{ --- 10 unchanged lines hidden (view full) --- 680 681 ::vcl::unohelper::TextDataObject* pDataObj = new ::vcl::unohelper::TextDataObject( sText ); 682 const sal_uInt32 nRef = Application::ReleaseSolarMutex(); 683 xClipboard->setContents( pDataObj, NULL ); 684 685 Reference< datatransfer::clipboard::XFlushableClipboard > xFlushableClipboard( xClipboard, uno::UNO_QUERY ); 686 if( xFlushableClipboard.is() ) 687 xFlushableClipboard->flushClipboard(); | 662 663 return sal_False; 664} 665 666// ----------------------------------------------------------------------------- 667 668sal_Bool VCLXAccessibleTabPage::copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (IndexOutOfBoundsException, RuntimeException) 669{ --- 10 unchanged lines hidden (view full) --- 680 681 ::vcl::unohelper::TextDataObject* pDataObj = new ::vcl::unohelper::TextDataObject( sText ); 682 const sal_uInt32 nRef = Application::ReleaseSolarMutex(); 683 xClipboard->setContents( pDataObj, NULL ); 684 685 Reference< datatransfer::clipboard::XFlushableClipboard > xFlushableClipboard( xClipboard, uno::UNO_QUERY ); 686 if( xFlushableClipboard.is() ) 687 xFlushableClipboard->flushClipboard(); |
688 | 688 |
689 Application::AcquireSolarMutex( nRef ); 690 691 bReturn = sal_True; 692 } 693 } 694 | 689 Application::AcquireSolarMutex( nRef ); 690 691 bReturn = sal_True; 692 } 693 } 694 |
695 return bReturn; | 695 return bReturn; |
696} 697 698// ----------------------------------------------------------------------------- | 696} 697 698// ----------------------------------------------------------------------------- |