bump product version to 4.1.6.2
[LibreOffice.git] / svx / source / inc / AccessibleFrameSelector.hxx
blob70d5c3e1296b84cc339fff16e59e48d2c1abaa55
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SVX_ACCESSIBLEFRAMESELECTOR_HXX
21 #define SVX_ACCESSIBLEFRAMESELECTOR_HXX
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
25 #include <com/sun/star/awt/XFocusListener.hpp>
26 #include <com/sun/star/accessibility/XAccessible.hpp>
27 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
28 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
29 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
30 #include <tools/link.hxx>
31 #include <tools/resary.hxx>
32 #include <tools/rc.hxx>
33 #include <cppuhelper/implbase5.hxx>
34 #include <cppuhelper/interfacecontainer.hxx>
35 #include <comphelper/accessibleeventnotifier.hxx>
36 #include <svx/framebordertype.hxx>
38 class VclSimpleEvent;
39 class VclWindowEvent;
41 namespace svx {
43 class FrameSelector;
45 namespace a11y {
47 // ============================================================================
49 class AccFrameSelector :
50 public ::cppu::WeakImplHelper5<
51 ::com::sun::star::accessibility::XAccessible,
52 ::com::sun::star::accessibility::XAccessibleContext,
53 ::com::sun::star::accessibility::XAccessibleComponent,
54 ::com::sun::star::accessibility::XAccessibleEventBroadcaster,
55 ::com::sun::star::lang::XServiceInfo
57 public Resource
59 public:
60 explicit AccFrameSelector( FrameSelector& rFrameSel, FrameBorderType eBorder );
62 virtual ~AccFrameSelector();
64 //XAccessible
65 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException);
67 //XAccessibleContext
68 virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
69 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::uno::RuntimeException);
70 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException);
71 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException);
72 virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException);
73 virtual OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException);
74 virtual OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException);
75 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException);
76 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException);
77 virtual ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
78 virtual void SAL_CALL addPropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
79 virtual void SAL_CALL removePropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
81 //XAccessibleComponent
82 virtual sal_Bool SAL_CALL containsPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
83 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);
84 virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) throw (::com::sun::star::uno::RuntimeException);
85 virtual ::com::sun::star::awt::Point SAL_CALL getLocation( ) throw (::com::sun::star::uno::RuntimeException);
86 virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException);
87 virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException);
88 virtual sal_Bool SAL_CALL isShowing( ) throw (::com::sun::star::uno::RuntimeException);
89 virtual sal_Bool SAL_CALL isVisible( ) throw (::com::sun::star::uno::RuntimeException);
90 virtual sal_Bool SAL_CALL isFocusTraversable( ) throw (::com::sun::star::uno::RuntimeException);
91 virtual void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
92 virtual void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
93 virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException);
94 virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding( ) throw (::com::sun::star::uno::RuntimeException);
95 virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException);
96 virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException);
98 // XAccessibleEventBroadcaster
99 virtual void SAL_CALL addAccessibleEventListener ( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener) throw (::com::sun::star::uno::RuntimeException);
100 virtual void SAL_CALL removeAccessibleEventListener ( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleEventListener >& xListener) throw (::com::sun::star::uno::RuntimeException);
102 //XServiceInfo
103 virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
104 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
105 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
107 void Invalidate();
108 void NotifyFocusListeners(sal_Bool bGetFocus);
110 protected:
111 DECL_LINK( WindowEventListener, VclSimpleEvent* );
113 virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
115 void NotifyAccessibleEvent( const sal_Int16 _nEventId,
116 const ::com::sun::star::uno::Any& _rOldValue,
117 const ::com::sun::star::uno::Any& _rNewValue );
119 private:
120 void IsValid() throw (::com::sun::star::uno::RuntimeException);
121 void RemoveFrameSelEventListener();
123 FrameSelector* mpFrameSel;
124 ::osl::Mutex maFocusMutex;
125 ::osl::Mutex maPropertyMutex;
127 FrameBorderType meBorder;
129 ::cppu::OInterfaceContainerHelper maFocusListeners;
130 ::cppu::OInterfaceContainerHelper maPropertyListeners;
132 ResStringArray maNames;
133 ResStringArray maDescriptions;
135 ::comphelper::AccessibleEventNotifier::TClientId mnClientId;
138 // ============================================================================
140 } // namespace a11y
141 } // namespace svx
143 #endif
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */