xref: /aoo4110/main/vcl/unx/gtk/a11y/atklistener.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _ATK_LISTENER_HXX_
25 #define _ATK_LISTENER_HXX_
26 
27 #include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
28 #include <cppuhelper/implbase1.hxx>
29 
30 #include <vector>
31 
32 #include "atkwrapper.hxx"
33 
34 typedef std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > AccessibleVector;
35 
36 class AtkListener : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleEventListener >
37 {
38 public:
39     AtkListener(AtkObjectWrapper * pWrapper);
40 
41     // XEventListener
42     virtual void disposing( const ::com::sun::star::lang::EventObject& Source )
43         throw (::com::sun::star::uno::RuntimeException);
44 
45     // XAccessibleEventListener
46     virtual void notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
47         throw( ::com::sun::star::uno::RuntimeException );
48 
49     AtkObjectWrapper *mpWrapper;
50     AccessibleVector m_aChildList;
51 
52 private:
53 
54     virtual ~AtkListener();
55 
56     // Updates the child list held to provide the old IndexInParent on children_changed::remove
57     void updateChildList(::com::sun::star::accessibility::XAccessibleContext* pContext);
58 
59     // Process CHILD_EVENT notifications with a new child added
60     void handleChildAdded(
61         const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent,
62         const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxChild);
63 
64     // Process CHILD_EVENT notifications with a child removed
65     void handleChildRemoved(
66         const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent,
67         const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxChild);
68 
69     // Process INVALIDATE_ALL_CHILDREN notification
70     void handleInvalidateChildren(
71         const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent);
72 };
73 
74 #endif /* _ATK_LISTENER_HXX_ */
75 
76