xref: /trunk/main/vcl/unx/gtk/a11y/atklistener.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _ATK_LISTENER_HXX_
29 #define _ATK_LISTENER_HXX_
30 
31 #include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
32 #include <cppuhelper/implbase1.hxx>
33 
34 #include <vector>
35 
36 #include "atkwrapper.hxx"
37 
38 typedef std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > AccessibleVector;
39 
40 class AtkListener : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleEventListener >
41 {
42 public:
43     AtkListener(AtkObjectWrapper * pWrapper);
44 
45     // XEventListener
46     virtual void disposing( const ::com::sun::star::lang::EventObject& Source )
47         throw (::com::sun::star::uno::RuntimeException);
48 
49     // XAccessibleEventListener
50     virtual void notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
51         throw( ::com::sun::star::uno::RuntimeException );
52 
53     AtkObjectWrapper *mpWrapper;
54     AccessibleVector m_aChildList;
55 
56 private:
57 
58     virtual ~AtkListener();
59 
60     // Updates the child list held to provide the old IndexInParent on children_changed::remove
61     void updateChildList(::com::sun::star::accessibility::XAccessibleContext* pContext);
62 
63     // Process CHILD_EVENT notifications with a new child added
64     void handleChildAdded(
65         const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent,
66         const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxChild);
67 
68     // Process CHILD_EVENT notifications with a child removed
69     void handleChildRemoved(
70         const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent,
71         const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxChild);
72 
73     // Process INVALIDATE_ALL_CHILDREN notification
74     void handleInvalidateChildren(
75         const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent);
76 };
77 
78 #endif /* _ATK_LISTENER_HXX_ */
79 
80