1f6e50924SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3f6e50924SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4f6e50924SAndrew Rist * or more contributor license agreements. See the NOTICE file
5f6e50924SAndrew Rist * distributed with this work for additional information
6f6e50924SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7f6e50924SAndrew Rist * to you under the Apache License, Version 2.0 (the
8f6e50924SAndrew Rist * "License"); you may not use this file except in compliance
9f6e50924SAndrew Rist * with the License. You may obtain a copy of the License at
10f6e50924SAndrew Rist *
11f6e50924SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12f6e50924SAndrew Rist *
13f6e50924SAndrew Rist * Unless required by applicable law or agreed to in writing,
14f6e50924SAndrew Rist * software distributed under the License is distributed on an
15f6e50924SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f6e50924SAndrew Rist * KIND, either express or implied. See the License for the
17f6e50924SAndrew Rist * specific language governing permissions and limitations
18f6e50924SAndrew Rist * under the License.
19f6e50924SAndrew Rist *
20f6e50924SAndrew Rist *************************************************************/
21f6e50924SAndrew Rist
22f6e50924SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svx.hxx"
26cdf0e10cSrcweir #include "AccessibleFrameSelector.hxx"
27cdf0e10cSrcweir #include <com/sun/star/awt/KeyEvent.hpp>
28cdf0e10cSrcweir #include <com/sun/star/awt/KeyModifier.hpp>
29cdf0e10cSrcweir #include <com/sun/star/awt/Key.hpp>
30cdf0e10cSrcweir #ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLESTATETYPE_HDL_
31cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleStateType.hpp>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLERELATIONTYPE_HDL_
34cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleRelationType.hpp>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HDL_
37cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleRole.hpp>
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleEventId.hpp>
40cdf0e10cSrcweir #include <com/sun/star/awt/FocusChangeReason.hpp>
41cdf0e10cSrcweir #include <unotools/accessiblestatesethelper.hxx>
42cdf0e10cSrcweir #include <unotools/accessiblerelationsethelper.hxx>
43cdf0e10cSrcweir #include <vos/mutex.hxx>
44cdf0e10cSrcweir #include <vcl/svapp.hxx>
45cdf0e10cSrcweir #include <svx/frmsel.hxx>
46cdf0e10cSrcweir #include <svx/dialmgr.hxx>
47cdf0e10cSrcweir #include "editeng/unolingu.hxx"
48cdf0e10cSrcweir
49cdf0e10cSrcweir #ifndef _SVX_DIALOGS_HRC
50cdf0e10cSrcweir #include <svx/dialogs.hrc>
51cdf0e10cSrcweir #endif
52cdf0e10cSrcweir #ifndef SVX_FRMSEL_HRC
53cdf0e10cSrcweir #include "frmsel.hrc"
54cdf0e10cSrcweir #endif
55cdf0e10cSrcweir
56cdf0e10cSrcweir #ifndef MNEMONIC_CHAR
57cdf0e10cSrcweir #define MNEMONIC_CHAR ((sal_Unicode)'~')
58cdf0e10cSrcweir #endif
59cdf0e10cSrcweir
60cdf0e10cSrcweir namespace svx {
61cdf0e10cSrcweir namespace a11y {
62cdf0e10cSrcweir
63cdf0e10cSrcweir using ::rtl::OUString;
64cdf0e10cSrcweir using ::com::sun::star::uno::Any;
65cdf0e10cSrcweir using ::com::sun::star::uno::UNO_QUERY;
66cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
67cdf0e10cSrcweir using ::com::sun::star::uno::Sequence;
68cdf0e10cSrcweir using ::com::sun::star::uno::RuntimeException;
69cdf0e10cSrcweir using ::com::sun::star::uno::XInterface;
70cdf0e10cSrcweir using ::com::sun::star::lang::Locale;
71cdf0e10cSrcweir using ::com::sun::star::lang::EventObject;
72cdf0e10cSrcweir using ::com::sun::star::beans::XPropertyChangeListener;
73cdf0e10cSrcweir using ::com::sun::star::awt::XFocusListener;
74cdf0e10cSrcweir
75cdf0e10cSrcweir using namespace ::com::sun::star::accessibility;
76cdf0e10cSrcweir
77cdf0e10cSrcweir namespace AwtKey = ::com::sun::star::awt::Key;
78cdf0e10cSrcweir namespace AwtKeyModifier = ::com::sun::star::awt::KeyModifier;
79cdf0e10cSrcweir namespace AwtFocusChangeReason = ::com::sun::star::awt::FocusChangeReason;
80cdf0e10cSrcweir
81cdf0e10cSrcweir typedef ::com::sun::star::awt::Point AwtPoint;
82cdf0e10cSrcweir typedef ::com::sun::star::awt::Size AwtSize;
83cdf0e10cSrcweir typedef ::com::sun::star::awt::Rectangle AwtRectangle;
84cdf0e10cSrcweir typedef ::com::sun::star::awt::KeyEvent AwtKeyEvent;
85cdf0e10cSrcweir typedef ::com::sun::star::awt::FocusEvent AwtFocusEvent;
86cdf0e10cSrcweir
87cdf0e10cSrcweir // ============================================================================
88cdf0e10cSrcweir
AccFrameSelector(FrameSelector & rFrameSel,FrameBorderType eBorder)89cdf0e10cSrcweir AccFrameSelector::AccFrameSelector( FrameSelector& rFrameSel, FrameBorderType eBorder ) :
90cdf0e10cSrcweir Resource( SVX_RES( RID_SVXSTR_BORDER_CONTROL ) ),
91cdf0e10cSrcweir mpFrameSel( &rFrameSel ),
92cdf0e10cSrcweir meBorder( eBorder ),
93cdf0e10cSrcweir maFocusListeners( maFocusMutex ),
94cdf0e10cSrcweir maPropertyListeners( maPropertyMutex ),
95cdf0e10cSrcweir maNames( SVX_RES( ARR_TEXTS ) ),
96cdf0e10cSrcweir maDescriptions( SVX_RES(ARR_DESCRIPTIONS ) ),
97cdf0e10cSrcweir mnClientId( 0 )
98cdf0e10cSrcweir {
99cdf0e10cSrcweir FreeResource();
100cdf0e10cSrcweir
101cdf0e10cSrcweir if ( mpFrameSel )
102cdf0e10cSrcweir {
103cdf0e10cSrcweir mpFrameSel->AddEventListener( LINK( this, AccFrameSelector, WindowEventListener ) );
104cdf0e10cSrcweir }
105cdf0e10cSrcweir }
106cdf0e10cSrcweir
107cdf0e10cSrcweir // ----------------------------------------------------------------------------
108cdf0e10cSrcweir
~AccFrameSelector()109cdf0e10cSrcweir AccFrameSelector::~AccFrameSelector()
110cdf0e10cSrcweir {
111cdf0e10cSrcweir if ( mpFrameSel )
112cdf0e10cSrcweir {
113cdf0e10cSrcweir mpFrameSel->RemoveEventListener( LINK( this, AccFrameSelector, WindowEventListener ) );
114cdf0e10cSrcweir }
115cdf0e10cSrcweir }
116cdf0e10cSrcweir
117cdf0e10cSrcweir // ----------------------------------------------------------------------------
118cdf0e10cSrcweir
getAccessibleContext()119cdf0e10cSrcweir Reference< XAccessibleContext > AccFrameSelector::getAccessibleContext( )
120cdf0e10cSrcweir throw (RuntimeException)
121cdf0e10cSrcweir {
122cdf0e10cSrcweir return this;
123cdf0e10cSrcweir }
124cdf0e10cSrcweir
125cdf0e10cSrcweir // ----------------------------------------------------------------------------
126cdf0e10cSrcweir
getAccessibleChildCount()127cdf0e10cSrcweir sal_Int32 AccFrameSelector::getAccessibleChildCount( ) throw (RuntimeException)
128cdf0e10cSrcweir {
129cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
130cdf0e10cSrcweir IsValid();
131cdf0e10cSrcweir return (meBorder == FRAMEBORDER_NONE) ? mpFrameSel->GetEnabledBorderCount() : 0;
132cdf0e10cSrcweir }
133cdf0e10cSrcweir
134cdf0e10cSrcweir // ----------------------------------------------------------------------------
135cdf0e10cSrcweir
getAccessibleChild(sal_Int32 i)136cdf0e10cSrcweir Reference< XAccessible > AccFrameSelector::getAccessibleChild( sal_Int32 i )
137cdf0e10cSrcweir throw (RuntimeException)
138cdf0e10cSrcweir {
139cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
140cdf0e10cSrcweir IsValid();
141cdf0e10cSrcweir Reference< XAccessible > xRet;
142cdf0e10cSrcweir if( meBorder == FRAMEBORDER_NONE )
143cdf0e10cSrcweir xRet = mpFrameSel->GetChildAccessible( i );
144cdf0e10cSrcweir if( !xRet.is() )
145cdf0e10cSrcweir throw RuntimeException();
146cdf0e10cSrcweir return xRet;
147cdf0e10cSrcweir }
148cdf0e10cSrcweir
149cdf0e10cSrcweir // ----------------------------------------------------------------------------
150cdf0e10cSrcweir
getAccessibleParent()151cdf0e10cSrcweir Reference< XAccessible > AccFrameSelector::getAccessibleParent( )
152cdf0e10cSrcweir throw (RuntimeException)
153cdf0e10cSrcweir {
154cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
155cdf0e10cSrcweir IsValid();
156cdf0e10cSrcweir Reference< XAccessible > xRet;
157cdf0e10cSrcweir if(meBorder == FRAMEBORDER_NONE)
158cdf0e10cSrcweir xRet = mpFrameSel->GetParent()->GetAccessible( sal_True );
159cdf0e10cSrcweir else
160cdf0e10cSrcweir xRet = mpFrameSel->CreateAccessible();
161cdf0e10cSrcweir return xRet;
162cdf0e10cSrcweir }
163cdf0e10cSrcweir
164cdf0e10cSrcweir // ----------------------------------------------------------------------------
165cdf0e10cSrcweir
getAccessibleIndexInParent()166cdf0e10cSrcweir sal_Int32 AccFrameSelector::getAccessibleIndexInParent( )
167cdf0e10cSrcweir throw (RuntimeException)
168cdf0e10cSrcweir {
169cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
170cdf0e10cSrcweir IsValid();
171cdf0e10cSrcweir
172cdf0e10cSrcweir sal_Int32 nIdx = 0;
173cdf0e10cSrcweir if( meBorder == FRAMEBORDER_NONE )
174cdf0e10cSrcweir {
175cdf0e10cSrcweir Window* pTabPage = mpFrameSel->GetParent();
176cdf0e10cSrcweir sal_Int32 nChildren = pTabPage->GetChildCount();
177cdf0e10cSrcweir for( nIdx = 0; nIdx < nChildren; ++nIdx )
178cdf0e10cSrcweir if( pTabPage->GetChild( static_cast< sal_uInt16 >( nIdx ) ) == mpFrameSel )
179cdf0e10cSrcweir break;
180cdf0e10cSrcweir }
181cdf0e10cSrcweir else
182cdf0e10cSrcweir nIdx = mpFrameSel->GetEnabledBorderIndex( meBorder );
183cdf0e10cSrcweir
184cdf0e10cSrcweir if( nIdx < 0 )
185cdf0e10cSrcweir throw RuntimeException();
186cdf0e10cSrcweir return nIdx;
187cdf0e10cSrcweir }
188cdf0e10cSrcweir
189cdf0e10cSrcweir // ----------------------------------------------------------------------------
190cdf0e10cSrcweir
getAccessibleRole()191cdf0e10cSrcweir sal_Int16 AccFrameSelector::getAccessibleRole( ) throw (RuntimeException)
192cdf0e10cSrcweir {
193*9b8096d0SSteve Yin // return AccessibleRole::OPTION_PANE;
194*9b8096d0SSteve Yin return meBorder == FRAMEBORDER_NONE ? AccessibleRole::OPTION_PANE : AccessibleRole::CHECK_BOX;
195cdf0e10cSrcweir }
196cdf0e10cSrcweir
197cdf0e10cSrcweir // ----------------------------------------------------------------------------
198cdf0e10cSrcweir
getAccessibleDescription()199cdf0e10cSrcweir OUString AccFrameSelector::getAccessibleDescription( )
200cdf0e10cSrcweir throw (RuntimeException)
201cdf0e10cSrcweir {
202cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
203cdf0e10cSrcweir IsValid();
204cdf0e10cSrcweir return maDescriptions.GetString(meBorder);
205cdf0e10cSrcweir }
206cdf0e10cSrcweir
207cdf0e10cSrcweir // ----------------------------------------------------------------------------
208cdf0e10cSrcweir
getAccessibleName()209cdf0e10cSrcweir OUString AccFrameSelector::getAccessibleName( )
210cdf0e10cSrcweir throw (RuntimeException)
211cdf0e10cSrcweir {
212cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
213cdf0e10cSrcweir IsValid();
214cdf0e10cSrcweir return maNames.GetString(meBorder);
215cdf0e10cSrcweir }
216cdf0e10cSrcweir
217cdf0e10cSrcweir // ----------------------------------------------------------------------------
218cdf0e10cSrcweir
getAccessibleRelationSet()219cdf0e10cSrcweir Reference< XAccessibleRelationSet > AccFrameSelector::getAccessibleRelationSet( )
220cdf0e10cSrcweir throw (RuntimeException)
221cdf0e10cSrcweir {
222cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
223cdf0e10cSrcweir IsValid();
224cdf0e10cSrcweir utl::AccessibleRelationSetHelper* pHelper;
225cdf0e10cSrcweir Reference< XAccessibleRelationSet > xRet = pHelper = new utl::AccessibleRelationSetHelper;
226*9b8096d0SSteve Yin //if(meBorder == FRAMEBORDER_NONE)
227*9b8096d0SSteve Yin //{
228*9b8096d0SSteve Yin // //add the label relation
229*9b8096d0SSteve Yin // Window* pPrev = mpFrameSel->GetWindow( WINDOW_PREV );
230*9b8096d0SSteve Yin // if(pPrev && WINDOW_FIXEDTEXT == pPrev->GetType())
231*9b8096d0SSteve Yin // {
232*9b8096d0SSteve Yin // AccessibleRelation aLabelRelation;
233*9b8096d0SSteve Yin // aLabelRelation.RelationType = AccessibleRelationType::LABELED_BY;
234*9b8096d0SSteve Yin // aLabelRelation.TargetSet.realloc(1);
235*9b8096d0SSteve Yin // aLabelRelation.TargetSet.getArray()[0] = pPrev->GetAccessible();
236*9b8096d0SSteve Yin // pHelper->AddRelation(aLabelRelation);
237*9b8096d0SSteve Yin // }
238*9b8096d0SSteve Yin //}
239cdf0e10cSrcweir if(meBorder == FRAMEBORDER_NONE)
240cdf0e10cSrcweir {
241cdf0e10cSrcweir //add the label relation
242*9b8096d0SSteve Yin Window *pLabeledBy = mpFrameSel->GetAccessibleRelationLabeledBy();
243*9b8096d0SSteve Yin if ( pLabeledBy && pLabeledBy != mpFrameSel )
244*9b8096d0SSteve Yin {
245*9b8096d0SSteve Yin AccessibleRelation aLabelRelation;
246cdf0e10cSrcweir aLabelRelation.RelationType = AccessibleRelationType::LABELED_BY;
247cdf0e10cSrcweir aLabelRelation.TargetSet.realloc(1);
248*9b8096d0SSteve Yin aLabelRelation.TargetSet.getArray()[0] = pLabeledBy->GetAccessible();
249cdf0e10cSrcweir pHelper->AddRelation(aLabelRelation);
250*9b8096d0SSteve Yin }
251*9b8096d0SSteve Yin Window* pMemberOf = mpFrameSel->GetAccessibleRelationMemberOf();
252*9b8096d0SSteve Yin if ( pMemberOf && pMemberOf != mpFrameSel )
253*9b8096d0SSteve Yin {
254*9b8096d0SSteve Yin AccessibleRelation aMemberOfRelation;
255*9b8096d0SSteve Yin aMemberOfRelation.RelationType = AccessibleRelationType::MEMBER_OF;
256*9b8096d0SSteve Yin aMemberOfRelation.TargetSet.realloc(1);
257*9b8096d0SSteve Yin aMemberOfRelation.TargetSet.getArray()[0] = pMemberOf->GetAccessible();
258*9b8096d0SSteve Yin pHelper->AddRelation(aMemberOfRelation);
259*9b8096d0SSteve Yin }
260cdf0e10cSrcweir }
261cdf0e10cSrcweir return xRet;
262cdf0e10cSrcweir }
263cdf0e10cSrcweir
264cdf0e10cSrcweir // ----------------------------------------------------------------------------
265cdf0e10cSrcweir
getAccessibleStateSet()266cdf0e10cSrcweir Reference< XAccessibleStateSet > AccFrameSelector::getAccessibleStateSet( )
267cdf0e10cSrcweir throw (RuntimeException)
268cdf0e10cSrcweir {
269cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
270cdf0e10cSrcweir utl::AccessibleStateSetHelper* pStateSetHelper = new utl::AccessibleStateSetHelper;
271cdf0e10cSrcweir Reference< XAccessibleStateSet > xRet = pStateSetHelper;
272cdf0e10cSrcweir
273cdf0e10cSrcweir if(!mpFrameSel)
274cdf0e10cSrcweir pStateSetHelper->AddState(AccessibleStateType::DEFUNC);
275cdf0e10cSrcweir else
276cdf0e10cSrcweir {
277cdf0e10cSrcweir const sal_Int16 aStandardStates[] =
278cdf0e10cSrcweir {
279cdf0e10cSrcweir AccessibleStateType::EDITABLE,
280cdf0e10cSrcweir AccessibleStateType::FOCUSABLE,
281cdf0e10cSrcweir AccessibleStateType::MULTI_SELECTABLE,
282cdf0e10cSrcweir AccessibleStateType::SELECTABLE,
283cdf0e10cSrcweir AccessibleStateType::SHOWING,
284cdf0e10cSrcweir AccessibleStateType::VISIBLE,
285cdf0e10cSrcweir AccessibleStateType::OPAQUE,
286cdf0e10cSrcweir 0};
287cdf0e10cSrcweir sal_Int16 nState = 0;
288cdf0e10cSrcweir while(aStandardStates[nState])
289cdf0e10cSrcweir {
290cdf0e10cSrcweir pStateSetHelper->AddState(aStandardStates[nState++]);
291cdf0e10cSrcweir }
292cdf0e10cSrcweir if(mpFrameSel->IsEnabled())
293cdf0e10cSrcweir {
294cdf0e10cSrcweir pStateSetHelper->AddState(AccessibleStateType::ENABLED);
295cdf0e10cSrcweir pStateSetHelper->AddState(AccessibleStateType::SENSITIVE);
296cdf0e10cSrcweir }
297cdf0e10cSrcweir
298cdf0e10cSrcweir sal_Bool bIsParent = meBorder == FRAMEBORDER_NONE;
299cdf0e10cSrcweir if(mpFrameSel->HasFocus() &&
300cdf0e10cSrcweir (bIsParent || mpFrameSel->IsBorderSelected(meBorder)))
301cdf0e10cSrcweir {
302cdf0e10cSrcweir pStateSetHelper->AddState(AccessibleStateType::ACTIVE);
303cdf0e10cSrcweir pStateSetHelper->AddState(AccessibleStateType::FOCUSED);
304cdf0e10cSrcweir pStateSetHelper->AddState(AccessibleStateType::SELECTED);
305cdf0e10cSrcweir }
306cdf0e10cSrcweir }
307cdf0e10cSrcweir return xRet;
308cdf0e10cSrcweir }
309cdf0e10cSrcweir
310cdf0e10cSrcweir // ----------------------------------------------------------------------------
311cdf0e10cSrcweir
getLocale()312cdf0e10cSrcweir Locale AccFrameSelector::getLocale( )
313cdf0e10cSrcweir throw (IllegalAccessibleComponentStateException, RuntimeException)
314cdf0e10cSrcweir {
315cdf0e10cSrcweir Locale aRet;
316cdf0e10cSrcweir SvxLanguageToLocale( aRet, Application::GetSettings().GetUILanguage() );
317cdf0e10cSrcweir return aRet;
318cdf0e10cSrcweir }
319cdf0e10cSrcweir
320cdf0e10cSrcweir // ----------------------------------------------------------------------------
321cdf0e10cSrcweir
addPropertyChangeListener(const Reference<XPropertyChangeListener> & xListener)322cdf0e10cSrcweir void AccFrameSelector::addPropertyChangeListener(
323cdf0e10cSrcweir const Reference< XPropertyChangeListener >& xListener )
324cdf0e10cSrcweir throw (RuntimeException)
325cdf0e10cSrcweir {
326cdf0e10cSrcweir maPropertyListeners.addInterface( xListener );
327cdf0e10cSrcweir }
328cdf0e10cSrcweir
329cdf0e10cSrcweir // ----------------------------------------------------------------------------
330cdf0e10cSrcweir
removePropertyChangeListener(const Reference<XPropertyChangeListener> & xListener)331cdf0e10cSrcweir void AccFrameSelector::removePropertyChangeListener( const Reference< XPropertyChangeListener >& xListener )
332cdf0e10cSrcweir throw (RuntimeException)
333cdf0e10cSrcweir {
334cdf0e10cSrcweir maPropertyListeners.removeInterface( xListener );
335cdf0e10cSrcweir }
336cdf0e10cSrcweir
337cdf0e10cSrcweir // ----------------------------------------------------------------------------
338cdf0e10cSrcweir
containsPoint(const AwtPoint & aPt)339cdf0e10cSrcweir sal_Bool AccFrameSelector::containsPoint( const AwtPoint& aPt )
340cdf0e10cSrcweir throw (RuntimeException)
341cdf0e10cSrcweir {
342cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
343cdf0e10cSrcweir IsValid();
344cdf0e10cSrcweir //aPt is relative to the frame selector
345cdf0e10cSrcweir return mpFrameSel->ContainsClickPoint( Point( aPt.X, aPt.Y ) );
346cdf0e10cSrcweir }
347cdf0e10cSrcweir
348cdf0e10cSrcweir // ----------------------------------------------------------------------------
349cdf0e10cSrcweir
getAccessibleAtPoint(const AwtPoint & aPt)350cdf0e10cSrcweir Reference< XAccessible > AccFrameSelector::getAccessibleAtPoint(
351cdf0e10cSrcweir const AwtPoint& aPt )
352cdf0e10cSrcweir throw (RuntimeException)
353cdf0e10cSrcweir {
354cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
355cdf0e10cSrcweir IsValid();
356cdf0e10cSrcweir //aPt is relative to the frame selector
357cdf0e10cSrcweir return mpFrameSel->GetChildAccessible( Point( aPt.X, aPt.Y ) );
358cdf0e10cSrcweir }
359cdf0e10cSrcweir
getBounds()360cdf0e10cSrcweir AwtRectangle AccFrameSelector::getBounds( ) throw (RuntimeException)
361cdf0e10cSrcweir {
362cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
363cdf0e10cSrcweir IsValid();
364cdf0e10cSrcweir Size aSz;
365cdf0e10cSrcweir Point aPos;
366cdf0e10cSrcweir switch(meBorder)
367cdf0e10cSrcweir {
368cdf0e10cSrcweir case FRAMEBORDER_NONE:
369cdf0e10cSrcweir aSz = mpFrameSel->GetSizePixel();
370cdf0e10cSrcweir aPos = mpFrameSel->GetPosPixel();
371cdf0e10cSrcweir break;
372cdf0e10cSrcweir default:
373cdf0e10cSrcweir const Rectangle aSpot = mpFrameSel->GetClickBoundRect( meBorder );
374cdf0e10cSrcweir aPos = aSpot.TopLeft();
375cdf0e10cSrcweir aSz = aSpot.GetSize();
376cdf0e10cSrcweir }
377cdf0e10cSrcweir AwtRectangle aRet;
378cdf0e10cSrcweir aRet.X = aPos.X();
379cdf0e10cSrcweir aRet.Y = aPos.Y();
380cdf0e10cSrcweir aRet.Width = aSz.Width();
381cdf0e10cSrcweir aRet.Height = aSz.Height();
382cdf0e10cSrcweir return aRet;
383cdf0e10cSrcweir }
384cdf0e10cSrcweir
385cdf0e10cSrcweir // ----------------------------------------------------------------------------
386cdf0e10cSrcweir
getLocation()387cdf0e10cSrcweir AwtPoint AccFrameSelector::getLocation( ) throw (RuntimeException)
388cdf0e10cSrcweir {
389cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
390cdf0e10cSrcweir IsValid();
391cdf0e10cSrcweir Point aPos;
392cdf0e10cSrcweir switch(meBorder)
393cdf0e10cSrcweir {
394cdf0e10cSrcweir case FRAMEBORDER_NONE:
395cdf0e10cSrcweir aPos = mpFrameSel->GetPosPixel();
396cdf0e10cSrcweir break;
397cdf0e10cSrcweir default:
398cdf0e10cSrcweir const Rectangle aSpot = mpFrameSel->GetClickBoundRect( meBorder );
399cdf0e10cSrcweir aPos = aSpot.TopLeft();
400cdf0e10cSrcweir }
401cdf0e10cSrcweir AwtPoint aRet(aPos.X(), aPos.Y());
402cdf0e10cSrcweir return aRet;
403cdf0e10cSrcweir }
404cdf0e10cSrcweir
405cdf0e10cSrcweir // ----------------------------------------------------------------------------
406cdf0e10cSrcweir
getLocationOnScreen()407cdf0e10cSrcweir AwtPoint AccFrameSelector::getLocationOnScreen( ) throw (RuntimeException)
408cdf0e10cSrcweir {
409cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
410cdf0e10cSrcweir IsValid();
411cdf0e10cSrcweir Point aPos;
412cdf0e10cSrcweir switch(meBorder)
413cdf0e10cSrcweir {
414cdf0e10cSrcweir case FRAMEBORDER_NONE:
415cdf0e10cSrcweir aPos = mpFrameSel->GetPosPixel();
416cdf0e10cSrcweir break;
417cdf0e10cSrcweir default:
418cdf0e10cSrcweir const Rectangle aSpot = mpFrameSel->GetClickBoundRect( meBorder );
419cdf0e10cSrcweir aPos = aSpot.TopLeft();
420cdf0e10cSrcweir }
421cdf0e10cSrcweir aPos = mpFrameSel->OutputToAbsoluteScreenPixel( aPos );
422cdf0e10cSrcweir AwtPoint aRet(aPos.X(), aPos.Y());
423cdf0e10cSrcweir return aRet;
424cdf0e10cSrcweir }
425cdf0e10cSrcweir
426cdf0e10cSrcweir // ----------------------------------------------------------------------------
427cdf0e10cSrcweir
getSize()428cdf0e10cSrcweir AwtSize AccFrameSelector::getSize( ) throw (RuntimeException)
429cdf0e10cSrcweir {
430cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
431cdf0e10cSrcweir IsValid();
432cdf0e10cSrcweir Size aSz;
433cdf0e10cSrcweir switch(meBorder)
434cdf0e10cSrcweir {
435cdf0e10cSrcweir case FRAMEBORDER_NONE:
436cdf0e10cSrcweir aSz = mpFrameSel->GetSizePixel();
437cdf0e10cSrcweir break;
438cdf0e10cSrcweir default:
439cdf0e10cSrcweir const Rectangle aSpot = mpFrameSel->GetClickBoundRect( meBorder );
440cdf0e10cSrcweir aSz = aSpot.GetSize();
441cdf0e10cSrcweir }
442cdf0e10cSrcweir AwtSize aRet(aSz.Width(), aSz.Height());
443cdf0e10cSrcweir return aRet;
444cdf0e10cSrcweir }
445cdf0e10cSrcweir
446cdf0e10cSrcweir // ----------------------------------------------------------------------------
447cdf0e10cSrcweir
isShowing()448cdf0e10cSrcweir sal_Bool AccFrameSelector::isShowing( ) throw (RuntimeException)
449cdf0e10cSrcweir {
450cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
451cdf0e10cSrcweir IsValid();
452cdf0e10cSrcweir return sal_True;
453cdf0e10cSrcweir }
454cdf0e10cSrcweir
455cdf0e10cSrcweir // ----------------------------------------------------------------------------
456cdf0e10cSrcweir
isVisible()457cdf0e10cSrcweir sal_Bool AccFrameSelector::isVisible( ) throw (RuntimeException)
458cdf0e10cSrcweir {
459cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
460cdf0e10cSrcweir IsValid();
461cdf0e10cSrcweir return sal_True;
462cdf0e10cSrcweir }
463cdf0e10cSrcweir
464cdf0e10cSrcweir // ----------------------------------------------------------------------------
465cdf0e10cSrcweir
isFocusTraversable()466cdf0e10cSrcweir sal_Bool AccFrameSelector::isFocusTraversable( ) throw (RuntimeException)
467cdf0e10cSrcweir {
468cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
469cdf0e10cSrcweir IsValid();
470cdf0e10cSrcweir return sal_True;
471cdf0e10cSrcweir }
472cdf0e10cSrcweir
473cdf0e10cSrcweir // ----------------------------------------------------------------------------
474cdf0e10cSrcweir
addFocusListener(const Reference<XFocusListener> & xListener)475cdf0e10cSrcweir void AccFrameSelector::addFocusListener( const Reference< XFocusListener >& xListener ) throw (RuntimeException)
476cdf0e10cSrcweir {
477cdf0e10cSrcweir maFocusListeners.addInterface( xListener );
478cdf0e10cSrcweir }
479cdf0e10cSrcweir
480cdf0e10cSrcweir // ----------------------------------------------------------------------------
481cdf0e10cSrcweir
removeFocusListener(const Reference<XFocusListener> & xListener)482cdf0e10cSrcweir void AccFrameSelector::removeFocusListener( const Reference< XFocusListener >& xListener ) throw (RuntimeException)
483cdf0e10cSrcweir {
484cdf0e10cSrcweir maFocusListeners.removeInterface( xListener );
485cdf0e10cSrcweir }
486cdf0e10cSrcweir
487cdf0e10cSrcweir // ----------------------------------------------------------------------------
488cdf0e10cSrcweir
grabFocus()489cdf0e10cSrcweir void AccFrameSelector::grabFocus( ) throw (RuntimeException)
490cdf0e10cSrcweir {
491cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
492cdf0e10cSrcweir IsValid();
493cdf0e10cSrcweir mpFrameSel->GrabFocus();
494cdf0e10cSrcweir }
495cdf0e10cSrcweir
496cdf0e10cSrcweir // ----------------------------------------------------------------------------
497cdf0e10cSrcweir
getAccessibleKeyBinding()498cdf0e10cSrcweir Any AccFrameSelector::getAccessibleKeyBinding( ) throw (RuntimeException)
499cdf0e10cSrcweir {
500cdf0e10cSrcweir Any aRet;
501cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
502cdf0e10cSrcweir IsValid();
503cdf0e10cSrcweir utl::AccessibleRelationSetHelper* pHelper;
504cdf0e10cSrcweir Reference< XAccessibleRelationSet > xRet = pHelper = new utl::AccessibleRelationSetHelper;
505cdf0e10cSrcweir if(meBorder == FRAMEBORDER_NONE)
506cdf0e10cSrcweir {
507cdf0e10cSrcweir Window* pPrev = mpFrameSel->GetWindow( WINDOW_PREV );
508cdf0e10cSrcweir if(pPrev && WINDOW_FIXEDTEXT == pPrev->GetType())
509cdf0e10cSrcweir {
510cdf0e10cSrcweir String sText = pPrev->GetText();
511cdf0e10cSrcweir xub_StrLen nFound = sText.Search( MNEMONIC_CHAR );
512cdf0e10cSrcweir if(STRING_NOTFOUND != nFound && ++nFound < sText.Len())
513cdf0e10cSrcweir {
514cdf0e10cSrcweir sText.ToUpperAscii();
515cdf0e10cSrcweir sal_Unicode cChar = sText.GetChar(nFound);
516cdf0e10cSrcweir AwtKeyEvent aEvent;
517cdf0e10cSrcweir
518cdf0e10cSrcweir aEvent.KeyCode = 0;
519cdf0e10cSrcweir aEvent.KeyChar = cChar;
520cdf0e10cSrcweir aEvent.KeyFunc = 0;
521cdf0e10cSrcweir if(cChar >= 'A' && cChar <= 'Z')
522cdf0e10cSrcweir {
523cdf0e10cSrcweir aEvent.KeyCode = AwtKey::A + cChar - 'A';
524cdf0e10cSrcweir }
525cdf0e10cSrcweir aEvent.Modifiers = AwtKeyModifier::MOD2;
526cdf0e10cSrcweir aRet <<= aEvent;
527cdf0e10cSrcweir }
528cdf0e10cSrcweir }
529cdf0e10cSrcweir }
530cdf0e10cSrcweir return aRet;
531cdf0e10cSrcweir }
532cdf0e10cSrcweir
533cdf0e10cSrcweir // ----------------------------------------------------------------------------
534cdf0e10cSrcweir
getForeground()535cdf0e10cSrcweir sal_Int32 AccFrameSelector::getForeground( )
536cdf0e10cSrcweir throw (RuntimeException)
537cdf0e10cSrcweir {
538cdf0e10cSrcweir Any aRet;
539cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
540cdf0e10cSrcweir IsValid();
541cdf0e10cSrcweir return mpFrameSel->GetControlForeground().GetColor();
542cdf0e10cSrcweir }
543cdf0e10cSrcweir
544cdf0e10cSrcweir // ----------------------------------------------------------------------------
545cdf0e10cSrcweir
getBackground()546cdf0e10cSrcweir sal_Int32 AccFrameSelector::getBackground( )
547cdf0e10cSrcweir throw (RuntimeException)
548cdf0e10cSrcweir {
549cdf0e10cSrcweir Any aRet;
550cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
551cdf0e10cSrcweir IsValid();
552cdf0e10cSrcweir return mpFrameSel->GetControlBackground().GetColor();
553cdf0e10cSrcweir }
554cdf0e10cSrcweir
555cdf0e10cSrcweir // ----------------------------------------------------------------------------
556cdf0e10cSrcweir
addEventListener(const Reference<XAccessibleEventListener> & xListener)557cdf0e10cSrcweir void AccFrameSelector::addEventListener( const Reference< XAccessibleEventListener >& xListener ) throw (RuntimeException)
558cdf0e10cSrcweir {
559cdf0e10cSrcweir vos::OGuard aGuard( Application::GetSolarMutex() );
560cdf0e10cSrcweir
561cdf0e10cSrcweir if ( xListener.is() )
562cdf0e10cSrcweir {
563cdf0e10cSrcweir if ( !mnClientId )
564cdf0e10cSrcweir {
565cdf0e10cSrcweir mnClientId = ::comphelper::AccessibleEventNotifier::registerClient();
566cdf0e10cSrcweir }
567cdf0e10cSrcweir ::comphelper::AccessibleEventNotifier::addEventListener( mnClientId, xListener );
568cdf0e10cSrcweir }
569cdf0e10cSrcweir }
570cdf0e10cSrcweir
571cdf0e10cSrcweir // ----------------------------------------------------------------------------
572cdf0e10cSrcweir
removeEventListener(const Reference<XAccessibleEventListener> & xListener)573cdf0e10cSrcweir void AccFrameSelector::removeEventListener( const Reference< XAccessibleEventListener >& xListener ) throw (RuntimeException)
574cdf0e10cSrcweir {
575cdf0e10cSrcweir vos::OGuard aGuard( Application::GetSolarMutex() );
576cdf0e10cSrcweir
577cdf0e10cSrcweir if ( xListener.is() && mnClientId != 0 &&
578cdf0e10cSrcweir ::comphelper::AccessibleEventNotifier::removeEventListener( mnClientId, xListener ) == 0 )
579cdf0e10cSrcweir {
580cdf0e10cSrcweir // no listeners anymore
581cdf0e10cSrcweir // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client),
582cdf0e10cSrcweir // and at least to us not firing any events anymore, in case somebody calls
583cdf0e10cSrcweir // NotifyAccessibleEvent, again
584cdf0e10cSrcweir ::comphelper::AccessibleEventNotifier::TClientId nId( mnClientId );
585cdf0e10cSrcweir mnClientId = 0;
586cdf0e10cSrcweir ::comphelper::AccessibleEventNotifier::revokeClient( nId );
587cdf0e10cSrcweir }
588cdf0e10cSrcweir }
589cdf0e10cSrcweir
590cdf0e10cSrcweir // ----------------------------------------------------------------------------
591cdf0e10cSrcweir
getImplementationName()592cdf0e10cSrcweir OUString AccFrameSelector::getImplementationName( ) throw (RuntimeException)
593cdf0e10cSrcweir {
594cdf0e10cSrcweir return OUString::createFromAscii("AccFrameSelector");
595cdf0e10cSrcweir }
596cdf0e10cSrcweir
597cdf0e10cSrcweir // ----------------------------------------------------------------------------
598cdf0e10cSrcweir
599cdf0e10cSrcweir const sal_Char sAccessible[] = "Accessible";
600cdf0e10cSrcweir const sal_Char sAccessibleContext[] = "AccessibleContext";
601cdf0e10cSrcweir const sal_Char sAccessibleComponent[] = "AccessibleComponent";
602cdf0e10cSrcweir
supportsService(const OUString & rServiceName)603cdf0e10cSrcweir sal_Bool AccFrameSelector::supportsService( const OUString& rServiceName )
604cdf0e10cSrcweir throw (RuntimeException)
605cdf0e10cSrcweir {
606cdf0e10cSrcweir return rServiceName.equalsAsciiL( sAccessible , sizeof(sAccessible )-1 ) ||
607cdf0e10cSrcweir rServiceName.equalsAsciiL( sAccessibleContext , sizeof(sAccessibleContext )-1 ) ||
608cdf0e10cSrcweir rServiceName.equalsAsciiL( sAccessibleComponent, sizeof(sAccessibleComponent)-1 );
609cdf0e10cSrcweir }
610cdf0e10cSrcweir
611cdf0e10cSrcweir // ----------------------------------------------------------------------------
612cdf0e10cSrcweir
getSupportedServiceNames()613cdf0e10cSrcweir Sequence< OUString > AccFrameSelector::getSupportedServiceNames( )
614cdf0e10cSrcweir throw (RuntimeException)
615cdf0e10cSrcweir {
616cdf0e10cSrcweir Sequence< OUString > aRet(3);
617cdf0e10cSrcweir OUString* pArray = aRet.getArray();
618cdf0e10cSrcweir pArray[0] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessible ) );
619cdf0e10cSrcweir pArray[1] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleContext ) );
620cdf0e10cSrcweir pArray[2] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleComponent) );
621cdf0e10cSrcweir return aRet;
622cdf0e10cSrcweir }
623cdf0e10cSrcweir
624cdf0e10cSrcweir // ----------------------------------------------------------------------------
625cdf0e10cSrcweir
IsValid()626cdf0e10cSrcweir void AccFrameSelector::IsValid() throw (RuntimeException)
627cdf0e10cSrcweir {
628cdf0e10cSrcweir if(!mpFrameSel)
629cdf0e10cSrcweir throw RuntimeException();
630cdf0e10cSrcweir }
631cdf0e10cSrcweir
632cdf0e10cSrcweir // ----------------------------------------------------------------------------
633cdf0e10cSrcweir
NotifyFocusListeners(sal_Bool bGetFocus)634cdf0e10cSrcweir void AccFrameSelector::NotifyFocusListeners(sal_Bool bGetFocus)
635cdf0e10cSrcweir {
636cdf0e10cSrcweir vos::OGuard aGuard(Application::GetSolarMutex());
637cdf0e10cSrcweir AwtFocusEvent aEvent;
638cdf0e10cSrcweir aEvent.FocusFlags = 0;
639cdf0e10cSrcweir if(bGetFocus)
640cdf0e10cSrcweir {
641cdf0e10cSrcweir sal_uInt16 nFocusFlags = mpFrameSel->GetGetFocusFlags();
642cdf0e10cSrcweir if(nFocusFlags&GETFOCUS_TAB)
643cdf0e10cSrcweir aEvent.FocusFlags |= AwtFocusChangeReason::TAB;
644cdf0e10cSrcweir if(nFocusFlags&GETFOCUS_CURSOR)
645cdf0e10cSrcweir aEvent.FocusFlags |= AwtFocusChangeReason::CURSOR;
646cdf0e10cSrcweir if(nFocusFlags&GETFOCUS_MNEMONIC)
647cdf0e10cSrcweir aEvent.FocusFlags |= AwtFocusChangeReason::MNEMONIC;
648cdf0e10cSrcweir if(nFocusFlags&GETFOCUS_FORWARD)
649cdf0e10cSrcweir aEvent.FocusFlags |= AwtFocusChangeReason::FORWARD;
650cdf0e10cSrcweir if(nFocusFlags&GETFOCUS_BACKWARD)
651cdf0e10cSrcweir aEvent.FocusFlags |= AwtFocusChangeReason::BACKWARD;
652cdf0e10cSrcweir if(nFocusFlags&GETFOCUS_AROUND)
653cdf0e10cSrcweir aEvent.FocusFlags |= AwtFocusChangeReason::AROUND;
654cdf0e10cSrcweir if(nFocusFlags&GETFOCUS_UNIQUEMNEMONIC)
655cdf0e10cSrcweir aEvent.FocusFlags |= AwtFocusChangeReason::UNIQUEMNEMONIC;
656cdf0e10cSrcweir // if(nFocusFlags&GETFOCUS_INIT)
657cdf0e10cSrcweir // aEvent.FocusFlags |= AwtFocusChangeReason::
658cdf0e10cSrcweir }
659cdf0e10cSrcweir // else
660cdf0e10cSrcweir //how can I find the current focus window?
661cdf0e10cSrcweir // aEvent.NextFocus = ;
662cdf0e10cSrcweir aEvent.Temporary = sal_False;
663cdf0e10cSrcweir
664cdf0e10cSrcweir Reference < XAccessibleContext > xThis( this );
665cdf0e10cSrcweir aEvent.Source = xThis;
666cdf0e10cSrcweir
667cdf0e10cSrcweir ::cppu::OInterfaceIteratorHelper aIter( maFocusListeners );
668cdf0e10cSrcweir while( aIter.hasMoreElements() )
669cdf0e10cSrcweir {
670cdf0e10cSrcweir Reference < XFocusListener > xListener( aIter.next(), UNO_QUERY );
671cdf0e10cSrcweir if(bGetFocus)
672cdf0e10cSrcweir xListener->focusGained( aEvent );
673cdf0e10cSrcweir else
674cdf0e10cSrcweir xListener->focusLost( aEvent );
675cdf0e10cSrcweir }
676cdf0e10cSrcweir }
677cdf0e10cSrcweir
678cdf0e10cSrcweir // ----------------------------------------------------------------------------
679cdf0e10cSrcweir
IMPL_LINK(AccFrameSelector,WindowEventListener,VclSimpleEvent *,pEvent)680cdf0e10cSrcweir IMPL_LINK( AccFrameSelector, WindowEventListener, VclSimpleEvent*, pEvent )
681cdf0e10cSrcweir {
682cdf0e10cSrcweir VclWindowEvent* pWinEvent = dynamic_cast< VclWindowEvent* >( pEvent );
683cdf0e10cSrcweir DBG_ASSERT( pWinEvent, "AccFrameSelector::WindowEventListener - unknown window event" );
684cdf0e10cSrcweir if ( pWinEvent )
685cdf0e10cSrcweir {
686cdf0e10cSrcweir Window* pWindow = pWinEvent->GetWindow();
687cdf0e10cSrcweir DBG_ASSERT( pWindow, "AccFrameSelector::WindowEventListener: no window!" );
688cdf0e10cSrcweir if ( !pWindow->IsAccessibilityEventsSuppressed() || ( pWinEvent->GetId() == VCLEVENT_OBJECT_DYING ) )
689cdf0e10cSrcweir {
690cdf0e10cSrcweir ProcessWindowEvent( *pWinEvent );
691cdf0e10cSrcweir }
692cdf0e10cSrcweir }
693cdf0e10cSrcweir
694cdf0e10cSrcweir return 0;
695cdf0e10cSrcweir }
696cdf0e10cSrcweir
697cdf0e10cSrcweir // ----------------------------------------------------------------------------
698cdf0e10cSrcweir
ProcessWindowEvent(const VclWindowEvent & rVclWindowEvent)699cdf0e10cSrcweir void AccFrameSelector::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
700cdf0e10cSrcweir {
701cdf0e10cSrcweir switch ( rVclWindowEvent.GetId() )
702cdf0e10cSrcweir {
703cdf0e10cSrcweir case VCLEVENT_WINDOW_GETFOCUS:
704cdf0e10cSrcweir {
705cdf0e10cSrcweir if ( meBorder == FRAMEBORDER_NONE )
706cdf0e10cSrcweir {
707cdf0e10cSrcweir Any aOldValue, aNewValue;
708cdf0e10cSrcweir aNewValue <<= AccessibleStateType::FOCUSED;
709cdf0e10cSrcweir NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
710cdf0e10cSrcweir }
711cdf0e10cSrcweir }
712cdf0e10cSrcweir break;
713cdf0e10cSrcweir case VCLEVENT_WINDOW_LOSEFOCUS:
714cdf0e10cSrcweir {
715cdf0e10cSrcweir if ( meBorder == FRAMEBORDER_NONE )
716cdf0e10cSrcweir {
717cdf0e10cSrcweir Any aOldValue, aNewValue;
718cdf0e10cSrcweir aOldValue <<= AccessibleStateType::FOCUSED;
719cdf0e10cSrcweir NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
720cdf0e10cSrcweir }
721cdf0e10cSrcweir }
722cdf0e10cSrcweir break;
723cdf0e10cSrcweir default:
724cdf0e10cSrcweir {
725cdf0e10cSrcweir }
726cdf0e10cSrcweir break;
727cdf0e10cSrcweir }
728cdf0e10cSrcweir }
729cdf0e10cSrcweir
730cdf0e10cSrcweir // ----------------------------------------------------------------------------
731cdf0e10cSrcweir
NotifyAccessibleEvent(const sal_Int16 _nEventId,const Any & _rOldValue,const Any & _rNewValue)732cdf0e10cSrcweir void AccFrameSelector::NotifyAccessibleEvent( const sal_Int16 _nEventId,
733cdf0e10cSrcweir const Any& _rOldValue, const Any& _rNewValue )
734cdf0e10cSrcweir {
735cdf0e10cSrcweir if ( mnClientId )
736cdf0e10cSrcweir {
737cdf0e10cSrcweir Reference< XInterface > xSource( *this );
738cdf0e10cSrcweir AccessibleEventObject aEvent( xSource, _nEventId, _rNewValue, _rOldValue );
739cdf0e10cSrcweir ::comphelper::AccessibleEventNotifier::addEvent( mnClientId, aEvent );
740cdf0e10cSrcweir }
741cdf0e10cSrcweir }
742cdf0e10cSrcweir
743cdf0e10cSrcweir // ----------------------------------------------------------------------------
744cdf0e10cSrcweir
Invalidate()745cdf0e10cSrcweir void AccFrameSelector::Invalidate()
746cdf0e10cSrcweir {
747*9b8096d0SSteve Yin if ( mpFrameSel )
748*9b8096d0SSteve Yin {
749*9b8096d0SSteve Yin mpFrameSel->RemoveEventListener( LINK( this, AccFrameSelector, WindowEventListener ) );
750*9b8096d0SSteve Yin }
751cdf0e10cSrcweir mpFrameSel = 0;
752cdf0e10cSrcweir EventObject aEvent;
753cdf0e10cSrcweir Reference < XAccessibleContext > xThis( this );
754cdf0e10cSrcweir aEvent.Source = xThis;
755cdf0e10cSrcweir maFocusListeners.disposeAndClear( aEvent );
756cdf0e10cSrcweir maPropertyListeners.disposeAndClear( aEvent );
757cdf0e10cSrcweir }
758cdf0e10cSrcweir
759cdf0e10cSrcweir // ============================================================================
760cdf0e10cSrcweir
761cdf0e10cSrcweir } // namespace a11y
762cdf0e10cSrcweir } // namespace svx
763cdf0e10cSrcweir
764