13334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
33334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
43334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
53334a7e6SAndrew Rist  * distributed with this work for additional information
63334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
73334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
83334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
93334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
103334a7e6SAndrew Rist  *
113334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
123334a7e6SAndrew Rist  *
133334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
143334a7e6SAndrew Rist  * software distributed under the License is distributed on an
153334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
163334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
173334a7e6SAndrew Rist  * specific language governing permissions and limitations
183334a7e6SAndrew Rist  * under the License.
193334a7e6SAndrew Rist  *
203334a7e6SAndrew Rist  *************************************************************/
213334a7e6SAndrew Rist 
223334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SVX_ACCESSIBLEFRAMESELECTOR_HXX
25cdf0e10cSrcweir #define SVX_ACCESSIBLEFRAMESELECTOR_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
28cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyChangeListener.hpp>
29cdf0e10cSrcweir #include <com/sun/star/awt/XFocusListener.hpp>
30cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessible.hpp>
31cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleContext.hpp>
32cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
33cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
34cdf0e10cSrcweir #include <tools/resary.hxx>
35cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx>
36cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.hxx>
37cdf0e10cSrcweir #include <comphelper/accessibleeventnotifier.hxx>
38cdf0e10cSrcweir #include <svx/framebordertype.hxx>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir class VclSimpleEvent;
41cdf0e10cSrcweir class VclWindowEvent;
42cdf0e10cSrcweir 
43cdf0e10cSrcweir namespace svx {
44cdf0e10cSrcweir 
45cdf0e10cSrcweir class FrameSelector;
46cdf0e10cSrcweir 
47cdf0e10cSrcweir namespace a11y {
48cdf0e10cSrcweir 
49cdf0e10cSrcweir // ============================================================================
50cdf0e10cSrcweir 
51cdf0e10cSrcweir class AccFrameSelector :
52cdf0e10cSrcweir     public ::cppu::WeakImplHelper5<
53cdf0e10cSrcweir 				::com::sun::star::accessibility::XAccessible,
54cdf0e10cSrcweir                 ::com::sun::star::accessibility::XAccessibleContext,
55cdf0e10cSrcweir                 ::com::sun::star::accessibility::XAccessibleComponent,
56cdf0e10cSrcweir                 ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
57cdf0e10cSrcweir                 ::com::sun::star::lang::XServiceInfo
58cdf0e10cSrcweir                 >,
59cdf0e10cSrcweir     public Resource
60cdf0e10cSrcweir {
61cdf0e10cSrcweir public:
62cdf0e10cSrcweir     explicit            AccFrameSelector( FrameSelector& rFrameSel, FrameBorderType eBorder );
63cdf0e10cSrcweir 
64cdf0e10cSrcweir     virtual             ~AccFrameSelector();
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     //XAccessible
67cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException);
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     //XAccessibleContext
70cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
71cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::uno::RuntimeException);
72cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent(  ) throw (::com::sun::star::uno::RuntimeException);
73cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(  ) throw (::com::sun::star::uno::RuntimeException);
74cdf0e10cSrcweir     virtual sal_Int16 SAL_CALL getAccessibleRole(  ) throw (::com::sun::star::uno::RuntimeException);
75cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getAccessibleDescription(  ) throw (::com::sun::star::uno::RuntimeException);
76cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getAccessibleName(  ) throw (::com::sun::star::uno::RuntimeException);
77cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException);
78cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet(  ) throw (::com::sun::star::uno::RuntimeException);
79cdf0e10cSrcweir     virtual ::com::sun::star::lang::Locale SAL_CALL getLocale(  ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
80cdf0e10cSrcweir     virtual void SAL_CALL addPropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir     virtual void SAL_CALL removePropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     //XAccessibleComponent
84cdf0e10cSrcweir     virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
85cdf0e10cSrcweir     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);
86cdf0e10cSrcweir     virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds(  ) throw (::com::sun::star::uno::RuntimeException);
87cdf0e10cSrcweir     virtual ::com::sun::star::awt::Point SAL_CALL getLocation(  ) throw (::com::sun::star::uno::RuntimeException);
88cdf0e10cSrcweir     virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen(  ) throw (::com::sun::star::uno::RuntimeException);
89cdf0e10cSrcweir     virtual ::com::sun::star::awt::Size SAL_CALL getSize(  ) throw (::com::sun::star::uno::RuntimeException);
90cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isShowing(  ) throw (::com::sun::star::uno::RuntimeException);
91cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isVisible(  ) throw (::com::sun::star::uno::RuntimeException);
92cdf0e10cSrcweir     virtual sal_Bool SAL_CALL isFocusTraversable(  ) throw (::com::sun::star::uno::RuntimeException);
93cdf0e10cSrcweir     virtual void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
94cdf0e10cSrcweir     virtual void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
95cdf0e10cSrcweir     virtual void SAL_CALL grabFocus(  ) throw (::com::sun::star::uno::RuntimeException);
96cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding(  ) throw (::com::sun::star::uno::RuntimeException);
97cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getForeground(  ) throw (::com::sun::star::uno::RuntimeException);
98cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getBackground(  ) throw (::com::sun::star::uno::RuntimeException);
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     // XAccessibleEventBroadcaster
101cdf0e10cSrcweir     virtual void SAL_CALL addEventListener ( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener) throw (::com::sun::star::uno::RuntimeException);
102cdf0e10cSrcweir     virtual void SAL_CALL removeEventListener ( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener) throw (::com::sun::star::uno::RuntimeException);
103cdf0e10cSrcweir 
104cdf0e10cSrcweir     //XServiceInfo
105cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
106cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
107cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
108cdf0e10cSrcweir 
109cdf0e10cSrcweir     void    Invalidate();
110cdf0e10cSrcweir     void    NotifyFocusListeners(sal_Bool bGetFocus);
111*9b8096d0SSteve Yin 	void    NotifyAccessibleEvent( const sal_Int16 _nEventId, const ::com::sun::star::uno::Any& _rOldValue, const ::com::sun::star::uno::Any& _rNewValue );
112cdf0e10cSrcweir 
113cdf0e10cSrcweir protected:
114cdf0e10cSrcweir     DECL_LINK( WindowEventListener, VclSimpleEvent* );
115cdf0e10cSrcweir 
116cdf0e10cSrcweir     virtual void    ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
117cdf0e10cSrcweir 
118cdf0e10cSrcweir private:
119cdf0e10cSrcweir     void                IsValid() throw (::com::sun::star::uno::RuntimeException);
120cdf0e10cSrcweir 
121cdf0e10cSrcweir     FrameSelector*      mpFrameSel;
122cdf0e10cSrcweir     ::osl::Mutex        maFocusMutex;
123cdf0e10cSrcweir     ::osl::Mutex        maPropertyMutex;
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     FrameBorderType     meBorder;
126cdf0e10cSrcweir 
127cdf0e10cSrcweir     ::cppu::OInterfaceContainerHelper maFocusListeners;
128cdf0e10cSrcweir     ::cppu::OInterfaceContainerHelper maPropertyListeners;
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     ResStringArray      maNames;
131cdf0e10cSrcweir     ResStringArray      maDescriptions;
132cdf0e10cSrcweir 
133cdf0e10cSrcweir     ::comphelper::AccessibleEventNotifier::TClientId    mnClientId;
134cdf0e10cSrcweir };
135cdf0e10cSrcweir 
136cdf0e10cSrcweir // ============================================================================
137cdf0e10cSrcweir 
138cdf0e10cSrcweir } // namespace a11y
139cdf0e10cSrcweir } // namespace svx
140cdf0e10cSrcweir 
141cdf0e10cSrcweir #endif
142cdf0e10cSrcweir 
143