1 /*
2  * Copyright (C) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <gtest/gtest.h>
17 #include "accessibility_event_transmission.h"
18 #include "accessibility_ut_helper.h"
19 #include "hilog_wrapper.h"
20 
21 namespace OHOS {
22 namespace Accessibility {
OnPointerEvent(MMI::PointerEvent & event)23 bool EventTransmission::OnPointerEvent(MMI::PointerEvent& event)
24 {
25     HILOG_DEBUG();
26     int32_t touchAction = event.GetPointerAction();
27     AccessibilityAbilityHelper::GetInstance().SetTouchEventActionVectors(touchAction);
28     GTEST_LOG_(INFO) << "##########EventTransmission OnPointerEvent touchAction=" << touchAction;
29     return false;
30 }
31 
OnKeyEvent(MMI::KeyEvent & event)32 bool EventTransmission::OnKeyEvent(MMI::KeyEvent& event)
33 {
34     AccessibilityAbilityHelper::GetInstance().SetKeyCode(event.GetKeyCode());
35     return false;
36 }
37 
OnMoveMouse(int32_t offsetX,int32_t offsetY)38 void EventTransmission::OnMoveMouse(int32_t offsetX, int32_t offsetY)
39 {
40     (void)offsetX;
41     (void)offsetY;
42 }
43 
DestroyEvents()44 void EventTransmission::DestroyEvents()
45 {
46     AccessibilityAbilityHelper::GetInstance().SetDestroyState();
47 }
48 
SetNext(const sptr<EventTransmission> & next)49 void EventTransmission::SetNext(const sptr<EventTransmission> &next)
50 {
51     HILOG_DEBUG();
52     next_ = next;
53 }
54 
GetNext()55 sptr<EventTransmission> EventTransmission::GetNext()
56 {
57     HILOG_DEBUG();
58     return next_;
59 }
60 } // namespace Accessibility
61 } // namespace OHOS