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 // AccObjectContainerEventListener.cpp: implementation of the AccContainerEventListener class.
23 //
24 //////////////////////////////////////////////////////////////////////
25 
26 #include <com/sun/star/accessibility/XAccessible.hpp>
27 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
28 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
29 #include <com/sun/star/accessibility/AccessibleRole.hpp>
30 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
31 
32 #include "AccObjectContainerEventListener.hxx"
33 #include "AccObjectManagerAgent.hxx"
34 #include "unomsaaevent.hxx"
35 
36 using namespace com::sun::star::uno;
37 using namespace com::sun::star::accessibility;
38 
AccObjectContainerEventListener(com::sun::star::accessibility::XAccessible * pAcc,AccObjectManagerAgent * Agent)39 AccObjectContainerEventListener::AccObjectContainerEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent)
40         :AccContainerEventListener(pAcc, Agent)
41 {}
~AccObjectContainerEventListener()42 AccObjectContainerEventListener::~AccObjectContainerEventListener()
43 {
44 }
45 
46 /**
47  *	handle the STATE_CHANGED event
48  */
handleStateChangedEvent(Any oldValue,Any newValue)49 void AccObjectContainerEventListener::handleStateChangedEvent(Any oldValue, Any newValue)
50 {
51     //set the accessible name before process for there is no NAME_CHANGED event when change
52     //the text in drawing objects.
53     short newV;
54     if( newValue >>= newV)
55     {
56         if (newV == AccessibleStateType::FOCUSED)
57         {
58             pAgent->UpdateAccName(pAccessible);
59 
60             pAgent->UpdateDescription(pAccessible);
61         }
62     }
63     AccContainerEventListener::handleStateChangedEvent(oldValue, newValue);
64 }
65 /**
66  *	handle the VISIBLE_DATA_CHANGED event
67  *  For SHAPES, the visiable_data_changed event should be mapped to LOCATION_CHANGED event
68   */
handleVisibleDataChangedEvent()69 void AccObjectContainerEventListener::handleVisibleDataChangedEvent()
70 {
71     AccContainerEventListener::handleBoundrectChangedEvent();
72 }
73