vclxaccessiblelistitem.cxx (4d7c9de0) vclxaccessiblelistitem.cxx (15466770)
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/vclxaccessiblelistitem.hxx>
27#include <toolkit/helper/convert.hxx>

--- 42 unchanged lines hidden (view full) ---

70// -----------------------------------------------------------------------------
71VCLXAccessibleListItem::VCLXAccessibleListItem( ::accessibility::IComboListBoxHelper* _pListBoxHelper, sal_Int32 _nIndexInParent, const Reference< XAccessible >& _xParent ) :
72
73 VCLXAccessibleListItem_BASE ( m_aMutex ),
74
75 m_nIndexInParent( _nIndexInParent ),
76 m_bSelected ( sal_False ),
77 m_bVisible ( sal_False ),
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_accessibility.hxx"
26#include <accessibility/standard/vclxaccessiblelistitem.hxx>
27#include <toolkit/helper/convert.hxx>

--- 42 unchanged lines hidden (view full) ---

70// -----------------------------------------------------------------------------
71VCLXAccessibleListItem::VCLXAccessibleListItem( ::accessibility::IComboListBoxHelper* _pListBoxHelper, sal_Int32 _nIndexInParent, const Reference< XAccessible >& _xParent ) :
72
73 VCLXAccessibleListItem_BASE ( m_aMutex ),
74
75 m_nIndexInParent( _nIndexInParent ),
76 m_bSelected ( sal_False ),
77 m_bVisible ( sal_False ),
78 m_nClientId ( 0 ),
78 m_nClientId ( 0 ),
79 m_pListBoxHelper( _pListBoxHelper ),
80 m_xParent ( _xParent )
81
82{
83 DBG_CTOR( VCLXAccessibleListItem, NULL );
84
85 if ( m_xParent.is() )
86 m_xParentContext = m_xParent->getAccessibleContext();

--- 13 unchanged lines hidden (view full) ---

100 {
101 Any aOldValue;
102 Any aNewValue;
103 if ( m_bSelected )
104 aOldValue <<= AccessibleStateType::SELECTED;
105 else
106 aNewValue <<= AccessibleStateType::SELECTED;
107 m_bSelected = _bSelected;
79 m_pListBoxHelper( _pListBoxHelper ),
80 m_xParent ( _xParent )
81
82{
83 DBG_CTOR( VCLXAccessibleListItem, NULL );
84
85 if ( m_xParent.is() )
86 m_xParentContext = m_xParent->getAccessibleContext();

--- 13 unchanged lines hidden (view full) ---

100 {
101 Any aOldValue;
102 Any aNewValue;
103 if ( m_bSelected )
104 aOldValue <<= AccessibleStateType::SELECTED;
105 else
106 aNewValue <<= AccessibleStateType::SELECTED;
107 m_bSelected = _bSelected;
108 NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
108 NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
109 }
110}
111// -----------------------------------------------------------------------------
112void VCLXAccessibleListItem::SetVisible( sal_Bool _bVisible )
113{
114 if ( m_bVisible != _bVisible )
115 {
116 Any aOldValue, aNewValue;

--- 7 unchanged lines hidden (view full) ---

124// -----------------------------------------------------------------------------
125void VCLXAccessibleListItem::NotifyAccessibleEvent( sal_Int16 _nEventId,
126 const ::com::sun::star::uno::Any& _aOldValue,
127 const ::com::sun::star::uno::Any& _aNewValue )
128{
129 AccessibleEventObject aEvt;
130 aEvt.Source = *this;
131 aEvt.EventId = _nEventId;
109 }
110}
111// -----------------------------------------------------------------------------
112void VCLXAccessibleListItem::SetVisible( sal_Bool _bVisible )
113{
114 if ( m_bVisible != _bVisible )
115 {
116 Any aOldValue, aNewValue;

--- 7 unchanged lines hidden (view full) ---

124// -----------------------------------------------------------------------------
125void VCLXAccessibleListItem::NotifyAccessibleEvent( sal_Int16 _nEventId,
126 const ::com::sun::star::uno::Any& _aOldValue,
127 const ::com::sun::star::uno::Any& _aNewValue )
128{
129 AccessibleEventObject aEvt;
130 aEvt.Source = *this;
131 aEvt.EventId = _nEventId;
132 aEvt.OldValue = _aOldValue;
133 aEvt.NewValue = _aNewValue;
132 aEvt.OldValue = _aOldValue;
133 aEvt.NewValue = _aNewValue;
134
135 if (m_nClientId)
136 comphelper::AccessibleEventNotifier::addEvent( m_nClientId, aEvt );
137}
138// -----------------------------------------------------------------------------
139// OCommonAccessibleText
140// -----------------------------------------------------------------------------
141::rtl::OUString VCLXAccessibleListItem::implGetText()

--- 64 unchanged lines hidden (view full) ---

206
207 VCLXAccessibleListItem_BASE::disposing();
208 m_sEntryText = ::rtl::OUString();
209 m_pListBoxHelper = NULL;
210 m_xParent = NULL;
211 m_xParentContext = NULL;
212
213 nId = m_nClientId;
134
135 if (m_nClientId)
136 comphelper::AccessibleEventNotifier::addEvent( m_nClientId, aEvt );
137}
138// -----------------------------------------------------------------------------
139// OCommonAccessibleText
140// -----------------------------------------------------------------------------
141::rtl::OUString VCLXAccessibleListItem::implGetText()

--- 64 unchanged lines hidden (view full) ---

206
207 VCLXAccessibleListItem_BASE::disposing();
208 m_sEntryText = ::rtl::OUString();
209 m_pListBoxHelper = NULL;
210 m_xParent = NULL;
211 m_xParentContext = NULL;
212
213 nId = m_nClientId;
214 m_nClientId = 0;
214 m_nClientId = 0;
215 if ( nId )
216 xEventSource = *this;
217 }
218
215 if ( nId )
216 xEventSource = *this;
217 }
218
219 // Send a disposing to all listeners.
219 // Send a disposing to all listeners.
220 if ( nId )
220 if ( nId )
221 comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( nId, *this );
221 comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( nId, *this );
222}
223// -----------------------------------------------------------------------------
224// XServiceInfo
225// -----------------------------------------------------------------------------
226::rtl::OUString VCLXAccessibleListItem::getImplementationName() throw (RuntimeException)
227{
228 return ::rtl::OUString::createFromAscii( "com.sun.star.comp.toolkit.AccessibleListItem" );
229}

--- 48 unchanged lines hidden (view full) ---

278{
279 ::osl::MutexGuard aGuard( m_aMutex );
280 return m_nIndexInParent;
281}
282// -----------------------------------------------------------------------------
283sal_Int16 SAL_CALL VCLXAccessibleListItem::getAccessibleRole( ) throw (RuntimeException)
284{
285 return AccessibleRole::LIST_ITEM;
222}
223// -----------------------------------------------------------------------------
224// XServiceInfo
225// -----------------------------------------------------------------------------
226::rtl::OUString VCLXAccessibleListItem::getImplementationName() throw (RuntimeException)
227{
228 return ::rtl::OUString::createFromAscii( "com.sun.star.comp.toolkit.AccessibleListItem" );
229}

--- 48 unchanged lines hidden (view full) ---

278{
279 ::osl::MutexGuard aGuard( m_aMutex );
280 return m_nIndexInParent;
281}
282// -----------------------------------------------------------------------------
283sal_Int16 SAL_CALL VCLXAccessibleListItem::getAccessibleRole( ) throw (RuntimeException)
284{
285 return AccessibleRole::LIST_ITEM;
286 // return AccessibleRole::LABEL;
286 // return AccessibleRole::LABEL;
287}
288// -----------------------------------------------------------------------------
289::rtl::OUString SAL_CALL VCLXAccessibleListItem::getAccessibleDescription( ) throw (RuntimeException)
290{
291 // no description for every item
292 return ::rtl::OUString();
293}
294// -----------------------------------------------------------------------------
295::rtl::OUString SAL_CALL VCLXAccessibleListItem::getAccessibleName( ) throw (RuntimeException)
296{
297 ::osl::MutexGuard aGuard( m_aMutex );
298
299 // entry text == accessible name
300 return implGetText();
301}
302// -----------------------------------------------------------------------------
303Reference< XAccessibleRelationSet > SAL_CALL VCLXAccessibleListItem::getAccessibleRelationSet( ) throw (RuntimeException)
304{
287}
288// -----------------------------------------------------------------------------
289::rtl::OUString SAL_CALL VCLXAccessibleListItem::getAccessibleDescription( ) throw (RuntimeException)
290{
291 // no description for every item
292 return ::rtl::OUString();
293}
294// -----------------------------------------------------------------------------
295::rtl::OUString SAL_CALL VCLXAccessibleListItem::getAccessibleName( ) throw (RuntimeException)
296{
297 ::osl::MutexGuard aGuard( m_aMutex );
298
299 // entry text == accessible name
300 return implGetText();
301}
302// -----------------------------------------------------------------------------
303Reference< XAccessibleRelationSet > SAL_CALL VCLXAccessibleListItem::getAccessibleRelationSet( ) throw (RuntimeException)
304{
305 utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper;
305 utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper;
306 Reference< XAccessibleRelationSet > xSet = pRelationSetHelper;
306 Reference< XAccessibleRelationSet > xSet = pRelationSetHelper;
307 return xSet;
307 return xSet;
308}
309// -----------------------------------------------------------------------------
310Reference< XAccessibleStateSet > SAL_CALL VCLXAccessibleListItem::getAccessibleStateSet( ) throw (RuntimeException)
311{
312 ::osl::MutexGuard aGuard( m_aMutex );
313
308}
309// -----------------------------------------------------------------------------
310Reference< XAccessibleStateSet > SAL_CALL VCLXAccessibleListItem::getAccessibleStateSet( ) throw (RuntimeException)
311{
312 ::osl::MutexGuard aGuard( m_aMutex );
313
314 utl::AccessibleStateSetHelper* pStateSetHelper = new utl::AccessibleStateSetHelper;
314 utl::AccessibleStateSetHelper* pStateSetHelper = new utl::AccessibleStateSetHelper;
315 Reference< XAccessibleStateSet > xStateSet = pStateSetHelper;
316
317 if ( !rBHelper.bDisposed && !rBHelper.bInDispose )
318 {
315 Reference< XAccessibleStateSet > xStateSet = pStateSetHelper;
316
317 if ( !rBHelper.bDisposed && !rBHelper.bInDispose )
318 {
319 pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
319 pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
320
320
321 if(m_pListBoxHelper->IsEnabled())
321 if(m_pListBoxHelper->IsEnabled())
322 {
322 {
323 pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
324 pStateSetHelper->AddState( AccessibleStateType::ENABLED );
325 pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
323 pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
324 pStateSetHelper->AddState( AccessibleStateType::ENABLED );
325 pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
326 }
327
326 }
327
328 if ( m_bSelected )
328 if ( m_bSelected )
329 pStateSetHelper->AddState( AccessibleStateType::SELECTED );
330 if ( m_bVisible )
331 {
332 pStateSetHelper->AddState( AccessibleStateType::VISIBLE );
333 pStateSetHelper->AddState( AccessibleStateType::SHOWING );
334 }
335 }
336 else
329 pStateSetHelper->AddState( AccessibleStateType::SELECTED );
330 if ( m_bVisible )
331 {
332 pStateSetHelper->AddState( AccessibleStateType::VISIBLE );
333 pStateSetHelper->AddState( AccessibleStateType::SHOWING );
334 }
335 }
336 else
337 pStateSetHelper->AddState( AccessibleStateType::DEFUNC );
337 pStateSetHelper->AddState( AccessibleStateType::DEFUNC );
338
338
339 return xStateSet;
339 return xStateSet;
340}
341// -----------------------------------------------------------------------------
342Locale SAL_CALL VCLXAccessibleListItem::getLocale( ) throw (IllegalAccessibleComponentStateException, RuntimeException)
343{
344 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
345 ::osl::MutexGuard aGuard( m_aMutex );
346
340}
341// -----------------------------------------------------------------------------
342Locale SAL_CALL VCLXAccessibleListItem::getLocale( ) throw (IllegalAccessibleComponentStateException, RuntimeException)
343{
344 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
345 ::osl::MutexGuard aGuard( m_aMutex );
346
347 return implGetLocale();
347 return implGetLocale();
348}
349// -----------------------------------------------------------------------------
350// XAccessibleComponent
351// -----------------------------------------------------------------------------
352sal_Bool SAL_CALL VCLXAccessibleListItem::containsPoint( const awt::Point& _aPoint ) throw (RuntimeException)
353{
354 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
355 ::osl::MutexGuard aGuard( m_aMutex );

--- 78 unchanged lines hidden (view full) ---

434 return -1;
435}
436// -----------------------------------------------------------------------------
437sal_Bool SAL_CALL VCLXAccessibleListItem::setCaretPosition( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
438{
439 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
440 ::osl::MutexGuard aGuard( m_aMutex );
441
348}
349// -----------------------------------------------------------------------------
350// XAccessibleComponent
351// -----------------------------------------------------------------------------
352sal_Bool SAL_CALL VCLXAccessibleListItem::containsPoint( const awt::Point& _aPoint ) throw (RuntimeException)
353{
354 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
355 ::osl::MutexGuard aGuard( m_aMutex );

--- 78 unchanged lines hidden (view full) ---

434 return -1;
435}
436// -----------------------------------------------------------------------------
437sal_Bool SAL_CALL VCLXAccessibleListItem::setCaretPosition( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
438{
439 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
440 ::osl::MutexGuard aGuard( m_aMutex );
441
442 if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) )
443 throw IndexOutOfBoundsException();
442 if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) )
443 throw IndexOutOfBoundsException();
444
445 return sal_False;
446}
447// -----------------------------------------------------------------------------
448sal_Unicode SAL_CALL VCLXAccessibleListItem::getCharacter( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
449{
450 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
451 ::osl::MutexGuard aGuard( m_aMutex );
452
453 return OCommonAccessibleText::getCharacter( nIndex );
454}
455// -----------------------------------------------------------------------------
456Sequence< PropertyValue > SAL_CALL VCLXAccessibleListItem::getCharacterAttributes( sal_Int32 nIndex, const Sequence< ::rtl::OUString >& ) throw (IndexOutOfBoundsException, RuntimeException)
457{
458 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
459 ::osl::MutexGuard aGuard( m_aMutex );
460
461 ::rtl::OUString sText( implGetText() );
444
445 return sal_False;
446}
447// -----------------------------------------------------------------------------
448sal_Unicode SAL_CALL VCLXAccessibleListItem::getCharacter( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
449{
450 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
451 ::osl::MutexGuard aGuard( m_aMutex );
452
453 return OCommonAccessibleText::getCharacter( nIndex );
454}
455// -----------------------------------------------------------------------------
456Sequence< PropertyValue > SAL_CALL VCLXAccessibleListItem::getCharacterAttributes( sal_Int32 nIndex, const Sequence< ::rtl::OUString >& ) throw (IndexOutOfBoundsException, RuntimeException)
457{
458 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
459 ::osl::MutexGuard aGuard( m_aMutex );
460
461 ::rtl::OUString sText( implGetText() );
462 if ( !implIsValidIndex( nIndex, sText.getLength() ) )
463 throw IndexOutOfBoundsException();
462 if ( !implIsValidIndex( nIndex, sText.getLength() ) )
463 throw IndexOutOfBoundsException();
464
465 return Sequence< PropertyValue >();
466}
467// -----------------------------------------------------------------------------
468awt::Rectangle SAL_CALL VCLXAccessibleListItem::getCharacterBounds( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
469{
470 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
471 ::osl::MutexGuard aGuard( m_aMutex );
472
473 ::rtl::OUString sText( implGetText() );
464
465 return Sequence< PropertyValue >();
466}
467// -----------------------------------------------------------------------------
468awt::Rectangle SAL_CALL VCLXAccessibleListItem::getCharacterBounds( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
469{
470 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
471 ::osl::MutexGuard aGuard( m_aMutex );
472
473 ::rtl::OUString sText( implGetText() );
474 if ( !implIsValidIndex( nIndex, sText.getLength() ) )
475 throw IndexOutOfBoundsException();
474 if ( !implIsValidIndex( nIndex, sText.getLength() ) )
475 throw IndexOutOfBoundsException();
476
477 awt::Rectangle aBounds( 0, 0, 0, 0 );
478 if ( m_pListBoxHelper )
479 {
480 Rectangle aCharRect = m_pListBoxHelper->GetEntryCharacterBounds( m_nIndexInParent, nIndex );
481 Rectangle aItemRect = m_pListBoxHelper->GetBoundingRectangle( (sal_uInt16)m_nIndexInParent );
482 aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() );
483 aBounds = AWTRectangle( aCharRect );

--- 13 unchanged lines hidden (view full) ---

497sal_Int32 SAL_CALL VCLXAccessibleListItem::getIndexAtPoint( const awt::Point& aPoint ) throw (RuntimeException)
498{
499 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
500 ::osl::MutexGuard aGuard( m_aMutex );
501
502 sal_Int32 nIndex = -1;
503 if ( m_pListBoxHelper )
504 {
476
477 awt::Rectangle aBounds( 0, 0, 0, 0 );
478 if ( m_pListBoxHelper )
479 {
480 Rectangle aCharRect = m_pListBoxHelper->GetEntryCharacterBounds( m_nIndexInParent, nIndex );
481 Rectangle aItemRect = m_pListBoxHelper->GetBoundingRectangle( (sal_uInt16)m_nIndexInParent );
482 aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() );
483 aBounds = AWTRectangle( aCharRect );

--- 13 unchanged lines hidden (view full) ---

497sal_Int32 SAL_CALL VCLXAccessibleListItem::getIndexAtPoint( const awt::Point& aPoint ) throw (RuntimeException)
498{
499 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
500 ::osl::MutexGuard aGuard( m_aMutex );
501
502 sal_Int32 nIndex = -1;
503 if ( m_pListBoxHelper )
504 {
505 sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
506 Rectangle aItemRect = m_pListBoxHelper->GetBoundingRectangle( (sal_uInt16)m_nIndexInParent );
505 sal_uInt16 nPos = LISTBOX_ENTRY_NOTFOUND;
506 Rectangle aItemRect = m_pListBoxHelper->GetBoundingRectangle( (sal_uInt16)m_nIndexInParent );
507 Point aPnt( VCLPoint( aPoint ) );
508 aPnt += aItemRect.TopLeft();
507 Point aPnt( VCLPoint( aPoint ) );
508 aPnt += aItemRect.TopLeft();
509 sal_Int32 nI = m_pListBoxHelper->GetIndexForPoint( aPnt, nPos );
510 if ( nI != -1 && (sal_uInt16)m_nIndexInParent == nPos )
511 nIndex = nI;
509 sal_Int32 nI = m_pListBoxHelper->GetIndexForPoint( aPnt, nPos );
510 if ( nI != -1 && (sal_uInt16)m_nIndexInParent == nPos )
511 nIndex = nI;
512 }
512 }
513 return nIndex;
513 return nIndex;
514}
515// -----------------------------------------------------------------------------
516::rtl::OUString SAL_CALL VCLXAccessibleListItem::getSelectedText() throw (RuntimeException)
517{
518 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
519 ::osl::MutexGuard aGuard( m_aMutex );
520
521 return OCommonAccessibleText::getSelectedText();

--- 15 unchanged lines hidden (view full) ---

537 return OCommonAccessibleText::getSelectionEnd();
538}
539// -----------------------------------------------------------------------------
540sal_Bool SAL_CALL VCLXAccessibleListItem::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (IndexOutOfBoundsException, RuntimeException)
541{
542 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
543 ::osl::MutexGuard aGuard( m_aMutex );
544
514}
515// -----------------------------------------------------------------------------
516::rtl::OUString SAL_CALL VCLXAccessibleListItem::getSelectedText() throw (RuntimeException)
517{
518 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
519 ::osl::MutexGuard aGuard( m_aMutex );
520
521 return OCommonAccessibleText::getSelectedText();

--- 15 unchanged lines hidden (view full) ---

537 return OCommonAccessibleText::getSelectionEnd();
538}
539// -----------------------------------------------------------------------------
540sal_Bool SAL_CALL VCLXAccessibleListItem::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (IndexOutOfBoundsException, RuntimeException)
541{
542 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
543 ::osl::MutexGuard aGuard( m_aMutex );
544
545 if ( !implIsValidRange( nStartIndex, nEndIndex, implGetText().getLength() ) )
546 throw IndexOutOfBoundsException();
545 if ( !implIsValidRange( nStartIndex, nEndIndex, implGetText().getLength() ) )
546 throw IndexOutOfBoundsException();
547
548 return sal_False;
549}
550// -----------------------------------------------------------------------------
551::rtl::OUString SAL_CALL VCLXAccessibleListItem::getText() throw (RuntimeException)
552{
553 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
554 ::osl::MutexGuard aGuard( m_aMutex );

--- 56 unchanged lines hidden (view full) ---

611 if( xFlushableClipboard.is() )
612 xFlushableClipboard->flushClipboard();
613 Application::AcquireSolarMutex( nRef );
614
615 bRet = sal_True;
616 }
617 }
618
547
548 return sal_False;
549}
550// -----------------------------------------------------------------------------
551::rtl::OUString SAL_CALL VCLXAccessibleListItem::getText() throw (RuntimeException)
552{
553 vos::OGuard aSolarGuard( Application::GetSolarMutex() );
554 ::osl::MutexGuard aGuard( m_aMutex );

--- 56 unchanged lines hidden (view full) ---

611 if( xFlushableClipboard.is() )
612 xFlushableClipboard->flushClipboard();
613 Application::AcquireSolarMutex( nRef );
614
615 bRet = sal_True;
616 }
617 }
618
619 return bRet;
619 return bRet;
620}
621// -----------------------------------------------------------------------------
622// XAccessibleEventBroadcaster
623// -----------------------------------------------------------------------------
624void SAL_CALL VCLXAccessibleListItem::addEventListener( const Reference< XAccessibleEventListener >& xListener ) throw (RuntimeException)
625{
626 if (xListener.is())
620}
621// -----------------------------------------------------------------------------
622// XAccessibleEventBroadcaster
623// -----------------------------------------------------------------------------
624void SAL_CALL VCLXAccessibleListItem::addEventListener( const Reference< XAccessibleEventListener >& xListener ) throw (RuntimeException)
625{
626 if (xListener.is())
627 {
627 {
628 if (!m_nClientId)
628 if (!m_nClientId)
629 m_nClientId = comphelper::AccessibleEventNotifier::registerClient( );
629 m_nClientId = comphelper::AccessibleEventNotifier::registerClient( );
630 comphelper::AccessibleEventNotifier::addEventListener( m_nClientId, xListener );
630 comphelper::AccessibleEventNotifier::addEventListener( m_nClientId, xListener );
631 }
631 }
632}
633// -----------------------------------------------------------------------------
634void SAL_CALL VCLXAccessibleListItem::removeEventListener( const Reference< XAccessibleEventListener >& xListener ) throw (RuntimeException)
635{
636 if ( xListener.is() && m_nClientId )
637 {
632}
633// -----------------------------------------------------------------------------
634void SAL_CALL VCLXAccessibleListItem::removeEventListener( const Reference< XAccessibleEventListener >& xListener ) throw (RuntimeException)
635{
636 if ( xListener.is() && m_nClientId )
637 {
638 sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( m_nClientId, xListener );
638 sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( m_nClientId, xListener );
639 if ( !nListenerCount )
640 {
641 // no listeners anymore
642 // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client),
643 // and at least to us not firing any events anymore, in case somebody calls
644 // NotifyAccessibleEvent, again
645 if ( m_nClientId )
646 {
647 comphelper::AccessibleEventNotifier::TClientId nId( m_nClientId );
648 m_nClientId = 0;
649 comphelper::AccessibleEventNotifier::revokeClient( nId );
650 }
651 }
652 }
653}
654// -----------------------------------------------------------------------------
655
656
657
639 if ( !nListenerCount )
640 {
641 // no listeners anymore
642 // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client),
643 // and at least to us not firing any events anymore, in case somebody calls
644 // NotifyAccessibleEvent, again
645 if ( m_nClientId )
646 {
647 comphelper::AccessibleEventNotifier::TClientId nId( m_nClientId );
648 m_nClientId = 0;
649 comphelper::AccessibleEventNotifier::revokeClient( nId );
650 }
651 }
652 }
653}
654// -----------------------------------------------------------------------------
655
656
657
658// AF (Oct. 29 2002): Return black as constant foreground color. This is an
658// AF (Oct. 29 2002): Return black as constant foreground color. This is an
659// initial implementation and has to be substituted by code that determines
660// the color that is actually used.
661sal_Int32 SAL_CALL VCLXAccessibleListItem::getForeground (void)
659// initial implementation and has to be substituted by code that determines
660// the color that is actually used.
661sal_Int32 SAL_CALL VCLXAccessibleListItem::getForeground (void)
662 throw (::com::sun::star::uno::RuntimeException)
662 throw (::com::sun::star::uno::RuntimeException)
663{
663{
664 return COL_BLACK;
664 return COL_BLACK;
665}
666
665}
666
667// AF (Oct. 29 2002): Return white as constant background color. This is an
667// AF (Oct. 29 2002): Return white as constant background color. This is an
668// initial implementation and has to be substituted by code that determines
669// the color that is actually used.
670sal_Int32 SAL_CALL VCLXAccessibleListItem::getBackground (void)
668// initial implementation and has to be substituted by code that determines
669// the color that is actually used.
670sal_Int32 SAL_CALL VCLXAccessibleListItem::getBackground (void)
671 throw (::com::sun::star::uno::RuntimeException)
671 throw (::com::sun::star::uno::RuntimeException)
672{
672{
673 return COL_WHITE;
673 return COL_WHITE;
674}
675// -----------------------------------------------------------------------------
674}
675// -----------------------------------------------------------------------------