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 #ifndef __ACCCONTAINEREVENTLISTENERHXX
23 #define __ACCCONTAINEREVENTLISTENERHXX
24 
25 #include <stdio.h>
26 #include "AccEventListener.hxx"
27 #include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
28 #include <com/sun/star/accessibility/XAccessible.hpp>
29 
30 using namespace ::com::sun::star::uno;
31 
32 /**
33  * AccContainerEventListener is inherited from AccEventListener. It handles the evnets
34  * generated by container controls. The accessible roles are: CANVAS, COMBO_BOX, DOCUMENT,
35  * EMBEDDED_OBJECT, END_NOTE, FILLER, FOOTNOTE, FOOTER, GRAPHIC, HEADER, LAYERED_PANE,
36  * MENU_BAR, POPUP_MENU, OPTION_PANE, PAGE_TAB, PAGE_TAB_LIST, PANEL, SCROLL_PANE, SPLIT_PANE,
37  * STATUS_BAR, TABLE_CELL, TEXT_FRAME, TOOL_BAR, VIEW_PORT.
38  * It defines the procedure of specific event handling related with containsers and provides
39  * the detailed support for some related methods.
40  */
41 class AccContainerEventListener: public AccEventListener
42 {
43 public:
44     AccContainerEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
45     virtual ~AccContainerEventListener();
46 
47     //AccessibleEventListener
48     virtual void SAL_CALL notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
49 
50     //for child changed event
51     virtual void SAL_CALL handleChildChangedEvent(Any oldValue, Any newValue);
52 
53     //for selection changed event
54     virtual void SAL_CALL handleSelectionChangedEvent(const Any &oldValue, const Any &newValue);
55 
56     //for all children changed event
57     virtual void SAL_CALL handleAllChildrenChangedEvent();
58 
59     //for text changed event
60     virtual void SAL_CALL handleTextChangedEvent(Any oldValue, Any newValue);
61     virtual void SAL_CALL handleStateChangedEvent(Any oldValue, Any newValue);
62 
63     //for visible data changed event
64     virtual void SAL_CALL handleVisibleDataChangedEvent();
65 
66     //for bound rect changed event
67     virtual void SAL_CALL handleBoundrectChangedEvent();
68 
69     //for value changed event
70     virtual void SAL_CALL handleValueChangedEvent(Any oldValue, Any newValue);
71 
72     //state changed
73     virtual void SAL_CALL setComponentState(short state, bool enable);
74     virtual void SAL_CALL fireStatePropertyChange(short state, bool set
75                                                      );
76     virtual void SAL_CALL fireStateFocusdChange(bool enable);
77     virtual bool SAL_CALL IsEditable(Reference<com::sun::star::accessibility::XAccessibleContext> xContext);
78 
79     // update all children's state
80     void SAL_CALL UpdateAllChildrenState( com::sun::star::accessibility::XAccessible* pXAccessible );
81 
82     bool NotifyChildEvent(short nWinEvent,const Any &Value);
83 
84     virtual void handleSelectionChangedAddEvent(const Any &oldValue, const Any &newValue);
85     virtual void handleSelectionChangedRemoveEvent(const Any &oldValue, const Any &newValue);
86     virtual void handleSelectionChangedWithinEvent(const Any &oldValue, const Any &newValue);
87 
88     virtual void handlePageChangedEvent (const Any &oldValue, const Any &newValue);
89 
90     virtual void handleSectionChangedEvent (const Any &oldValue, const Any &newValue);
91     virtual void handleColumnChangedEvent (const Any &oldValue, const Any &newValue);
92 	//for name changed event
93     virtual void SAL_CALL handleNameChangedEvent(Any name);
94 };
95 
96 #endif
97