1 /************************************************************** 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 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 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. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_svtools.hxx" 26 27 #include <svtools/ivctrl.hxx> 28 #include "imivctl.hxx" 29 #include <vcl/bitmapex.hxx> 30 #include <vcl/controllayout.hxx> 31 #include <vcl/mnemonic.hxx> 32 using namespace ::com::sun::star::accessibility; 33 34 /***************************************************************************** 35 | 36 | class : SvxIconChoiceCtrlEntry 37 | 38 \*****************************************************************************/ 39 40 SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, sal_uInt16 _nFlags ) 41 { 42 aText = rText; 43 aImage = rImage; 44 aImageHC = rImage; 45 pUserData = NULL; 46 47 nFlags = _nFlags; 48 eTextMode = IcnShowTextShort; 49 pblink = 0; 50 pflink = 0; 51 } 52 53 SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( const String& rText, const Image& rImage, const Image& rImageHC, sal_uInt16 _nFlags ) 54 { 55 aText = rText; 56 aImage = rImage; 57 aImageHC = rImageHC; 58 pUserData = NULL; 59 60 nFlags = _nFlags; 61 eTextMode = IcnShowTextShort; 62 pblink = 0; 63 pflink = 0; 64 } 65 66 SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( sal_uInt16 _nFlags ) 67 { 68 pUserData = NULL; 69 70 nFlags = _nFlags; 71 eTextMode = IcnShowTextShort; 72 pblink = 0; 73 pflink = 0; 74 } 75 76 void SvxIconChoiceCtrlEntry::SetMoved( sal_Bool bMoved ) 77 { 78 if( bMoved ) 79 nFlags |= ICNVIEW_FLAG_POS_MOVED; 80 else 81 nFlags &= ~ICNVIEW_FLAG_POS_MOVED; 82 } 83 84 void SvxIconChoiceCtrlEntry::LockPos( sal_Bool bLock ) 85 { 86 if( bLock ) 87 nFlags |= ICNVIEW_FLAG_POS_LOCKED; 88 else 89 nFlags &= ~ICNVIEW_FLAG_POS_LOCKED; 90 } 91 92 /*sal_Unicode SvxIconChoiceCtrlEntry::GetMnemonicChar() const 93 { 94 sal_Unicode cChar = 0; 95 xub_StrLen nPos = aText.Search( '~' ); 96 if ( nPos != STRING_NOTFOUND && nPos < ( aText.Len() ) - 1 ) 97 cChar = aText.GetChar( nPos + 1 ); 98 return cChar; 99 }*/ 100 101 String SvxIconChoiceCtrlEntry::GetDisplayText() const 102 { 103 return MnemonicGenerator::EraseAllMnemonicChars( aText ); 104 } 105 106 // ---------------------------------------------------------------------------- 107 108 SvxIconChoiceCtrlColumnInfo::SvxIconChoiceCtrlColumnInfo( const SvxIconChoiceCtrlColumnInfo& rInfo ) 109 : aColText( rInfo.aColText ), aColImage( rInfo.aColImage ) 110 { 111 nWidth = rInfo.nWidth; 112 eAlignment = rInfo.eAlignment; 113 nSubItem = rInfo.nSubItem; 114 } 115 116 /***************************************************************************** 117 | 118 | class : SvtIconChoiceCtrl 119 | 120 \*****************************************************************************/ 121 122 SvtIconChoiceCtrl::SvtIconChoiceCtrl( Window* pParent, WinBits nWinStyle ) : 123 124 // WB_CLIPCHILDREN an, da ScrollBars auf dem Fenster liegen! 125 Control( pParent, nWinStyle | WB_CLIPCHILDREN ), 126 127 _pCurKeyEvent ( NULL ), 128 _pImp ( new SvxIconChoiceCtrl_Impl( this, nWinStyle ) ), 129 _bAutoFontColor ( sal_False ) 130 131 { 132 SetLineColor(); 133 _pImp->SetGrid( Size( 100, 70 ) ); 134 _pImp->InitSettings(); 135 _pImp->SetPositionMode( IcnViewPositionModeAutoArrange ); 136 //IAccessibility2 Implementation 2009----- 137 bCanBeFocused = sal_True; 138 //-----IAccessibility2 Implementation 2009 139 } 140 141 SvtIconChoiceCtrl::SvtIconChoiceCtrl( Window* pParent, const ResId& rResId ) : 142 143 Control( pParent, rResId ), 144 145 _pCurKeyEvent ( NULL ), 146 _pImp ( new SvxIconChoiceCtrl_Impl( this, WB_BORDER ) ), 147 _bAutoFontColor ( sal_False ) 148 149 { 150 SetLineColor(); 151 _pImp->SetGrid( Size( 100, 70 ) ); 152 _pImp->InitSettings(); 153 _pImp->SetPositionMode( IcnViewPositionModeAutoArrange ); 154 //IAccessibility2 Implementation 2009----- 155 bCanBeFocused = sal_True; 156 //-----IAccessibility2 Implementation 2009 157 } 158 159 SvtIconChoiceCtrl::~SvtIconChoiceCtrl() 160 { 161 _pImp->CallEventListeners( VCLEVENT_OBJECT_DYING ); 162 delete _pImp; 163 } 164 165 SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( sal_uLong nPos, const Point* pPos, sal_uInt16 nFlags ) 166 { 167 SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( nFlags ); 168 _pImp->InsertEntry( pEntry, nPos, pPos ); 169 return pEntry; 170 } 171 172 SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, sal_uLong nPos, const Point* pPos, sal_uInt16 nFlags ) 173 { 174 SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( rText, rImage, nFlags); 175 176 _pImp->InsertEntry( pEntry, nPos, pPos ); 177 178 return pEntry; 179 } 180 181 SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const String& rText, const Image& rImage, const Image& rImageHC, sal_uLong nPos, const Point* pPos, sal_uInt16 nFlags ) 182 { 183 SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( rText, rImage, rImageHC, nFlags); 184 185 _pImp->InsertEntry( pEntry, nPos, pPos ); 186 187 return pEntry; 188 } 189 190 sal_Bool SvtIconChoiceCtrl::EditedEntry( SvxIconChoiceCtrlEntry*, const XubString&, sal_Bool ) 191 { 192 return sal_True; 193 } 194 sal_Bool SvtIconChoiceCtrl::EditingEntry( SvxIconChoiceCtrlEntry* ) 195 { 196 return sal_True; 197 } 198 void SvtIconChoiceCtrl::DrawEntryImage( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos, OutputDevice& rDev ) 199 { 200 rDev.DrawImage( rPos, GetSettings().GetStyleSettings().GetHighContrastMode() ? pEntry->GetImageHC() : pEntry->GetImage() ); 201 } 202 String SvtIconChoiceCtrl::GetEntryText( SvxIconChoiceCtrlEntry* pEntry, sal_Bool ) 203 { 204 return pEntry->GetText(); 205 } 206 sal_Bool SvtIconChoiceCtrl::HasBackground() const 207 { 208 return sal_False; 209 } 210 sal_Bool SvtIconChoiceCtrl::HasFont() const 211 { 212 return sal_False; 213 } 214 sal_Bool SvtIconChoiceCtrl::HasFontTextColor() const 215 { 216 return sal_True; 217 } 218 sal_Bool SvtIconChoiceCtrl::HasFontFillColor() const 219 { 220 return sal_True; 221 } 222 223 void SvtIconChoiceCtrl::Paint( const Rectangle& rRect ) 224 { 225 _pImp->Paint( rRect ); 226 } 227 228 void SvtIconChoiceCtrl::MouseButtonDown( const MouseEvent& rMEvt ) 229 { 230 if( !_pImp->MouseButtonDown( rMEvt ) ) 231 Control::MouseButtonDown( rMEvt ); 232 } 233 234 void SvtIconChoiceCtrl::MouseButtonUp( const MouseEvent& rMEvt ) 235 { 236 if( !_pImp->MouseButtonUp( rMEvt ) ) 237 Control::MouseButtonUp( rMEvt ); 238 } 239 240 void SvtIconChoiceCtrl::MouseMove( const MouseEvent& rMEvt ) 241 { 242 if( !_pImp->MouseMove( rMEvt ) ) 243 Control::MouseMove( rMEvt ); 244 } 245 void SvtIconChoiceCtrl::ArrangeIcons() 246 { 247 if ( GetStyle() & WB_ALIGN_TOP ) 248 { 249 Size aFullSize; 250 Rectangle aEntryRect; 251 252 for ( sal_uLong i = 0; i < GetEntryCount(); i++ ) 253 { 254 SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i ); 255 aEntryRect = _pImp->GetEntryBoundRect ( pEntry ); 256 257 aFullSize.setWidth ( aFullSize.getWidth()+aEntryRect.GetWidth() ); 258 } 259 260 _pImp->Arrange ( sal_False, aFullSize.getWidth() ); 261 } 262 else if ( GetStyle() & WB_ALIGN_LEFT ) 263 { 264 Size aFullSize; 265 Rectangle aEntryRect; 266 267 for ( sal_uLong i = 0; i < GetEntryCount(); i++ ) 268 { 269 SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i ); 270 aEntryRect = _pImp->GetEntryBoundRect ( pEntry ); 271 272 aFullSize.setHeight ( aFullSize.getHeight()+aEntryRect.GetHeight() ); 273 } 274 275 _pImp->Arrange ( sal_False, 0, aFullSize.getHeight() ); 276 } 277 else 278 { 279 _pImp->Arrange(); 280 } 281 _pImp->Arrange( sal_False, 0, 1000 ); 282 } 283 void SvtIconChoiceCtrl::Resize() 284 { 285 _pImp->Resize(); 286 Control::Resize(); 287 } 288 289 Point SvtIconChoiceCtrl::GetLogicPos( const Point& rPosPixel ) const 290 { 291 Point aPos( rPosPixel ); 292 aPos -= GetMapMode().GetOrigin(); 293 return aPos; 294 } 295 296 Point SvtIconChoiceCtrl::GetPixelPos( const Point& rPosLogic ) const 297 { 298 Point aPos( rPosLogic ); 299 aPos += GetMapMode().GetOrigin(); 300 return aPos; 301 } 302 303 void SvtIconChoiceCtrl::DocumentRectChanged() 304 { 305 _aDocRectChangedHdl.Call( this ); 306 } 307 308 void SvtIconChoiceCtrl::VisibleRectChanged() 309 { 310 _aVisRectChangedHdl.Call( this ); 311 } 312 313 void SvtIconChoiceCtrl::GetFocus() 314 { 315 //IAccessibility2 Implementation 2009----- 316 if( !bCanBeFocused ) 317 { 318 bCanBeFocused = sal_True; 319 return; 320 } 321 //-----IAccessibility2 Implementation 2009 322 _pImp->GetFocus(); 323 Control::GetFocus(); 324 sal_uLong nPos; 325 SvxIconChoiceCtrlEntry* pSelectedEntry = GetSelectedEntry ( nPos ); 326 if ( pSelectedEntry ) 327 _pImp->CallEventListeners( VCLEVENT_LISTBOX_SELECT, pSelectedEntry ); 328 } 329 330 void SvtIconChoiceCtrl::LoseFocus() 331 { 332 _pImp->LoseFocus(); 333 Control::LoseFocus(); 334 } 335 336 void SvtIconChoiceCtrl::SetUpdateMode( sal_Bool bUpdate ) 337 { 338 Control::SetUpdateMode( bUpdate ); 339 _pImp->SetUpdateMode( bUpdate ); 340 } 341 void SvtIconChoiceCtrl::SetFont( const Font& rFont ) 342 { 343 if( rFont != GetFont() ) 344 { 345 Control::SetFont( rFont ); 346 _pImp->FontModified(); 347 } 348 } 349 350 void SvtIconChoiceCtrl::SetPointFont( const Font& rFont ) 351 { 352 if( rFont != GetPointFont() ) 353 { 354 Control::SetPointFont( rFont ); 355 _pImp->FontModified(); 356 } 357 } 358 SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( const Point& rPixPos, sal_Bool bHit ) const 359 { 360 Point aPos( rPixPos ); 361 aPos -= GetMapMode().GetOrigin(); 362 return ((SvtIconChoiceCtrl*)this)->_pImp->GetEntry( aPos, bHit ); 363 } 364 365 void SvtIconChoiceCtrl::SetStyle( WinBits nWinStyle ) 366 { 367 _pImp->SetStyle( nWinStyle ); 368 } 369 370 WinBits SvtIconChoiceCtrl::GetStyle() const 371 { 372 return _pImp->GetStyle(); 373 } 374 void SvtIconChoiceCtrl::Command( const CommandEvent& rCEvt ) 375 { 376 _pImp->Command( rCEvt ); 377 } 378 379 void SvtIconChoiceCtrl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry* pEntry ) 380 { 381 _pImp->SetEntryTextMode( eMode, pEntry ); 382 } 383 384 SvxIconChoiceCtrlTextMode SvtIconChoiceCtrl::GetEntryTextMode( const SvxIconChoiceCtrlEntry* pEntry ) const 385 { 386 return _pImp->GetEntryTextModeSmart( pEntry ); 387 } 388 389 SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetNextEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const 390 { 391 Point aPos( rPixPos ); 392 aPos -= GetMapMode().GetOrigin(); 393 return ((SvtIconChoiceCtrl*)this)->_pImp->GetNextEntry( aPos, pCurEntry ); 394 } 395 396 SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetPrevEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const 397 { 398 Point aPos( rPixPos ); 399 aPos -= GetMapMode().GetOrigin(); 400 return ((SvtIconChoiceCtrl*)this)->_pImp->GetPrevEntry( aPos, pCurEntry ); 401 } 402 sal_uLong SvtIconChoiceCtrl::GetEntryCount() const 403 { 404 return _pImp->GetEntryCount(); 405 } 406 407 SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( sal_uLong nPos ) const 408 { 409 return _pImp->GetEntry( nPos ); 410 } 411 412 void SvtIconChoiceCtrl::CreateAutoMnemonics( MnemonicGenerator& _rUsedMnemonics ) 413 { 414 _pImp->CreateAutoMnemonics( &_rUsedMnemonics ); 415 } 416 417 void SvtIconChoiceCtrl::CreateAutoMnemonics( void ) 418 { 419 _pImp->CreateAutoMnemonics(); 420 } 421 422 void SvtIconChoiceCtrl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) 423 { 424 _pImp->RemoveEntry( pEntry ); 425 } 426 427 SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetSelectedEntry( sal_uLong& rPos ) const 428 { 429 return _pImp->GetFirstSelectedEntry( rPos ); 430 } 431 432 void SvtIconChoiceCtrl::ClickIcon() 433 { 434 sal_uLong nPos; 435 GetSelectedEntry ( nPos ); 436 _aClickIconHdl.Call( this ); 437 } 438 sal_Bool SvtIconChoiceCtrl::IsEntryEditing() const 439 { 440 return _pImp->IsEntryEditing(); 441 } 442 443 sal_Bool SvtIconChoiceCtrl::SetChoiceWithCursor ( sal_Bool bDo ) 444 { 445 return _pImp->SetChoiceWithCursor (bDo); 446 } 447 448 void SvtIconChoiceCtrl::KeyInput( const KeyEvent& rKEvt ) 449 { 450 sal_Bool bKeyUsed = DoKeyInput( rKEvt ); 451 if ( !bKeyUsed ) 452 { 453 _pCurKeyEvent = (KeyEvent*)&rKEvt; 454 Control::KeyInput( rKEvt ); 455 _pCurKeyEvent = NULL; 456 } 457 } 458 sal_Bool SvtIconChoiceCtrl::DoKeyInput( const KeyEvent& rKEvt ) 459 { 460 // unter OS/2 bekommen wir auch beim Editieren Key-Up/Down 461 if( IsEntryEditing() ) 462 return sal_True; 463 _pCurKeyEvent = (KeyEvent*)&rKEvt; 464 sal_Bool bHandled = _pImp->KeyInput( rKEvt ); 465 _pCurKeyEvent = NULL; 466 return bHandled; 467 } 468 sal_uLong SvtIconChoiceCtrl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const 469 { 470 return _pImp->GetEntryListPos( pEntry ); 471 } 472 SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetCursor( ) const 473 { 474 return _pImp->GetCurEntry( ); 475 } 476 void SvtIconChoiceCtrl::SetCursor( SvxIconChoiceCtrlEntry* pEntry ) 477 { 478 _pImp->SetCursor( pEntry ); 479 } 480 void SvtIconChoiceCtrl::InvalidateEntry( SvxIconChoiceCtrlEntry* pEntry ) 481 { 482 _pImp->InvalidateEntry( pEntry ); 483 } 484 void SvtIconChoiceCtrl::Clear() 485 { 486 _pImp->Clear(); 487 } 488 void SvtIconChoiceCtrl::StateChanged( StateChangedType nType ) 489 { 490 Control::StateChanged( nType ); 491 } 492 493 494 void SvtIconChoiceCtrl::DataChanged( const DataChangedEvent& rDCEvt ) 495 { 496 if ( ((rDCEvt.GetType() == DATACHANGED_SETTINGS) || 497 (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) || 498 (rDCEvt.GetType() == DATACHANGED_FONTS) ) && 499 (rDCEvt.GetFlags() & SETTINGS_STYLE) ) 500 { 501 _pImp->InitSettings(); 502 Invalidate(INVALIDATE_NOCHILDREN); 503 } 504 else 505 Control::DataChanged( rDCEvt ); 506 } 507 508 void SvtIconChoiceCtrl::SetBackground( const Wallpaper& rPaper ) 509 { 510 if( rPaper != GetBackground() ) 511 { 512 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); 513 Wallpaper aEmpty; 514 if( rPaper == aEmpty ) 515 Control::SetBackground( rStyleSettings.GetFieldColor() ); 516 else 517 { 518 Wallpaper aBackground( rPaper ); 519 // HACK, da Hintergrund sonst transparent sein koennte 520 if( !aBackground.IsBitmap() ) 521 aBackground.SetStyle( WALLPAPER_TILE ); 522 523 WallpaperStyle eStyle = aBackground.GetStyle(); 524 Color aBack( aBackground.GetColor()); 525 Color aTrans( COL_TRANSPARENT ); 526 if( aBack == aTrans && ( 527 (!aBackground.IsBitmap() || 528 aBackground.GetBitmap().IsTransparent() || 529 (eStyle != WALLPAPER_TILE && eStyle != WALLPAPER_SCALE)))) 530 { 531 aBackground.SetColor( rStyleSettings.GetFieldColor() ); 532 } 533 if( aBackground.IsScrollable() ) 534 { 535 Rectangle aRect; 536 aRect.SetSize( Size(32765, 32765) ); 537 aBackground.SetRect( aRect ); 538 } 539 else 540 { 541 Rectangle aRect( _pImp->GetOutputRect() ); 542 aBackground.SetRect( aRect ); 543 } 544 Control::SetBackground( aBackground ); 545 } 546 547 // bei hart attributierter Textfarbe keine 'Automatik', die eine 548 // lesbare Textfarbe einstellt. 549 Font aFont( GetFont() ); 550 aFont.SetColor( rStyleSettings.GetFieldTextColor() ); 551 SetFont( aFont ); 552 553 Invalidate(INVALIDATE_NOCHILDREN); 554 } 555 } 556 557 void SvtIconChoiceCtrl::Flush() 558 { 559 _pImp->Flush(); 560 } 561 562 void SvtIconChoiceCtrl::RequestHelp( const HelpEvent& rHEvt ) 563 { 564 if ( !_pImp->RequestHelp( rHEvt ) ) 565 Control::RequestHelp( rHEvt ); 566 } 567 568 void SvtIconChoiceCtrl::SetSelectionMode( SelectionMode eMode ) 569 { 570 _pImp->SetSelectionMode( eMode ); 571 } 572 573 sal_Bool SvtIconChoiceCtrl::HandleShortCutKey( const KeyEvent& r ) 574 { 575 return _pImp->HandleShortCutKey( r ); 576 } 577 578 Rectangle SvtIconChoiceCtrl::GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const 579 { 580 return _pImp->GetEntryBoundRect( pEntry ); 581 } 582 583 void SvtIconChoiceCtrl::FillLayoutData() const 584 { 585 CreateLayoutData(); 586 587 SvtIconChoiceCtrl* pNonConstMe = const_cast< SvtIconChoiceCtrl* >( this ); 588 589 // loop through all entries 590 sal_uInt16 nCount = (sal_uInt16)GetEntryCount(); 591 sal_uInt16 nPos = 0; 592 while ( nPos < nCount ) 593 { 594 SvxIconChoiceCtrlEntry* pEntry = GetEntry( nPos ); 595 596 Point aPos = _pImp->GetEntryBoundRect( pEntry ).TopLeft(); 597 String sEntryText = pEntry->GetDisplayText( ); 598 Rectangle aTextRect = _pImp->CalcTextRect( pEntry, &aPos, sal_False, &sEntryText ); 599 600 sal_Bool bLargeIconMode = WB_ICON == ( _pImp->GetStyle() & ( VIEWMODE_MASK ) ); 601 sal_uInt16 nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : PAINTFLAG_VER_CENTERED; 602 603 _pImp->PaintItem( aTextRect, IcnViewFieldTypeText, pEntry, nTextPaintFlags, pNonConstMe, &sEntryText, GetLayoutData() ); 604 605 ++nPos; 606 } 607 } 608 609 Rectangle SvtIconChoiceCtrl::GetEntryCharacterBounds( const sal_Int32 _nEntryPos, const sal_Int32 _nCharacterIndex ) const 610 { 611 Rectangle aRect; 612 613 Pair aEntryCharacterRange = GetLineStartEnd( _nEntryPos ); 614 if ( aEntryCharacterRange.A() + _nCharacterIndex < aEntryCharacterRange.B() ) 615 { 616 aRect = GetCharacterBounds( aEntryCharacterRange.A() + _nCharacterIndex ); 617 } 618 619 return aRect; 620 } 621 622 void SvtIconChoiceCtrl::SetNoSelection() 623 { 624 _pImp->SetNoSelection(); 625 } 626 627 void SvtIconChoiceCtrl::CallImplEventListeners(sal_uLong nEvent, void* pData) 628 { 629 CallEventListeners(nEvent, pData); 630 } 631 ::com::sun::star::uno::Reference< XAccessible > SvtIconChoiceCtrl::CreateAccessible() 632 { 633 Window* pParent = GetAccessibleParentWindow(); 634 DBG_ASSERT( pParent, "SvTreeListBox::CreateAccessible - accessible parent not found" ); 635 636 ::com::sun::star::uno::Reference< XAccessible > xAccessible; 637 if ( pParent ) 638 { 639 ::com::sun::star::uno::Reference< XAccessible > xAccParent = pParent->GetAccessible(); 640 if ( xAccParent.is() ) 641 { 642 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xTemp(GetComponentInterface()); 643 xAccessible = _pImp->GetAccessibleFactory().createAccessibleIconChoiceCtrl( *this, xAccParent ); 644 } 645 } 646 return xAccessible; 647 } 648 649