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 #include <com/sun/star/accessibility/XAccessible.hpp>
23 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
24 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
25 #include <com/sun/star/accessibility/AccessibleRole.hpp>
26 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
27 
28 #include "AccTextComponentEventListener.hxx"
29 #include "AccObjectManagerAgent.hxx"
30 #include "unomsaaevent.hxx"
31 
32 using namespace com::sun::star::uno;
33 using namespace com::sun::star::accessibility;
34 
AccTextComponentEventListener(com::sun::star::accessibility::XAccessible * pAcc,AccObjectManagerAgent * Agent)35 AccTextComponentEventListener::AccTextComponentEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent)
36         :AccComponentEventListener(pAcc, Agent)
37 {}
~AccTextComponentEventListener()38 AccTextComponentEventListener::~AccTextComponentEventListener()
39 {
40 }
41 
42 /**
43  *	set the new state and fire the MSAA event
44  *	@param state	new state id
45  *	@param enable	true if state is set, false if state is unset
46  */
setComponentState(short state,bool enable)47 void AccTextComponentEventListener::setComponentState(short state, bool enable )
48 {
49     // only the following state can be fired state event.
50     switch (state)
51     {
52     case AccessibleStateType::EDITABLE:
53         // no msaa state mapping
54         break;
55     case AccessibleStateType::MULTI_LINE:
56         // no msaa state mapping
57         break;
58     case AccessibleStateType::SINGLE_LINE:
59         // no msaa state mapping
60         break;
61     default:
62         AccComponentEventListener::setComponentState(state, enable);
63         break;
64     }
65 }
66