Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / svx / source / inc / AccessibleFrameSelector.hxx
blob3204b62ce84c070baa0df8edc4fb3f01ebcee324
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef SVX_ACCESSIBLEFRAMESELECTOR_HXX
30 #define SVX_ACCESSIBLEFRAMESELECTOR_HXX
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
34 #include <com/sun/star/awt/XFocusListener.hpp>
35 #include <com/sun/star/accessibility/XAccessible.hpp>
36 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
37 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
38 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
39 #include <tools/link.hxx>
40 #include <tools/resary.hxx>
41 #include <tools/rc.hxx>
42 #include <cppuhelper/implbase5.hxx>
43 #include <cppuhelper/interfacecontainer.hxx>
44 #include <comphelper/accessibleeventnotifier.hxx>
45 #include <svx/framebordertype.hxx>
47 class VclSimpleEvent;
48 class VclWindowEvent;
50 namespace svx {
52 class FrameSelector;
54 namespace a11y {
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
66 public Resource
68 public:
69 explicit AccFrameSelector( FrameSelector& rFrameSel, FrameBorderType eBorder );
71 virtual ~AccFrameSelector();
73 //XAccessible
74 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException);
76 //XAccessibleContext
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);
111 //XServiceInfo
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);
116 void Invalidate();
117 void NotifyFocusListeners(sal_Bool bGetFocus);
119 protected:
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 );
128 private:
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 // ============================================================================
148 } // namespace a11y
149 } // namespace svx
151 #endif
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */