Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "accessibility/extended/accessiblelistboxentry.hxx"
30 : : #include <svtools/svtreebx.hxx>
31 : : #include <svtools/stringtransfer.hxx>
32 : : #include <com/sun/star/awt/Point.hpp>
33 : : #include <com/sun/star/awt/Rectangle.hpp>
34 : : #include <com/sun/star/awt/Size.hpp>
35 : : #include <com/sun/star/accessibility/AccessibleEventId.hpp>
36 : : #include <com/sun/star/accessibility/AccessibleRelationType.hpp>
37 : : #include <com/sun/star/accessibility/AccessibleRole.hpp>
38 : : #include <com/sun/star/accessibility/AccessibleStateType.hpp>
39 : : #include <vcl/svapp.hxx>
40 : : #include <vcl/controllayout.hxx>
41 : : #include <toolkit/awt/vclxwindow.hxx>
42 : : #include <toolkit/helper/convert.hxx>
43 : : #include <unotools/accessiblestatesethelper.hxx>
44 : : #include <unotools/accessiblerelationsethelper.hxx>
45 : : #include <cppuhelper/typeprovider.hxx>
46 : : #include <comphelper/sequence.hxx>
47 : : #include <comphelper/accessibleeventnotifier.hxx>
48 : : #include <toolkit/helper/vclunohelper.hxx>
49 : :
50 : : #define ACCESSIBLE_ACTION_COUNT 1
51 : :
52 : : namespace
53 : : {
54 : 0 : void checkActionIndex_Impl( sal_Int32 _nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException)
55 : : {
56 [ # # ][ # # ]: 0 : if ( _nIndex < 0 || _nIndex >= ACCESSIBLE_ACTION_COUNT )
57 : : // only three actions
58 [ # # ]: 0 : throw ::com::sun::star::lang::IndexOutOfBoundsException();
59 : 0 : }
60 : : }
61 : :
62 : : //........................................................................
63 : : namespace accessibility
64 : : {
65 : : // class AccessibleListBoxEntry -----------------------------------------------------
66 : :
67 : : using namespace ::com::sun::star::accessibility;
68 : : using namespace ::com::sun::star::uno;
69 : : using namespace ::com::sun::star::lang;
70 : : using namespace ::com::sun::star;
71 : :
72 : : // -----------------------------------------------------------------------------
73 : : // Ctor() and Dtor()
74 : : // -----------------------------------------------------------------------------
75 : 122 : AccessibleListBoxEntry::AccessibleListBoxEntry( SvTreeListBox& _rListBox,
76 : : SvLBoxEntry* _pEntry,
77 : : const Reference< XAccessible >& _xParent ) :
78 : :
79 : : AccessibleListBoxEntry_BASE ( m_aMutex ),
80 : : ListBoxAccessibleBase( _rListBox ),
81 : :
82 : : m_nClientId ( 0 ),
83 [ + - ][ + - ]: 122 : m_aParent ( _xParent )
[ + - ][ + - ]
84 : :
85 : : {
86 [ + - ]: 122 : _rListBox.FillEntryPath( _pEntry, m_aEntryPath );
87 : 122 : }
88 : : // -----------------------------------------------------------------------------
89 [ + - ][ + - ]: 122 : AccessibleListBoxEntry::~AccessibleListBoxEntry()
[ + - ][ + - ]
90 : : {
91 [ - + ]: 122 : if ( IsAlive_Impl() )
92 : : {
93 : : // increment ref count to prevent double call of Dtor
94 [ # # ]: 0 : osl_incrementInterlockedCount( &m_refCount );
95 [ # # ]: 0 : dispose();
96 : : }
97 [ - + ]: 244 : }
98 : :
99 : : // -----------------------------------------------------------------------------
100 : 120 : Rectangle AccessibleListBoxEntry::GetBoundingBox_Impl() const
101 : : {
102 : 120 : Rectangle aRect;
103 : 120 : SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
104 [ + - ]: 120 : if ( pEntry )
105 : : {
106 : 120 : aRect = getListBox()->GetBoundingRect( pEntry );
107 : 120 : SvLBoxEntry* pParent = getListBox()->GetParent( pEntry );
108 [ - + ]: 120 : if ( pParent )
109 : : {
110 : : // position relative to parent entry
111 : 0 : Point aTopLeft = aRect.TopLeft();
112 [ # # ]: 0 : aTopLeft -= getListBox()->GetBoundingRect( pParent ).TopLeft();
113 [ # # ][ # # ]: 0 : aRect = Rectangle( aTopLeft, aRect.GetSize() );
114 : : }
115 : : }
116 : :
117 : 120 : return aRect;
118 : : }
119 : : // -----------------------------------------------------------------------------
120 : 0 : Rectangle AccessibleListBoxEntry::GetBoundingBoxOnScreen_Impl() const
121 : : {
122 : 0 : Rectangle aRect;
123 : 0 : SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
124 [ # # ]: 0 : if ( pEntry )
125 : : {
126 [ # # ]: 0 : aRect = getListBox()->GetBoundingRect( pEntry );
127 : 0 : Point aTopLeft = aRect.TopLeft();
128 [ # # ]: 0 : aTopLeft += getListBox()->GetWindowExtentsRelative( NULL ).TopLeft();
129 [ # # ][ # # ]: 0 : aRect = Rectangle( aTopLeft, aRect.GetSize() );
130 : : }
131 : :
132 : 0 : return aRect;
133 : : }
134 : : // -----------------------------------------------------------------------------
135 : 602 : sal_Bool AccessibleListBoxEntry::IsAlive_Impl() const
136 : : {
137 [ + + ][ + - ]: 602 : return ( !rBHelper.bDisposed && !rBHelper.bInDispose && isAlive() );
[ + - ]
138 : : }
139 : : // -----------------------------------------------------------------------------
140 : 120 : sal_Bool AccessibleListBoxEntry::IsShowing_Impl() const
141 : : {
142 [ + - ]: 120 : Reference< XAccessible > xParent = implGetParentAccessible( );
143 : :
144 : 120 : sal_Bool bShowing = sal_False;
145 : : Reference< XAccessibleContext > m_xParentContext =
146 [ + - ][ + - ]: 120 : xParent.is() ? xParent->getAccessibleContext() : Reference< XAccessibleContext >();
[ + - ]
147 [ + - ]: 120 : if( m_xParentContext.is() )
148 : : {
149 [ + - ]: 120 : Reference< XAccessibleComponent > xParentComp( m_xParentContext, uno::UNO_QUERY );
150 [ + - ]: 120 : if( xParentComp.is() )
151 [ + - ][ + - ]: 120 : bShowing = GetBoundingBox_Impl().IsOver( VCLRectangle( xParentComp->getBounds() ) );
[ + - ][ + - ]
[ + - ]
152 : : }
153 : :
154 : 120 : return bShowing;
155 : : }
156 : : // -----------------------------------------------------------------------------
157 : 0 : Rectangle AccessibleListBoxEntry::GetBoundingBox() throw ( lang::DisposedException )
158 : : {
159 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
160 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
161 : :
162 [ # # ]: 0 : EnsureIsAlive();
163 [ # # ][ # # ]: 0 : return GetBoundingBox_Impl();
[ # # ]
164 : : }
165 : : // -----------------------------------------------------------------------------
166 : 0 : Rectangle AccessibleListBoxEntry::GetBoundingBoxOnScreen() throw ( lang::DisposedException )
167 : : {
168 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
169 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
170 : :
171 [ # # ]: 0 : EnsureIsAlive();
172 [ # # ][ # # ]: 0 : return GetBoundingBoxOnScreen_Impl();
[ # # ]
173 : : }
174 : : // -----------------------------------------------------------------------------
175 : 360 : void AccessibleListBoxEntry::EnsureIsAlive() const throw ( lang::DisposedException )
176 : : {
177 [ - + ]: 360 : if ( !IsAlive_Impl() )
178 [ # # ]: 0 : throw lang::DisposedException();
179 : 360 : }
180 : : // -----------------------------------------------------------------------------
181 : 0 : ::rtl::OUString AccessibleListBoxEntry::implGetText()
182 : : {
183 : 0 : ::rtl::OUString sRet;
184 [ # # ]: 0 : SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
185 [ # # ]: 0 : if ( pEntry )
186 [ # # ][ # # ]: 0 : sRet = getListBox()->SearchEntryText( pEntry );
[ # # ]
187 : 0 : return sRet;
188 : : }
189 : : // -----------------------------------------------------------------------------
190 : 0 : Locale AccessibleListBoxEntry::implGetLocale()
191 : : {
192 : 0 : Locale aLocale;
193 [ # # ][ # # ]: 0 : aLocale = Application::GetSettings().GetUILocale();
194 : :
195 : 0 : return aLocale;
196 : : }
197 : 0 : void AccessibleListBoxEntry::implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex )
198 : : {
199 : 0 : nStartIndex = 0;
200 : 0 : nEndIndex = 0;
201 : 0 : }
202 : : // -----------------------------------------------------------------------------
203 : : // XTypeProvider
204 : : // -----------------------------------------------------------------------------
205 : : // -----------------------------------------------------------------------------
206 : 0 : Sequence< sal_Int8 > AccessibleListBoxEntry::getImplementationId() throw (RuntimeException)
207 : : {
208 : : static ::cppu::OImplementationId* pId = NULL;
209 : :
210 [ # # ]: 0 : if ( !pId )
211 : : {
212 [ # # ]: 0 : ::osl::Guard< ::osl::Mutex > aGuard( m_aMutex );
213 : :
214 [ # # ]: 0 : if ( !pId )
215 : : {
216 [ # # ][ # # ]: 0 : static ::cppu::OImplementationId aId;
217 : 0 : pId = &aId;
218 [ # # ]: 0 : }
219 : : }
220 : 0 : return pId->getImplementationId();
221 : : }
222 : :
223 : : // -----------------------------------------------------------------------------
224 : : // XComponent/ListBoxAccessibleBase
225 : : // -----------------------------------------------------------------------------
226 : 122 : void SAL_CALL AccessibleListBoxEntry::dispose() throw ( uno::RuntimeException )
227 : : {
228 : 122 : AccessibleListBoxEntry_BASE::dispose();
229 : 122 : }
230 : :
231 : : // -----------------------------------------------------------------------------
232 : : // XComponent
233 : : // -----------------------------------------------------------------------------
234 : 122 : void SAL_CALL AccessibleListBoxEntry::disposing()
235 : : {
236 [ + - ][ + - ]: 122 : SolarMutexGuard();
237 [ + - ]: 122 : ::osl::MutexGuard aGuard( m_aMutex );
238 : :
239 [ + - ]: 122 : Reference< XAccessible > xKeepAlive( this );
240 : :
241 : : // Send a disposing to all listeners.
242 [ - + ]: 122 : if ( m_nClientId )
243 : : {
244 : 0 : ::comphelper::AccessibleEventNotifier::TClientId nId = m_nClientId;
245 : 0 : m_nClientId = 0;
246 [ # # ][ # # ]: 0 : ::comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( nId, *this );
247 : : }
248 : :
249 : : // clean up
250 : : {
251 : :
252 [ + - ]: 122 : ListBoxAccessibleBase::disposing();
253 : : }
254 [ + - ][ + - ]: 122 : m_aParent = WeakReference< XAccessible >();
[ + - ][ + - ]
255 : 122 : }
256 : : // -----------------------------------------------------------------------------
257 : : // XServiceInfo
258 : : // -----------------------------------------------------------------------------
259 : 0 : ::rtl::OUString SAL_CALL AccessibleListBoxEntry::getImplementationName() throw(RuntimeException)
260 : : {
261 : 0 : return getImplementationName_Static();
262 : : }
263 : : // -----------------------------------------------------------------------------
264 : 0 : Sequence< ::rtl::OUString > SAL_CALL AccessibleListBoxEntry::getSupportedServiceNames() throw(RuntimeException)
265 : : {
266 : 0 : return getSupportedServiceNames_Static();
267 : : }
268 : : // -----------------------------------------------------------------------------
269 : 0 : sal_Bool SAL_CALL AccessibleListBoxEntry::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException)
270 : : {
271 [ # # ]: 0 : Sequence< ::rtl::OUString > aSupported( getSupportedServiceNames() );
272 : 0 : const ::rtl::OUString* pSupported = aSupported.getConstArray();
273 : 0 : const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
274 [ # # ][ # # ]: 0 : for ( ; pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported )
[ # # ]
275 : : ;
276 : :
277 [ # # ]: 0 : return pSupported != pEnd;
278 : : }
279 : : // -----------------------------------------------------------------------------
280 : : // XServiceInfo - static methods
281 : : // -----------------------------------------------------------------------------
282 : 0 : Sequence< ::rtl::OUString > AccessibleListBoxEntry::getSupportedServiceNames_Static(void) throw( RuntimeException )
283 : : {
284 : 0 : Sequence< ::rtl::OUString > aSupported(3);
285 [ # # ][ # # ]: 0 : aSupported[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.accessibility.AccessibleContext") );
286 [ # # ][ # # ]: 0 : aSupported[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.accessibility.AccessibleComponent") );
287 [ # # ][ # # ]: 0 : aSupported[2] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.AccessibleTreeListBoxEntry") );
288 : 0 : return aSupported;
289 : : }
290 : : // -----------------------------------------------------------------------------
291 : 0 : ::rtl::OUString AccessibleListBoxEntry::getImplementationName_Static(void) throw( RuntimeException )
292 : : {
293 : 0 : return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.svtools.AccessibleTreeListBoxEntry") );
294 : : }
295 : : // -----------------------------------------------------------------------------
296 : : // XAccessible
297 : : // -----------------------------------------------------------------------------
298 : 120 : Reference< XAccessibleContext > SAL_CALL AccessibleListBoxEntry::getAccessibleContext( ) throw (RuntimeException)
299 : : {
300 : 120 : EnsureIsAlive();
301 : 120 : return this;
302 : : }
303 : : // -----------------------------------------------------------------------------
304 : : // XAccessibleContext
305 : : // -----------------------------------------------------------------------------
306 : 240 : sal_Int32 SAL_CALL AccessibleListBoxEntry::getAccessibleChildCount( ) throw (RuntimeException)
307 : : {
308 [ + - ]: 240 : SolarMutexGuard aSolarGuard;
309 [ + - ]: 240 : ::osl::MutexGuard aGuard( m_aMutex );
310 : :
311 [ + - ]: 240 : EnsureIsAlive();
312 [ + - ]: 240 : SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
313 : 240 : sal_Int32 nCount = 0;
314 [ + - ]: 240 : if ( pEntry )
315 [ + - ]: 240 : nCount = getListBox()->GetLevelChildCount( pEntry );
316 : :
317 [ + - ][ + - ]: 240 : return nCount;
318 : : }
319 : : // -----------------------------------------------------------------------------
320 : 0 : Reference< XAccessible > SAL_CALL AccessibleListBoxEntry::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException,RuntimeException)
321 : : {
322 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
323 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
324 [ # # ]: 0 : EnsureIsAlive();
325 : :
326 [ # # ]: 0 : SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
327 [ # # ][ # # ]: 0 : SvLBoxEntry* pEntry = pParent ? getListBox()->GetEntry( pParent, i ) : NULL;
328 [ # # ]: 0 : if ( !pEntry )
329 [ # # ]: 0 : throw IndexOutOfBoundsException();
330 : :
331 [ # # ][ # # ]: 0 : return new AccessibleListBoxEntry( *getListBox(), pEntry, this );
[ # # ][ # # ]
[ # # ][ # # ]
332 : : }
333 : :
334 : : // -----------------------------------------------------------------------------
335 : 120 : Reference< XAccessible > AccessibleListBoxEntry::implGetParentAccessible( ) const
336 : : {
337 : 120 : Reference< XAccessible > xParent = (Reference< XAccessible >)m_aParent;
338 [ - + ]: 120 : if ( !xParent.is() )
339 : : {
340 : : OSL_ENSURE( m_aEntryPath.size(), "AccessibleListBoxEntry::getAccessibleParent: invalid path!" );
341 [ # # ]: 0 : if ( 1 == m_aEntryPath.size() )
342 : : { // we're a top level entry
343 : : // -> our parent is the tree listbox itself
344 [ # # ]: 0 : if ( getListBox() )
345 [ # # ][ # # ]: 0 : xParent = getListBox()->GetAccessible( );
346 : : }
347 : : else
348 : : { // we have a entry as parent -> get it's accessible
349 : :
350 : : // shorten our access path by one
351 [ # # ]: 0 : ::std::deque< sal_Int32 > aParentPath( m_aEntryPath );
352 [ # # ]: 0 : aParentPath.pop_back();
353 : :
354 : : // get the entry for this shortened access path
355 [ # # ]: 0 : SvLBoxEntry* pParentEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
356 : : OSL_ENSURE( pParentEntry, "AccessibleListBoxEntry::implGetParentAccessible: could not obtain a parent entry!" );
357 : :
358 [ # # ]: 0 : if ( pParentEntry )
359 [ # # ][ # # ]: 0 : xParent = new AccessibleListBoxEntry( *getListBox(), pParentEntry, NULL );
[ # # ][ # # ]
360 : : // note that we pass NULL here as parent-accessible:
361 : : // this is allowed, as the AccessibleListBoxEntry class will create it's parent
362 : : // when needed
363 : : }
364 : : }
365 : :
366 : 120 : return xParent;
367 : : }
368 : :
369 : : // -----------------------------------------------------------------------------
370 : 0 : Reference< XAccessible > SAL_CALL AccessibleListBoxEntry::getAccessibleParent( ) throw (RuntimeException)
371 : : {
372 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
373 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
374 [ # # ]: 0 : EnsureIsAlive();
375 : :
376 [ # # ][ # # ]: 0 : return implGetParentAccessible( );
[ # # ]
377 : : }
378 : : // -----------------------------------------------------------------------------
379 : 0 : sal_Int32 SAL_CALL AccessibleListBoxEntry::getAccessibleIndexInParent( ) throw (RuntimeException)
380 : : {
381 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
382 : :
383 : : OSL_ENSURE( !m_aEntryPath.empty(), "empty path" );
384 [ # # ][ # # ]: 0 : return m_aEntryPath.empty() ? -1 : m_aEntryPath.back();
[ # # ]
385 : : }
386 : : // -----------------------------------------------------------------------------
387 : 120 : sal_Int16 SAL_CALL AccessibleListBoxEntry::getAccessibleRole( ) throw (RuntimeException)
388 : : {
389 : 120 : return AccessibleRole::LABEL;
390 : : }
391 : : // -----------------------------------------------------------------------------
392 : 0 : ::rtl::OUString SAL_CALL AccessibleListBoxEntry::getAccessibleDescription( ) throw (RuntimeException)
393 : : {
394 : : // no description for every item
395 : 0 : return ::rtl::OUString();
396 : : }
397 : : // -----------------------------------------------------------------------------
398 : 0 : ::rtl::OUString SAL_CALL AccessibleListBoxEntry::getAccessibleName( ) throw (RuntimeException)
399 : : {
400 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
401 : :
402 [ # # ]: 0 : EnsureIsAlive();
403 [ # # ][ # # ]: 0 : return implGetText();
404 : : }
405 : : // -----------------------------------------------------------------------------
406 : 0 : Reference< XAccessibleRelationSet > SAL_CALL AccessibleListBoxEntry::getAccessibleRelationSet( ) throw (RuntimeException)
407 : : {
408 : 0 : Reference< XAccessibleRelationSet > xRelSet;
409 : 0 : Reference< XAccessible > xParent;
410 [ # # ]: 0 : if ( m_aEntryPath.size() > 1 ) // not a root entry
411 [ # # ][ # # ]: 0 : xParent = implGetParentAccessible();
412 [ # # ]: 0 : if ( xParent.is() )
413 : : {
414 [ # # ]: 0 : utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper;
415 [ # # ]: 0 : Sequence< Reference< XInterface > > aSequence(1);
416 [ # # ][ # # ]: 0 : aSequence[0] = xParent;
417 : : pRelationSetHelper->AddRelation(
418 [ # # ][ # # ]: 0 : AccessibleRelation( AccessibleRelationType::NODE_CHILD_OF, aSequence ) );
[ # # ]
419 [ # # ][ # # ]: 0 : xRelSet = pRelationSetHelper;
[ # # ]
420 : : }
421 : 0 : return xRelSet;
422 : : }
423 : : // -----------------------------------------------------------------------------
424 : 120 : Reference< XAccessibleStateSet > SAL_CALL AccessibleListBoxEntry::getAccessibleStateSet( ) throw (RuntimeException)
425 : : {
426 [ + - ]: 120 : ::osl::MutexGuard aGuard( m_aMutex );
427 : :
428 [ + - ]: 120 : utl::AccessibleStateSetHelper* pStateSetHelper = new utl::AccessibleStateSetHelper;
429 [ + - ][ + - ]: 120 : Reference< XAccessibleStateSet > xStateSet = pStateSetHelper;
430 : :
431 [ + - ]: 120 : if ( IsAlive_Impl() )
432 : : {
433 [ + - ]: 120 : pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
434 [ + - ]: 120 : pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
435 [ + - ]: 120 : pStateSetHelper->AddState( AccessibleStateType::ENABLED );
436 [ + - ]: 120 : pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
437 [ - + ]: 120 : if ( getListBox()->IsInplaceEditingEnabled() )
438 [ # # ]: 0 : pStateSetHelper->AddState( AccessibleStateType::EDITABLE );
439 [ + - ][ + + ]: 120 : if ( IsShowing_Impl() )
440 [ + - ]: 108 : pStateSetHelper->AddState( AccessibleStateType::SHOWING );
441 : 120 : getListBox()->FillAccessibleEntryStateSet(
442 [ + - ][ + - ]: 120 : getListBox()->GetEntryFromPath( m_aEntryPath ), *pStateSetHelper );
443 : : }
444 : : else
445 [ # # ]: 0 : pStateSetHelper->AddState( AccessibleStateType::DEFUNC );
446 : :
447 [ + - ]: 120 : return xStateSet;
448 : : }
449 : : // -----------------------------------------------------------------------------
450 : 0 : Locale SAL_CALL AccessibleListBoxEntry::getLocale( ) throw (IllegalAccessibleComponentStateException, RuntimeException)
451 : : {
452 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
453 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
454 : :
455 [ # # ][ # # ]: 0 : return implGetLocale();
[ # # ]
456 : : }
457 : : // -----------------------------------------------------------------------------
458 : : // XAccessibleComponent
459 : : // -----------------------------------------------------------------------------
460 : 0 : sal_Bool SAL_CALL AccessibleListBoxEntry::containsPoint( const awt::Point& rPoint ) throw (RuntimeException)
461 : : {
462 [ # # ][ # # ]: 0 : return Rectangle( Point(), GetBoundingBox().GetSize() ).IsInside( VCLPoint( rPoint ) );
[ # # ][ # # ]
463 : : }
464 : : // -----------------------------------------------------------------------------
465 : 0 : Reference< XAccessible > SAL_CALL AccessibleListBoxEntry::getAccessibleAtPoint( const awt::Point& _aPoint ) throw (RuntimeException)
466 : : {
467 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
468 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
469 : :
470 [ # # ]: 0 : EnsureIsAlive();
471 [ # # ]: 0 : SvLBoxEntry* pEntry = getListBox()->GetEntry( VCLPoint( _aPoint ) );
472 [ # # ]: 0 : if ( !pEntry )
473 [ # # ]: 0 : throw RuntimeException();
474 : :
475 : 0 : Reference< XAccessible > xAcc;
476 [ # # ][ # # ]: 0 : AccessibleListBoxEntry* pAccEntry = new AccessibleListBoxEntry( *getListBox(), pEntry, this );
477 [ # # ]: 0 : Rectangle aRect = pAccEntry->GetBoundingBox_Impl();
478 [ # # ][ # # ]: 0 : if ( aRect.IsInside( VCLPoint( _aPoint ) ) )
479 [ # # ][ # # ]: 0 : xAcc = pAccEntry;
480 [ # # ][ # # ]: 0 : return xAcc;
481 : : }
482 : : // -----------------------------------------------------------------------------
483 : 0 : awt::Rectangle SAL_CALL AccessibleListBoxEntry::getBounds( ) throw (RuntimeException)
484 : : {
485 [ # # ]: 0 : return AWTRectangle( GetBoundingBox() );
486 : : }
487 : : // -----------------------------------------------------------------------------
488 : 0 : awt::Point SAL_CALL AccessibleListBoxEntry::getLocation( ) throw (RuntimeException)
489 : : {
490 : 0 : return AWTPoint( GetBoundingBox().TopLeft() );
491 : : }
492 : : // -----------------------------------------------------------------------------
493 : 0 : awt::Point SAL_CALL AccessibleListBoxEntry::getLocationOnScreen( ) throw (RuntimeException)
494 : : {
495 : 0 : return AWTPoint( GetBoundingBoxOnScreen().TopLeft() );
496 : : }
497 : : // -----------------------------------------------------------------------------
498 : 0 : awt::Size SAL_CALL AccessibleListBoxEntry::getSize( ) throw (RuntimeException)
499 : : {
500 [ # # ]: 0 : return AWTSize( GetBoundingBox().GetSize() );
501 : : }
502 : : // -----------------------------------------------------------------------------
503 : 0 : void SAL_CALL AccessibleListBoxEntry::grabFocus( ) throw (RuntimeException)
504 : : {
505 : : // do nothing, because no focus for each item
506 : 0 : }
507 : : // -----------------------------------------------------------------------------
508 : 0 : sal_Int32 AccessibleListBoxEntry::getForeground( ) throw (RuntimeException)
509 : : {
510 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
511 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
512 : :
513 : 0 : sal_Int32 nColor = 0;
514 [ # # ]: 0 : Reference< XAccessible > xParent = getAccessibleParent();
515 [ # # ]: 0 : if ( xParent.is() )
516 : : {
517 [ # # ][ # # ]: 0 : Reference< XAccessibleComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY );
[ # # ]
518 [ # # ]: 0 : if ( xParentComp.is() )
519 [ # # ][ # # ]: 0 : nColor = xParentComp->getForeground();
520 : : }
521 : :
522 [ # # ][ # # ]: 0 : return nColor;
523 : : }
524 : : // -----------------------------------------------------------------------------
525 : 0 : sal_Int32 AccessibleListBoxEntry::getBackground( ) throw (RuntimeException)
526 : : {
527 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
528 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
529 : :
530 : 0 : sal_Int32 nColor = 0;
531 [ # # ]: 0 : Reference< XAccessible > xParent = getAccessibleParent();
532 [ # # ]: 0 : if ( xParent.is() )
533 : : {
534 [ # # ][ # # ]: 0 : Reference< XAccessibleComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY );
[ # # ]
535 [ # # ]: 0 : if ( xParentComp.is() )
536 [ # # ][ # # ]: 0 : nColor = xParentComp->getBackground();
537 : : }
538 : :
539 [ # # ][ # # ]: 0 : return nColor;
540 : : }
541 : : // -----------------------------------------------------------------------------
542 : : // XAccessibleText
543 : : // -----------------------------------------------------------------------------
544 : : // -----------------------------------------------------------------------------
545 : 0 : awt::Rectangle SAL_CALL AccessibleListBoxEntry::getCharacterBounds( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
546 : : {
547 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
548 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
549 : :
550 [ # # ]: 0 : EnsureIsAlive();
551 : :
552 [ # # ][ # # ]: 0 : if ( !implIsValidIndex( nIndex, implGetText().getLength() ) )
[ # # ]
553 [ # # ]: 0 : throw IndexOutOfBoundsException();
554 : :
555 : 0 : awt::Rectangle aBounds( 0, 0, 0, 0 );
556 [ # # ]: 0 : SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
557 [ # # ]: 0 : if ( pEntry )
558 : : {
559 [ # # ]: 0 : ::vcl::ControlLayoutData aLayoutData;
560 [ # # ]: 0 : Rectangle aItemRect = GetBoundingBox();
561 [ # # ]: 0 : getListBox()->RecordLayoutData( &aLayoutData, aItemRect );
562 [ # # ]: 0 : Rectangle aCharRect = aLayoutData.GetCharacterBounds( nIndex );
563 [ # # ]: 0 : aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() );
564 [ # # ][ # # ]: 0 : aBounds = AWTRectangle( aCharRect );
565 : : }
566 : :
567 [ # # ][ # # ]: 0 : return aBounds;
568 : : }
569 : : // -----------------------------------------------------------------------------
570 : 0 : sal_Int32 SAL_CALL AccessibleListBoxEntry::getIndexAtPoint( const awt::Point& aPoint ) throw (RuntimeException)
571 : : {
572 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
573 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
574 [ # # ]: 0 : EnsureIsAlive();
575 : :
576 : 0 : sal_Int32 nIndex = -1;
577 [ # # ]: 0 : SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
578 [ # # ]: 0 : if ( pEntry )
579 : : {
580 [ # # ]: 0 : ::vcl::ControlLayoutData aLayoutData;
581 [ # # ]: 0 : Rectangle aItemRect = GetBoundingBox();
582 [ # # ]: 0 : getListBox()->RecordLayoutData( &aLayoutData, aItemRect );
583 : 0 : Point aPnt( VCLPoint( aPoint ) );
584 : 0 : aPnt += aItemRect.TopLeft();
585 [ # # ][ # # ]: 0 : nIndex = aLayoutData.GetIndexForPoint( aPnt );
586 : : }
587 : :
588 [ # # ][ # # ]: 0 : return nIndex;
589 : : }
590 : : // -----------------------------------------------------------------------------
591 : 0 : sal_Bool SAL_CALL AccessibleListBoxEntry::copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (IndexOutOfBoundsException, RuntimeException)
592 : : {
593 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
594 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
595 [ # # ]: 0 : EnsureIsAlive();
596 : :
597 [ # # ][ # # ]: 0 : String sText = getText();
598 [ # # ]: 0 : if ( ( 0 > nStartIndex ) || ( sText.Len() <= nStartIndex )
[ # # # # ]
[ # # ][ # # ]
599 : 0 : || ( 0 > nEndIndex ) || ( sText.Len() <= nEndIndex ) )
600 [ # # ]: 0 : throw IndexOutOfBoundsException();
601 : :
602 : 0 : sal_Int32 nLen = nEndIndex - nStartIndex + 1;
603 [ # # ][ # # ]: 0 : ::svt::OStringTransfer::CopyString( sText.Copy( (sal_uInt16)nStartIndex, (sal_uInt16)nLen ), getListBox() );
[ # # ][ # # ]
604 : :
605 [ # # ][ # # ]: 0 : return sal_True;
[ # # ]
606 : : }
607 : : // -----------------------------------------------------------------------------
608 : : // XAccessibleEventBroadcaster
609 : : // -----------------------------------------------------------------------------
610 : 0 : void SAL_CALL AccessibleListBoxEntry::addEventListener( const Reference< XAccessibleEventListener >& xListener ) throw (RuntimeException)
611 : : {
612 [ # # ]: 0 : if (xListener.is())
613 : : {
614 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
615 [ # # ]: 0 : if (!m_nClientId)
616 [ # # ]: 0 : m_nClientId = comphelper::AccessibleEventNotifier::registerClient( );
617 [ # # ][ # # ]: 0 : comphelper::AccessibleEventNotifier::addEventListener( m_nClientId, xListener );
618 : : }
619 : 0 : }
620 : : // -----------------------------------------------------------------------------
621 : 0 : void SAL_CALL AccessibleListBoxEntry::removeEventListener( const Reference< XAccessibleEventListener >& xListener ) throw (RuntimeException)
622 : : {
623 [ # # ]: 0 : if (xListener.is())
624 : : {
625 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
626 : :
627 [ # # ]: 0 : sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( m_nClientId, xListener );
628 [ # # ]: 0 : if ( !nListenerCount )
629 : : {
630 : : // no listeners anymore
631 : : // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client),
632 : : // and at least to us not firing any events anymore, in case somebody calls
633 : : // NotifyAccessibleEvent, again
634 : 0 : sal_Int32 nId = m_nClientId;
635 : 0 : m_nClientId = 0;
636 [ # # ]: 0 : comphelper::AccessibleEventNotifier::revokeClient( nId );
637 : :
638 [ # # ]: 0 : }
639 : : }
640 : 0 : }
641 : : // -----------------------------------------------------------------------------
642 : : // XAccessibleAction
643 : : // -----------------------------------------------------------------------------
644 : 0 : sal_Int32 SAL_CALL AccessibleListBoxEntry::getAccessibleActionCount( ) throw (RuntimeException)
645 : : {
646 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
647 : :
648 : : // three actions supported
649 [ # # ]: 0 : return ACCESSIBLE_ACTION_COUNT;
650 : : }
651 : : // -----------------------------------------------------------------------------
652 : 0 : sal_Bool SAL_CALL AccessibleListBoxEntry::doAccessibleAction( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
653 : : {
654 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
655 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
656 : :
657 : 0 : sal_Bool bRet = sal_False;
658 [ # # ]: 0 : checkActionIndex_Impl( nIndex );
659 [ # # ]: 0 : EnsureIsAlive();
660 : :
661 [ # # ]: 0 : SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
662 [ # # ]: 0 : if ( pEntry )
663 : : {
664 [ # # ][ # # ]: 0 : if ( getListBox()->IsExpanded( pEntry ) )
665 [ # # ]: 0 : getListBox()->Collapse( pEntry );
666 : : else
667 [ # # ]: 0 : getListBox()->Expand( pEntry );
668 : 0 : bRet = sal_True;
669 : : }
670 : :
671 [ # # ][ # # ]: 0 : return bRet;
672 : : }
673 : : // -----------------------------------------------------------------------------
674 : 0 : ::rtl::OUString SAL_CALL AccessibleListBoxEntry::getAccessibleActionDescription( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
675 : : {
676 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
677 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
678 : :
679 [ # # ]: 0 : checkActionIndex_Impl( nIndex );
680 [ # # ]: 0 : EnsureIsAlive();
681 : :
682 [ # # ][ # # ]: 0 : static const ::rtl::OUString sActionDesc( RTL_CONSTASCII_USTRINGPARAM( "toggleExpand" ) );
[ # # ][ # # ]
683 [ # # ][ # # ]: 0 : return sActionDesc;
684 : : }
685 : : // -----------------------------------------------------------------------------
686 : 0 : Reference< XAccessibleKeyBinding > AccessibleListBoxEntry::getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
687 : : {
688 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
689 : :
690 : 0 : Reference< XAccessibleKeyBinding > xRet;
691 [ # # ]: 0 : checkActionIndex_Impl( nIndex );
692 : : // ... which key?
693 [ # # ]: 0 : return xRet;
694 : : }
695 : : // -----------------------------------------------------------------------------
696 : : // XAccessibleSelection
697 : : // -----------------------------------------------------------------------------
698 : 0 : void SAL_CALL AccessibleListBoxEntry::selectAccessibleChild( sal_Int32 nChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
699 : : {
700 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
701 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
702 : :
703 [ # # ]: 0 : EnsureIsAlive();
704 : :
705 [ # # ]: 0 : SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
706 [ # # ]: 0 : SvLBoxEntry* pEntry = getListBox()->GetEntry( pParent, nChildIndex );
707 [ # # ]: 0 : if ( !pEntry )
708 [ # # ]: 0 : throw IndexOutOfBoundsException();
709 : :
710 [ # # ][ # # ]: 0 : getListBox()->Select( pEntry, sal_True );
[ # # ]
711 : 0 : }
712 : : // -----------------------------------------------------------------------------
713 : 0 : sal_Bool SAL_CALL AccessibleListBoxEntry::isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
714 : : {
715 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
716 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
717 : :
718 [ # # ]: 0 : EnsureIsAlive();
719 : :
720 [ # # ]: 0 : SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
721 [ # # ]: 0 : SvLBoxEntry* pEntry = getListBox()->GetEntry( pParent, nChildIndex );
722 [ # # ]: 0 : if ( !pEntry )
723 [ # # ]: 0 : throw IndexOutOfBoundsException();
724 : :
725 [ # # ][ # # ]: 0 : return getListBox()->IsSelected( pEntry );
[ # # ]
726 : : }
727 : : // -----------------------------------------------------------------------------
728 : 0 : void SAL_CALL AccessibleListBoxEntry::clearAccessibleSelection( ) throw (RuntimeException)
729 : : {
730 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
731 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
732 : :
733 [ # # ]: 0 : EnsureIsAlive();
734 : :
735 [ # # ]: 0 : SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
736 [ # # ]: 0 : if ( !pParent )
737 [ # # ]: 0 : throw RuntimeException();
738 : 0 : sal_Int32 i, nCount = 0;
739 [ # # ]: 0 : nCount = getListBox()->GetLevelChildCount( pParent );
740 [ # # ]: 0 : for ( i = 0; i < nCount; ++i )
741 : : {
742 [ # # ]: 0 : SvLBoxEntry* pEntry = getListBox()->GetEntry( pParent, i );
743 [ # # ][ # # ]: 0 : if ( getListBox()->IsSelected( pEntry ) )
744 [ # # ]: 0 : getListBox()->Select( pEntry, sal_False );
745 [ # # ][ # # ]: 0 : }
746 : 0 : }
747 : : // -----------------------------------------------------------------------------
748 : 0 : void SAL_CALL AccessibleListBoxEntry::selectAllAccessibleChildren( ) throw (RuntimeException)
749 : : {
750 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
751 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
752 : :
753 [ # # ]: 0 : EnsureIsAlive();
754 : :
755 [ # # ]: 0 : SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
756 [ # # ]: 0 : if ( !pParent )
757 [ # # ]: 0 : throw RuntimeException();
758 : 0 : sal_Int32 i, nCount = 0;
759 [ # # ]: 0 : nCount = getListBox()->GetLevelChildCount( pParent );
760 [ # # ]: 0 : for ( i = 0; i < nCount; ++i )
761 : : {
762 [ # # ]: 0 : SvLBoxEntry* pEntry = getListBox()->GetEntry( pParent, i );
763 [ # # ][ # # ]: 0 : if ( !getListBox()->IsSelected( pEntry ) )
764 [ # # ]: 0 : getListBox()->Select( pEntry, sal_True );
765 [ # # ][ # # ]: 0 : }
766 : 0 : }
767 : : // -----------------------------------------------------------------------------
768 : 0 : sal_Int32 SAL_CALL AccessibleListBoxEntry::getSelectedAccessibleChildCount( ) throw (RuntimeException)
769 : : {
770 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
771 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
772 : :
773 [ # # ]: 0 : EnsureIsAlive();
774 : :
775 : 0 : sal_Int32 i, nSelCount = 0, nCount = 0;
776 : :
777 [ # # ]: 0 : SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
778 [ # # ]: 0 : if ( !pParent )
779 [ # # ]: 0 : throw RuntimeException();
780 [ # # ]: 0 : nCount = getListBox()->GetLevelChildCount( pParent );
781 [ # # ]: 0 : for ( i = 0; i < nCount; ++i )
782 : : {
783 [ # # ]: 0 : SvLBoxEntry* pEntry = getListBox()->GetEntry( pParent, i );
784 [ # # ][ # # ]: 0 : if ( getListBox()->IsSelected( pEntry ) )
785 : 0 : ++nSelCount;
786 : : }
787 : :
788 [ # # ][ # # ]: 0 : return nSelCount;
789 : : }
790 : : // -----------------------------------------------------------------------------
791 : 0 : Reference< XAccessible > SAL_CALL AccessibleListBoxEntry::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
792 : : {
793 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
794 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
795 : :
796 [ # # ]: 0 : EnsureIsAlive();
797 : :
798 [ # # ][ # # ]: 0 : if ( nSelectedChildIndex < 0 || nSelectedChildIndex >= getSelectedAccessibleChildCount() )
[ # # ][ # # ]
799 [ # # ]: 0 : throw IndexOutOfBoundsException();
800 : :
801 : 0 : Reference< XAccessible > xChild;
802 : 0 : sal_Int32 i, nSelCount = 0, nCount = 0;
803 : :
804 [ # # ]: 0 : SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
805 [ # # ]: 0 : if ( !pParent )
806 [ # # ]: 0 : throw RuntimeException();
807 [ # # ]: 0 : nCount = getListBox()->GetLevelChildCount( pParent );
808 [ # # ]: 0 : for ( i = 0; i < nCount; ++i )
809 : : {
810 [ # # ]: 0 : SvLBoxEntry* pEntry = getListBox()->GetEntry( pParent, i );
811 [ # # ][ # # ]: 0 : if ( getListBox()->IsSelected( pEntry ) )
812 : 0 : ++nSelCount;
813 : :
814 [ # # ]: 0 : if ( nSelCount == ( nSelectedChildIndex + 1 ) )
815 : : {
816 [ # # ][ # # ]: 0 : xChild = new AccessibleListBoxEntry( *getListBox(), pEntry, this );
[ # # ][ # # ]
817 : 0 : break;
818 : : }
819 : : }
820 : :
821 [ # # ][ # # ]: 0 : return xChild;
822 : : }
823 : : // -----------------------------------------------------------------------------
824 : 0 : void SAL_CALL AccessibleListBoxEntry::deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
825 : : {
826 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
827 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
828 : :
829 [ # # ]: 0 : EnsureIsAlive();
830 : :
831 [ # # ]: 0 : SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
832 [ # # ]: 0 : SvLBoxEntry* pEntry = getListBox()->GetEntry( pParent, nSelectedChildIndex );
833 [ # # ]: 0 : if ( !pEntry )
834 [ # # ]: 0 : throw IndexOutOfBoundsException();
835 : :
836 [ # # ][ # # ]: 0 : getListBox()->Select( pEntry, sal_False );
[ # # ]
837 : 0 : }
838 : 0 : sal_Int32 SAL_CALL AccessibleListBoxEntry::getCaretPosition( ) throw (::com::sun::star::uno::RuntimeException)
839 : : {
840 : 0 : return -1;
841 : : }
842 : 0 : sal_Bool SAL_CALL AccessibleListBoxEntry::setCaretPosition ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
843 : : {
844 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
845 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
846 [ # # ]: 0 : EnsureIsAlive();
847 : :
848 [ # # ][ # # ]: 0 : if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) )
[ # # ]
849 [ # # ]: 0 : throw IndexOutOfBoundsException();
850 : :
851 [ # # ][ # # ]: 0 : return sal_False;
852 : : }
853 : 0 : sal_Unicode SAL_CALL AccessibleListBoxEntry::getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
854 : : {
855 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
856 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
857 [ # # ]: 0 : EnsureIsAlive();
858 [ # # ][ # # ]: 0 : return OCommonAccessibleText::getCharacter( nIndex );
[ # # ]
859 : : }
860 : 0 : ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL AccessibleListBoxEntry::getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
861 : : {
862 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
863 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
864 [ # # ]: 0 : EnsureIsAlive();
865 : :
866 [ # # ]: 0 : ::rtl::OUString sText( implGetText() );
867 : :
868 [ # # ][ # # ]: 0 : if ( !implIsValidIndex( nIndex, sText.getLength() ) )
869 [ # # ]: 0 : throw IndexOutOfBoundsException();
870 : :
871 [ # # ][ # # ]: 0 : return ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >();
[ # # ]
872 : : }
873 : 0 : sal_Int32 SAL_CALL AccessibleListBoxEntry::getCharacterCount( ) throw (::com::sun::star::uno::RuntimeException)
874 : : {
875 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
876 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
877 [ # # ]: 0 : EnsureIsAlive();
878 [ # # ][ # # ]: 0 : return OCommonAccessibleText::getCharacterCount( );
[ # # ]
879 : : }
880 : :
881 : 0 : ::rtl::OUString SAL_CALL AccessibleListBoxEntry::getSelectedText( ) throw (::com::sun::star::uno::RuntimeException)
882 : : {
883 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
884 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
885 [ # # ]: 0 : EnsureIsAlive();
886 [ # # ][ # # ]: 0 : return OCommonAccessibleText::getSelectedText( );
[ # # ]
887 : : }
888 : 0 : sal_Int32 SAL_CALL AccessibleListBoxEntry::getSelectionStart( ) throw (::com::sun::star::uno::RuntimeException)
889 : : {
890 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
891 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
892 [ # # ]: 0 : EnsureIsAlive();
893 [ # # ][ # # ]: 0 : return OCommonAccessibleText::getSelectionStart( );
[ # # ]
894 : : }
895 : 0 : sal_Int32 SAL_CALL AccessibleListBoxEntry::getSelectionEnd( ) throw (::com::sun::star::uno::RuntimeException)
896 : : {
897 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
898 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
899 [ # # ]: 0 : EnsureIsAlive();
900 [ # # ][ # # ]: 0 : return OCommonAccessibleText::getSelectionEnd( );
[ # # ]
901 : : }
902 : 0 : sal_Bool SAL_CALL AccessibleListBoxEntry::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
903 : : {
904 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
905 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
906 [ # # ]: 0 : EnsureIsAlive();
907 : :
908 [ # # ][ # # ]: 0 : if ( !implIsValidRange( nStartIndex, nEndIndex, implGetText().getLength() ) )
[ # # ]
909 [ # # ]: 0 : throw IndexOutOfBoundsException();
910 : :
911 [ # # ][ # # ]: 0 : return sal_False;
912 : : }
913 : 0 : ::rtl::OUString SAL_CALL AccessibleListBoxEntry::getText( ) throw (::com::sun::star::uno::RuntimeException)
914 : : {
915 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
916 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
917 [ # # ]: 0 : EnsureIsAlive();
918 [ # # ][ # # ]: 0 : return OCommonAccessibleText::getText( );
[ # # ]
919 : : }
920 : 0 : ::rtl::OUString SAL_CALL AccessibleListBoxEntry::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
921 : : {
922 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
923 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
924 [ # # ]: 0 : EnsureIsAlive();
925 [ # # ][ # # ]: 0 : return OCommonAccessibleText::getTextRange( nStartIndex, nEndIndex );
[ # # ]
926 : : }
927 : 0 : ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleListBoxEntry::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
928 : : {
929 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
930 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
931 [ # # ]: 0 : EnsureIsAlive();
932 [ # # ][ # # ]: 0 : return OCommonAccessibleText::getTextAtIndex( nIndex ,aTextType);
[ # # ]
933 : : }
934 : 0 : ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleListBoxEntry::getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
935 : : {
936 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
937 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
938 [ # # ]: 0 : EnsureIsAlive();
939 [ # # ][ # # ]: 0 : return OCommonAccessibleText::getTextBeforeIndex( nIndex ,aTextType);
[ # # ]
940 : : }
941 : 0 : ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleListBoxEntry::getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
942 : : {
943 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
944 [ # # ]: 0 : ::osl::MutexGuard aGuard( m_aMutex );
945 [ # # ]: 0 : EnsureIsAlive();
946 : :
947 [ # # ][ # # ]: 0 : return OCommonAccessibleText::getTextBehindIndex( nIndex ,aTextType);
[ # # ]
948 : : }
949 : : //........................................................................
950 : : }// namespace accessibility
951 : : //........................................................................
952 : :
953 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|