1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessibleFrameSelector.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SVX_ACCESSIBLEFRAMESELECTOR_HXX
32 #define SVX_ACCESSIBLEFRAMESELECTOR_HXX
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
36 #include <com/sun/star/awt/XFocusListener.hpp>
37 #include <com/sun/star/accessibility/XAccessible.hpp>
38 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
39 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
40 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
41 #include <tools/resary.hxx>
42 #include <cppuhelper/implbase5.hxx>
43 #include <cppuhelper/interfacecontainer.hxx>
44 #include <comphelper/accessibleeventnotifier.hxx>
45 #include <svx/framebordertype.hxx>
56 // ============================================================================
58 class AccFrameSelector
:
59 public ::cppu::WeakImplHelper5
<
60 ::com::sun::star::accessibility::XAccessible
,
61 ::com::sun::star::accessibility::XAccessibleContext
,
62 ::com::sun::star::accessibility::XAccessibleComponent
,
63 ::com::sun::star::accessibility::XAccessibleEventBroadcaster
,
64 ::com::sun::star::lang::XServiceInfo
69 explicit AccFrameSelector( FrameSelector
& rFrameSel
, FrameBorderType eBorder
);
71 virtual ~AccFrameSelector();
74 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleContext
> SAL_CALL
getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException
);
77 virtual sal_Int32 SAL_CALL
getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException
);
78 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
getAccessibleChild( sal_Int32 i
) throw (::com::sun::star::uno::RuntimeException
);
79 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException
);
80 virtual sal_Int32 SAL_CALL
getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException
);
81 virtual sal_Int16 SAL_CALL
getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException
);
82 virtual ::rtl::OUString SAL_CALL
getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException
);
83 virtual ::rtl::OUString SAL_CALL
getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException
);
84 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleRelationSet
> SAL_CALL
getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException
);
85 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleStateSet
> SAL_CALL
getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException
);
86 virtual ::com::sun::star::lang::Locale SAL_CALL
getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException
, ::com::sun::star::uno::RuntimeException
);
87 virtual void SAL_CALL
addPropertyChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
88 virtual void SAL_CALL
removePropertyChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
90 //XAccessibleComponent
91 virtual sal_Bool SAL_CALL
containsPoint( const ::com::sun::star::awt::Point
& aPoint
) throw (::com::sun::star::uno::RuntimeException
);
92 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
getAccessibleAtPoint( const ::com::sun::star::awt::Point
& aPoint
) throw (::com::sun::star::uno::RuntimeException
);
93 virtual ::com::sun::star::awt::Rectangle SAL_CALL
getBounds( ) throw (::com::sun::star::uno::RuntimeException
);
94 virtual ::com::sun::star::awt::Point SAL_CALL
getLocation( ) throw (::com::sun::star::uno::RuntimeException
);
95 virtual ::com::sun::star::awt::Point SAL_CALL
getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException
);
96 virtual ::com::sun::star::awt::Size SAL_CALL
getSize( ) throw (::com::sun::star::uno::RuntimeException
);
97 virtual sal_Bool SAL_CALL
isShowing( ) throw (::com::sun::star::uno::RuntimeException
);
98 virtual sal_Bool SAL_CALL
isVisible( ) throw (::com::sun::star::uno::RuntimeException
);
99 virtual sal_Bool SAL_CALL
isFocusTraversable( ) throw (::com::sun::star::uno::RuntimeException
);
100 virtual void SAL_CALL
addFocusListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XFocusListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
101 virtual void SAL_CALL
removeFocusListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XFocusListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
102 virtual void SAL_CALL
grabFocus( ) throw (::com::sun::star::uno::RuntimeException
);
103 virtual ::com::sun::star::uno::Any SAL_CALL
getAccessibleKeyBinding( ) throw (::com::sun::star::uno::RuntimeException
);
104 virtual sal_Int32 SAL_CALL
getForeground( ) throw (::com::sun::star::uno::RuntimeException
);
105 virtual sal_Int32 SAL_CALL
getBackground( ) throw (::com::sun::star::uno::RuntimeException
);
107 // XAccessibleEventBroadcaster
108 virtual void SAL_CALL
addEventListener ( const ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleEventListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
109 virtual void SAL_CALL
removeEventListener ( const ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleEventListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
112 virtual ::rtl::OUString SAL_CALL
getImplementationName( ) throw (::com::sun::star::uno::RuntimeException
);
113 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
);
114 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException
);
117 void NotifyFocusListeners(sal_Bool bGetFocus
);
120 DECL_LINK( WindowEventListener
, VclSimpleEvent
* );
122 virtual void ProcessWindowEvent( const VclWindowEvent
& rVclWindowEvent
);
124 void NotifyAccessibleEvent( const sal_Int16 _nEventId
,
125 const ::com::sun::star::uno::Any
& _rOldValue
,
126 const ::com::sun::star::uno::Any
& _rNewValue
);
129 void IsValid() throw (::com::sun::star::uno::RuntimeException
);
131 FrameSelector
* mpFrameSel
;
132 ::osl::Mutex maFocusMutex
;
133 ::osl::Mutex maPropertyMutex
;
135 FrameBorderType meBorder
;
137 ::cppu::OInterfaceContainerHelper maFocusListeners
;
138 ::cppu::OInterfaceContainerHelper maPropertyListeners
;
140 ResStringArray maNames
;
141 ResStringArray maDescriptions
;
143 ::comphelper::AccessibleEventNotifier::TClientId mnClientId
;
146 // ============================================================================