1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_accessibility.hxx"
30*cdf0e10cSrcweir #include <accessibility/extended/accessibletabbarpage.hxx>
31*cdf0e10cSrcweir #include <svtools/tabbar.hxx>
32*cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleEventId.hpp>
33*cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleRole.hpp>
34*cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleStateType.hpp>
35*cdf0e10cSrcweir #include <unotools/accessiblestatesethelper.hxx>
36*cdf0e10cSrcweir #include <unotools/accessiblerelationsethelper.hxx>
37*cdf0e10cSrcweir #include <vcl/svapp.hxx>
38*cdf0e10cSrcweir #include <toolkit/helper/convert.hxx>
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir //.........................................................................
42*cdf0e10cSrcweir namespace accessibility
43*cdf0e10cSrcweir {
44*cdf0e10cSrcweir //.........................................................................
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir 	using namespace ::com::sun::star::accessibility;
47*cdf0e10cSrcweir 	using namespace ::com::sun::star::uno;
48*cdf0e10cSrcweir 	using namespace ::com::sun::star::lang;
49*cdf0e10cSrcweir 	using namespace ::com::sun::star;
50*cdf0e10cSrcweir 	using namespace ::comphelper;
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
53*cdf0e10cSrcweir 	// class AccessibleTabBarPage
54*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir 	AccessibleTabBarPage::AccessibleTabBarPage( TabBar* pTabBar, sal_uInt16 nPageId, const Reference< XAccessible >& rxParent )
57*cdf0e10cSrcweir         :AccessibleTabBarBase( pTabBar )
58*cdf0e10cSrcweir 		,m_nPageId( nPageId )
59*cdf0e10cSrcweir 		,m_xParent( rxParent )
60*cdf0e10cSrcweir 	{
61*cdf0e10cSrcweir 		m_bEnabled	= IsEnabled();
62*cdf0e10cSrcweir 		m_bShowing	= IsShowing();
63*cdf0e10cSrcweir 		m_bSelected = IsSelected();
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir 		if ( m_pTabBar )
66*cdf0e10cSrcweir 			m_sPageText = m_pTabBar->GetPageText( m_nPageId );
67*cdf0e10cSrcweir 	}
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir 	AccessibleTabBarPage::~AccessibleTabBarPage()
72*cdf0e10cSrcweir 	{
73*cdf0e10cSrcweir 	}
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir 	sal_Bool AccessibleTabBarPage::IsEnabled()
78*cdf0e10cSrcweir 	{
79*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir 		sal_Bool bEnabled = sal_False;
82*cdf0e10cSrcweir 		if ( m_pTabBar )
83*cdf0e10cSrcweir 			bEnabled = m_pTabBar->IsPageEnabled( m_nPageId );
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir 		return bEnabled;
86*cdf0e10cSrcweir 	}
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir 	sal_Bool AccessibleTabBarPage::IsShowing()
91*cdf0e10cSrcweir 	{
92*cdf0e10cSrcweir 		sal_Bool bShowing = sal_False;
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir 		if ( m_pTabBar && m_pTabBar->IsVisible() )
95*cdf0e10cSrcweir 			bShowing = sal_True;
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir 		return bShowing;
98*cdf0e10cSrcweir 	}
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir 	sal_Bool AccessibleTabBarPage::IsSelected()
103*cdf0e10cSrcweir 	{
104*cdf0e10cSrcweir 		sal_Bool bSelected = sal_False;
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir 		if ( m_pTabBar && m_pTabBar->GetCurPageId() == m_nPageId )
107*cdf0e10cSrcweir 			bSelected = sal_True;
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir 		return bSelected;
110*cdf0e10cSrcweir 	}
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir 	void AccessibleTabBarPage::SetEnabled( sal_Bool bEnabled )
115*cdf0e10cSrcweir 	{
116*cdf0e10cSrcweir 		if ( m_bEnabled != bEnabled )
117*cdf0e10cSrcweir 		{
118*cdf0e10cSrcweir             Any aOldValue[2], aNewValue[2];
119*cdf0e10cSrcweir             if ( m_bEnabled )
120*cdf0e10cSrcweir             {
121*cdf0e10cSrcweir                 aOldValue[0] <<= AccessibleStateType::SENSITIVE;
122*cdf0e10cSrcweir                 aOldValue[1] <<= AccessibleStateType::ENABLED;
123*cdf0e10cSrcweir             }
124*cdf0e10cSrcweir             else
125*cdf0e10cSrcweir             {
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir                 aNewValue[0] <<= AccessibleStateType::ENABLED;
128*cdf0e10cSrcweir                 aNewValue[1] <<= AccessibleStateType::SENSITIVE;
129*cdf0e10cSrcweir             }
130*cdf0e10cSrcweir             m_bEnabled = bEnabled;
131*cdf0e10cSrcweir             NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue[0], aNewValue[0] );
132*cdf0e10cSrcweir             NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue[1], aNewValue[1] );
133*cdf0e10cSrcweir 		}
134*cdf0e10cSrcweir 	}
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir 	void AccessibleTabBarPage::SetShowing( sal_Bool bShowing )
139*cdf0e10cSrcweir 	{
140*cdf0e10cSrcweir 		if ( m_bShowing != bShowing )
141*cdf0e10cSrcweir 		{
142*cdf0e10cSrcweir 			Any aOldValue, aNewValue;
143*cdf0e10cSrcweir 			if ( m_bShowing )
144*cdf0e10cSrcweir 				aOldValue <<= AccessibleStateType::SHOWING;
145*cdf0e10cSrcweir 			else
146*cdf0e10cSrcweir 				aNewValue <<= AccessibleStateType::SHOWING;
147*cdf0e10cSrcweir 			m_bShowing = bShowing;
148*cdf0e10cSrcweir 			NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
149*cdf0e10cSrcweir 		}
150*cdf0e10cSrcweir 	}
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir 	void AccessibleTabBarPage::SetSelected( sal_Bool bSelected )
155*cdf0e10cSrcweir 	{
156*cdf0e10cSrcweir 		if ( m_bSelected != bSelected )
157*cdf0e10cSrcweir 		{
158*cdf0e10cSrcweir 			Any aOldValue, aNewValue;
159*cdf0e10cSrcweir 			if ( m_bSelected )
160*cdf0e10cSrcweir 				aOldValue <<= AccessibleStateType::SELECTED;
161*cdf0e10cSrcweir 			else
162*cdf0e10cSrcweir 				aNewValue <<= AccessibleStateType::SELECTED;
163*cdf0e10cSrcweir 			m_bSelected = bSelected;
164*cdf0e10cSrcweir 			NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
165*cdf0e10cSrcweir 		}
166*cdf0e10cSrcweir 	}
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir 	void AccessibleTabBarPage::SetPageText( const ::rtl::OUString& sPageText )
171*cdf0e10cSrcweir 	{
172*cdf0e10cSrcweir 		if ( !m_sPageText.equals( sPageText ) )
173*cdf0e10cSrcweir 		{
174*cdf0e10cSrcweir 			Any aOldValue, aNewValue;
175*cdf0e10cSrcweir 			aOldValue <<= m_sPageText;
176*cdf0e10cSrcweir 			aNewValue <<= sPageText;
177*cdf0e10cSrcweir 			m_sPageText = sPageText;
178*cdf0e10cSrcweir 			NotifyAccessibleEvent( AccessibleEventId::NAME_CHANGED, aOldValue, aNewValue );
179*cdf0e10cSrcweir 		}
180*cdf0e10cSrcweir 	}
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir 	void AccessibleTabBarPage::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
185*cdf0e10cSrcweir 	{
186*cdf0e10cSrcweir 		if ( IsEnabled() )
187*cdf0e10cSrcweir         {
188*cdf0e10cSrcweir             rStateSet.AddState( AccessibleStateType::ENABLED );
189*cdf0e10cSrcweir             rStateSet.AddState( AccessibleStateType::SENSITIVE );
190*cdf0e10cSrcweir         }
191*cdf0e10cSrcweir 
192*cdf0e10cSrcweir 		rStateSet.AddState( AccessibleStateType::VISIBLE );
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir 		if ( IsShowing() )
195*cdf0e10cSrcweir 			rStateSet.AddState( AccessibleStateType::SHOWING );
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir 		rStateSet.AddState( AccessibleStateType::SELECTABLE );
198*cdf0e10cSrcweir 
199*cdf0e10cSrcweir 		if ( IsSelected() )
200*cdf0e10cSrcweir 			rStateSet.AddState( AccessibleStateType::SELECTED );
201*cdf0e10cSrcweir 	}
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
204*cdf0e10cSrcweir 	// OCommonAccessibleComponent
205*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
206*cdf0e10cSrcweir 
207*cdf0e10cSrcweir 	awt::Rectangle AccessibleTabBarPage::implGetBounds() throw (RuntimeException)
208*cdf0e10cSrcweir 	{
209*cdf0e10cSrcweir 		awt::Rectangle aBounds;
210*cdf0e10cSrcweir 		if ( m_pTabBar )
211*cdf0e10cSrcweir 		{
212*cdf0e10cSrcweir 			// get bounding rectangle relative to the AccessibleTabBar
213*cdf0e10cSrcweir 			aBounds = AWTRectangle( m_pTabBar->GetPageRect( m_nPageId ) );
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir 			// get position of the AccessibleTabBarPageList relative to the AccessibleTabBar
216*cdf0e10cSrcweir 			Reference< XAccessible > xParent = getAccessibleParent();
217*cdf0e10cSrcweir 			if ( xParent.is() )
218*cdf0e10cSrcweir 			{
219*cdf0e10cSrcweir 				Reference< XAccessibleComponent > xParentComponent( xParent->getAccessibleContext(), UNO_QUERY );
220*cdf0e10cSrcweir 				if ( xParentComponent.is() )
221*cdf0e10cSrcweir 				{
222*cdf0e10cSrcweir 					awt::Point aParentLoc = xParentComponent->getLocation();
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir 					// calculate bounding rectangle relative to the AccessibleTabBarPageList
225*cdf0e10cSrcweir 					aBounds.X -= aParentLoc.X;
226*cdf0e10cSrcweir 					aBounds.Y -= aParentLoc.Y;
227*cdf0e10cSrcweir 				}
228*cdf0e10cSrcweir 			}
229*cdf0e10cSrcweir 		}
230*cdf0e10cSrcweir 
231*cdf0e10cSrcweir 		return aBounds;
232*cdf0e10cSrcweir 	}
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
235*cdf0e10cSrcweir 	// XInterface
236*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
237*cdf0e10cSrcweir 
238*cdf0e10cSrcweir 	IMPLEMENT_FORWARD_XINTERFACE2( AccessibleTabBarPage, AccessibleExtendedComponentHelper_BASE, AccessibleTabBarPage_BASE )
239*cdf0e10cSrcweir 
240*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
241*cdf0e10cSrcweir 	// XTypeProvider
242*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir 	IMPLEMENT_FORWARD_XTYPEPROVIDER2( AccessibleTabBarPage, AccessibleExtendedComponentHelper_BASE, AccessibleTabBarPage_BASE )
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
247*cdf0e10cSrcweir 	// XComponent
248*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
249*cdf0e10cSrcweir 
250*cdf0e10cSrcweir 	void AccessibleTabBarPage::disposing()
251*cdf0e10cSrcweir 	{
252*cdf0e10cSrcweir         AccessibleTabBarBase::disposing();
253*cdf0e10cSrcweir 		m_sPageText = ::rtl::OUString();
254*cdf0e10cSrcweir 	}
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
257*cdf0e10cSrcweir 	// XServiceInfo
258*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir 	::rtl::OUString AccessibleTabBarPage::getImplementationName() throw (RuntimeException)
261*cdf0e10cSrcweir 	{
262*cdf0e10cSrcweir 		return ::rtl::OUString::createFromAscii( "com.sun.star.comp.svtools.AccessibleTabBarPage" );
263*cdf0e10cSrcweir 	}
264*cdf0e10cSrcweir 
265*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
266*cdf0e10cSrcweir 
267*cdf0e10cSrcweir 	sal_Bool AccessibleTabBarPage::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException)
268*cdf0e10cSrcweir 	{
269*cdf0e10cSrcweir 		Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() );
270*cdf0e10cSrcweir 		const ::rtl::OUString* pNames = aNames.getConstArray();
271*cdf0e10cSrcweir 		const ::rtl::OUString* pEnd = pNames + aNames.getLength();
272*cdf0e10cSrcweir 		for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames )
273*cdf0e10cSrcweir 			;
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir 		return pNames != pEnd;
276*cdf0e10cSrcweir 	}
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
279*cdf0e10cSrcweir 
280*cdf0e10cSrcweir 	Sequence< ::rtl::OUString > AccessibleTabBarPage::getSupportedServiceNames() throw (RuntimeException)
281*cdf0e10cSrcweir 	{
282*cdf0e10cSrcweir 		Sequence< ::rtl::OUString > aNames(1);
283*cdf0e10cSrcweir 		aNames[0] = ::rtl::OUString::createFromAscii( "com.sun.star.awt.AccessibleTabBarPage" );
284*cdf0e10cSrcweir 		return aNames;
285*cdf0e10cSrcweir 	}
286*cdf0e10cSrcweir 
287*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
288*cdf0e10cSrcweir 	// XAccessible
289*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir 	Reference< XAccessibleContext > AccessibleTabBarPage::getAccessibleContext(  ) throw (RuntimeException)
292*cdf0e10cSrcweir 	{
293*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
294*cdf0e10cSrcweir 
295*cdf0e10cSrcweir 		return this;
296*cdf0e10cSrcweir 	}
297*cdf0e10cSrcweir 
298*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
299*cdf0e10cSrcweir 	// XAccessibleContext
300*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
301*cdf0e10cSrcweir 
302*cdf0e10cSrcweir 	sal_Int32 AccessibleTabBarPage::getAccessibleChildCount() throw (RuntimeException)
303*cdf0e10cSrcweir 	{
304*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
305*cdf0e10cSrcweir 
306*cdf0e10cSrcweir 		return 0;
307*cdf0e10cSrcweir 	}
308*cdf0e10cSrcweir 
309*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir 	Reference< XAccessible > AccessibleTabBarPage::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException, RuntimeException)
312*cdf0e10cSrcweir 	{
313*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir 		if ( i < 0 || i >= getAccessibleChildCount() )
316*cdf0e10cSrcweir 			throw IndexOutOfBoundsException();
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir 		return Reference< XAccessible >();
319*cdf0e10cSrcweir 	}
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir 	Reference< XAccessible > AccessibleTabBarPage::getAccessibleParent(  ) throw (RuntimeException)
324*cdf0e10cSrcweir 	{
325*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir 		return m_xParent;
328*cdf0e10cSrcweir 	}
329*cdf0e10cSrcweir 
330*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
331*cdf0e10cSrcweir 
332*cdf0e10cSrcweir 	sal_Int32 AccessibleTabBarPage::getAccessibleIndexInParent(  ) throw (RuntimeException)
333*cdf0e10cSrcweir 	{
334*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir 		sal_Int32 nIndexInParent = -1;
337*cdf0e10cSrcweir 		if ( m_pTabBar )
338*cdf0e10cSrcweir 			nIndexInParent = m_pTabBar->GetPagePos( m_nPageId );
339*cdf0e10cSrcweir 
340*cdf0e10cSrcweir 		return nIndexInParent;
341*cdf0e10cSrcweir 	}
342*cdf0e10cSrcweir 
343*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
344*cdf0e10cSrcweir 
345*cdf0e10cSrcweir 	sal_Int16 AccessibleTabBarPage::getAccessibleRole(  ) throw (RuntimeException)
346*cdf0e10cSrcweir 	{
347*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
348*cdf0e10cSrcweir 
349*cdf0e10cSrcweir 		return AccessibleRole::PAGE_TAB;
350*cdf0e10cSrcweir 	}
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir 	::rtl::OUString AccessibleTabBarPage::getAccessibleDescription(	) throw (RuntimeException)
355*cdf0e10cSrcweir 	{
356*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
357*cdf0e10cSrcweir 
358*cdf0e10cSrcweir 		::rtl::OUString sDescription;
359*cdf0e10cSrcweir 		if ( m_pTabBar )
360*cdf0e10cSrcweir 			sDescription = m_pTabBar->GetHelpText( m_nPageId );
361*cdf0e10cSrcweir 
362*cdf0e10cSrcweir 		return sDescription;
363*cdf0e10cSrcweir 	}
364*cdf0e10cSrcweir 
365*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
366*cdf0e10cSrcweir 
367*cdf0e10cSrcweir 	::rtl::OUString AccessibleTabBarPage::getAccessibleName(  ) throw (RuntimeException)
368*cdf0e10cSrcweir 	{
369*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
370*cdf0e10cSrcweir 
371*cdf0e10cSrcweir 		return m_sPageText;
372*cdf0e10cSrcweir 	}
373*cdf0e10cSrcweir 
374*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
375*cdf0e10cSrcweir 
376*cdf0e10cSrcweir 	Reference< XAccessibleRelationSet > AccessibleTabBarPage::getAccessibleRelationSet(  ) throw (RuntimeException)
377*cdf0e10cSrcweir 	{
378*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
379*cdf0e10cSrcweir 
380*cdf0e10cSrcweir 		utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper;
381*cdf0e10cSrcweir 		Reference< XAccessibleRelationSet > xSet = pRelationSetHelper;
382*cdf0e10cSrcweir 		return xSet;
383*cdf0e10cSrcweir 	}
384*cdf0e10cSrcweir 
385*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
386*cdf0e10cSrcweir 
387*cdf0e10cSrcweir 	Reference< XAccessibleStateSet > AccessibleTabBarPage::getAccessibleStateSet(  ) throw (RuntimeException)
388*cdf0e10cSrcweir 	{
389*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
390*cdf0e10cSrcweir 
391*cdf0e10cSrcweir 		utl::AccessibleStateSetHelper* pStateSetHelper = new utl::AccessibleStateSetHelper;
392*cdf0e10cSrcweir 		Reference< XAccessibleStateSet > xSet = pStateSetHelper;
393*cdf0e10cSrcweir 
394*cdf0e10cSrcweir 		if ( !rBHelper.bDisposed && !rBHelper.bInDispose )
395*cdf0e10cSrcweir 		{
396*cdf0e10cSrcweir 			FillAccessibleStateSet( *pStateSetHelper );
397*cdf0e10cSrcweir 		}
398*cdf0e10cSrcweir 		else
399*cdf0e10cSrcweir 		{
400*cdf0e10cSrcweir 			pStateSetHelper->AddState( AccessibleStateType::DEFUNC );
401*cdf0e10cSrcweir 		}
402*cdf0e10cSrcweir 
403*cdf0e10cSrcweir 		return xSet;
404*cdf0e10cSrcweir 	}
405*cdf0e10cSrcweir 
406*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
407*cdf0e10cSrcweir 
408*cdf0e10cSrcweir 	Locale AccessibleTabBarPage::getLocale(  ) throw (IllegalAccessibleComponentStateException, RuntimeException)
409*cdf0e10cSrcweir 	{
410*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
411*cdf0e10cSrcweir 
412*cdf0e10cSrcweir 		return Application::GetSettings().GetLocale();
413*cdf0e10cSrcweir 	}
414*cdf0e10cSrcweir 
415*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
416*cdf0e10cSrcweir 	// XAccessibleComponent
417*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
418*cdf0e10cSrcweir 
419*cdf0e10cSrcweir 	Reference< XAccessible > AccessibleTabBarPage::getAccessibleAtPoint( const awt::Point& ) throw (RuntimeException)
420*cdf0e10cSrcweir 	{
421*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
422*cdf0e10cSrcweir 
423*cdf0e10cSrcweir 		return Reference< XAccessible >();
424*cdf0e10cSrcweir 	}
425*cdf0e10cSrcweir 
426*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
427*cdf0e10cSrcweir 
428*cdf0e10cSrcweir 	void AccessibleTabBarPage::grabFocus(  ) throw (RuntimeException)
429*cdf0e10cSrcweir 	{
430*cdf0e10cSrcweir 		// no focus
431*cdf0e10cSrcweir 	}
432*cdf0e10cSrcweir 
433*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
434*cdf0e10cSrcweir 
435*cdf0e10cSrcweir 	sal_Int32 AccessibleTabBarPage::getForeground(	) throw (RuntimeException)
436*cdf0e10cSrcweir 	{
437*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
438*cdf0e10cSrcweir 
439*cdf0e10cSrcweir 		sal_Int32 nColor = 0;
440*cdf0e10cSrcweir 		Reference< XAccessible > xParent = getAccessibleParent();
441*cdf0e10cSrcweir 		if ( xParent.is() )
442*cdf0e10cSrcweir 		{
443*cdf0e10cSrcweir 			Reference< XAccessibleComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY );
444*cdf0e10cSrcweir 			if ( xParentComp.is() )
445*cdf0e10cSrcweir 				nColor = xParentComp->getForeground();
446*cdf0e10cSrcweir 		}
447*cdf0e10cSrcweir 
448*cdf0e10cSrcweir 		return nColor;
449*cdf0e10cSrcweir 	}
450*cdf0e10cSrcweir 
451*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
452*cdf0e10cSrcweir 
453*cdf0e10cSrcweir 	sal_Int32 AccessibleTabBarPage::getBackground(  ) throw (RuntimeException)
454*cdf0e10cSrcweir 	{
455*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
456*cdf0e10cSrcweir 
457*cdf0e10cSrcweir 		sal_Int32 nColor = 0;
458*cdf0e10cSrcweir 		Reference< XAccessible > xParent = getAccessibleParent();
459*cdf0e10cSrcweir 		if ( xParent.is() )
460*cdf0e10cSrcweir 		{
461*cdf0e10cSrcweir 			Reference< XAccessibleComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY );
462*cdf0e10cSrcweir 			if ( xParentComp.is() )
463*cdf0e10cSrcweir 				nColor = xParentComp->getBackground();
464*cdf0e10cSrcweir 		}
465*cdf0e10cSrcweir 
466*cdf0e10cSrcweir 		return nColor;
467*cdf0e10cSrcweir 	}
468*cdf0e10cSrcweir 
469*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
470*cdf0e10cSrcweir 	// XAccessibleExtendedComponent
471*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
472*cdf0e10cSrcweir 
473*cdf0e10cSrcweir 	Reference< awt::XFont > AccessibleTabBarPage::getFont(  ) throw (RuntimeException)
474*cdf0e10cSrcweir 	{
475*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
476*cdf0e10cSrcweir 
477*cdf0e10cSrcweir 		Reference< awt::XFont > xFont;
478*cdf0e10cSrcweir 		Reference< XAccessible > xParent = getAccessibleParent();
479*cdf0e10cSrcweir 		if ( xParent.is() )
480*cdf0e10cSrcweir 		{
481*cdf0e10cSrcweir 			Reference< XAccessibleExtendedComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY );
482*cdf0e10cSrcweir 			if ( xParentComp.is() )
483*cdf0e10cSrcweir 				xFont = xParentComp->getFont();
484*cdf0e10cSrcweir 		}
485*cdf0e10cSrcweir 
486*cdf0e10cSrcweir 		return xFont;
487*cdf0e10cSrcweir 	}
488*cdf0e10cSrcweir 
489*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
490*cdf0e10cSrcweir 
491*cdf0e10cSrcweir 	::rtl::OUString AccessibleTabBarPage::getTitledBorderText(  ) throw (RuntimeException)
492*cdf0e10cSrcweir 	{
493*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
494*cdf0e10cSrcweir 
495*cdf0e10cSrcweir 		return m_sPageText;
496*cdf0e10cSrcweir 	}
497*cdf0e10cSrcweir 
498*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
499*cdf0e10cSrcweir 
500*cdf0e10cSrcweir 	::rtl::OUString AccessibleTabBarPage::getToolTipText(  ) throw (RuntimeException)
501*cdf0e10cSrcweir 	{
502*cdf0e10cSrcweir 		OExternalLockGuard aGuard( this );
503*cdf0e10cSrcweir 
504*cdf0e10cSrcweir 		return ::rtl::OUString();
505*cdf0e10cSrcweir 	}
506*cdf0e10cSrcweir 
507*cdf0e10cSrcweir 	// -----------------------------------------------------------------------------
508*cdf0e10cSrcweir 
509*cdf0e10cSrcweir //.........................................................................
510*cdf0e10cSrcweir }	// namespace accessibility
511*cdf0e10cSrcweir //.........................................................................
512