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