1c29fa5a6Sopenharmony_ci/* 2c29fa5a6Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 3c29fa5a6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4c29fa5a6Sopenharmony_ci * you may not use this file except in compliance with the License. 5c29fa5a6Sopenharmony_ci * You may obtain a copy of the License at 6c29fa5a6Sopenharmony_ci * 7c29fa5a6Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8c29fa5a6Sopenharmony_ci * 9c29fa5a6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10c29fa5a6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11c29fa5a6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12c29fa5a6Sopenharmony_ci * See the License for the specific language governing permissions and 13c29fa5a6Sopenharmony_ci * limitations under the License. 14c29fa5a6Sopenharmony_ci */ 15c29fa5a6Sopenharmony_ci 16c29fa5a6Sopenharmony_ci#ifndef LIBINPUT_MOCK_H 17c29fa5a6Sopenharmony_ci#define LIBINPUT_MOCK_H 18c29fa5a6Sopenharmony_ci 19c29fa5a6Sopenharmony_ci#include <gmock/gmock.h> 20c29fa5a6Sopenharmony_ci 21c29fa5a6Sopenharmony_ci#include "libinput_interface.h" 22c29fa5a6Sopenharmony_ci 23c29fa5a6Sopenharmony_cinamespace OHOS { 24c29fa5a6Sopenharmony_cinamespace MMI { 25c29fa5a6Sopenharmony_ciclass LibinputInterfaceMock : public LibinputInterface { 26c29fa5a6Sopenharmony_cipublic: 27c29fa5a6Sopenharmony_ci LibinputInterfaceMock() = default; 28c29fa5a6Sopenharmony_ci virtual ~LibinputInterfaceMock() = default; 29c29fa5a6Sopenharmony_ci 30c29fa5a6Sopenharmony_ci MOCK_METHOD(enum libinput_event_type, GetEventType, (struct libinput_event *)); 31c29fa5a6Sopenharmony_ci MOCK_METHOD(struct libinput_device *, GetDevice, (struct libinput_event *)); 32c29fa5a6Sopenharmony_ci MOCK_METHOD(uint64_t, GetSensorTime, (struct libinput_event *)); 33c29fa5a6Sopenharmony_ci MOCK_METHOD(struct libinput_event_touch *, GetTouchEvent, (struct libinput_event *)); 34c29fa5a6Sopenharmony_ci MOCK_METHOD(struct libinput_event_tablet_tool *, GetTabletToolEvent, (struct libinput_event *)); 35c29fa5a6Sopenharmony_ci MOCK_METHOD(struct libinput_event_gesture *, GetGestureEvent, (struct libinput_event *)); 36c29fa5a6Sopenharmony_ci MOCK_METHOD(struct libinput_tablet_tool *, TabletToolGetTool, (struct libinput_event_tablet_tool *)); 37c29fa5a6Sopenharmony_ci MOCK_METHOD(enum libinput_tablet_tool_tip_state, TabletToolGetTipState, (struct libinput_event_tablet_tool *)); 38c29fa5a6Sopenharmony_ci MOCK_METHOD(enum libinput_tablet_tool_type, TabletToolGetType, (struct libinput_tablet_tool *)); 39c29fa5a6Sopenharmony_ci MOCK_METHOD(enum libinput_pointer_axis_source, GetAxisSource, (struct libinput_event_pointer *)); 40c29fa5a6Sopenharmony_ci MOCK_METHOD(struct libinput_event_pointer*, LibinputGetPointerEvent, (struct libinput_event *)); 41c29fa5a6Sopenharmony_ci MOCK_METHOD(int32_t, TabletToolGetToolType, (struct libinput_event_tablet_tool *)); 42c29fa5a6Sopenharmony_ci MOCK_METHOD(double, TabletToolGetTiltX, (struct libinput_event_tablet_tool *)); 43c29fa5a6Sopenharmony_ci MOCK_METHOD(double, TabletToolGetTiltY, (struct libinput_event_tablet_tool *)); 44c29fa5a6Sopenharmony_ci MOCK_METHOD(uint64_t, TabletToolGetTimeUsec, (struct libinput_event_tablet_tool *)); 45c29fa5a6Sopenharmony_ci MOCK_METHOD(double, TabletToolGetPressure, (struct libinput_event_tablet_tool *)); 46c29fa5a6Sopenharmony_ci MOCK_METHOD(uint64_t, TouchEventGetTime, (struct libinput_event_touch *)); 47c29fa5a6Sopenharmony_ci MOCK_METHOD(int32_t, TouchEventGetSeatSlot, (struct libinput_event_touch *)); 48c29fa5a6Sopenharmony_ci MOCK_METHOD(double, TouchEventGetPressure, (struct libinput_event_touch *)); 49c29fa5a6Sopenharmony_ci MOCK_METHOD(int32_t, TouchEventGetMoveFlag, (struct libinput_event_touch *)); 50c29fa5a6Sopenharmony_ci MOCK_METHOD(int32_t, TouchEventGetContactLongAxis, (struct libinput_event_touch *)); 51c29fa5a6Sopenharmony_ci MOCK_METHOD(int32_t, TouchEventGetContactShortAxis, (struct libinput_event_touch *)); 52c29fa5a6Sopenharmony_ci MOCK_METHOD(int32_t, TouchEventGetToolType, (struct libinput_event_touch *)); 53c29fa5a6Sopenharmony_ci MOCK_METHOD(int, TouchEventGetBtnToolTypeDown, (struct libinput_device *, int32_t)); 54c29fa5a6Sopenharmony_ci MOCK_METHOD(uint32_t, GestureEventGetTime, (struct libinput_event_gesture *)); 55c29fa5a6Sopenharmony_ci MOCK_METHOD(int, GestureEventGetFingerCount, (struct libinput_event_gesture *)); 56c29fa5a6Sopenharmony_ci MOCK_METHOD(int, GestureEventGetDevCoordsX, (struct libinput_event_gesture *, uint32_t)); 57c29fa5a6Sopenharmony_ci MOCK_METHOD(int, GestureEventGetDevCoordsY, (struct libinput_event_gesture *, uint32_t)); 58c29fa5a6Sopenharmony_ci MOCK_METHOD(uint32_t, PointerEventGetFingerCount, (struct libinput_event_pointer *)); 59c29fa5a6Sopenharmony_ci MOCK_METHOD(double, PointerGetDxUnaccelerated, (struct libinput_event_pointer *)); 60c29fa5a6Sopenharmony_ci MOCK_METHOD(double, PointerGetDyUnaccelerated, (struct libinput_event_pointer *)); 61c29fa5a6Sopenharmony_ci MOCK_METHOD(uint32_t, PointerGetButton, (struct libinput_event_pointer *)); 62c29fa5a6Sopenharmony_ci MOCK_METHOD(int, PointerHasAxis, (struct libinput_event_pointer *, enum libinput_pointer_axis)); 63c29fa5a6Sopenharmony_ci MOCK_METHOD(double, PointerGetAxisValue, (struct libinput_event_pointer *, enum libinput_pointer_axis)); 64c29fa5a6Sopenharmony_ci MOCK_METHOD(struct libinput_event_touch *, GetTouchpadEvent, (struct libinput_event *)); 65c29fa5a6Sopenharmony_ci MOCK_METHOD(int32_t, TouchpadGetTool, (struct libinput_event_touch *)); 66c29fa5a6Sopenharmony_ci MOCK_METHOD(char*, DeviceGetName, (struct libinput_device *)); 67c29fa5a6Sopenharmony_ci MOCK_METHOD(struct libinput_event_keyboard*, LibinputEventGetKeyboardEvent, (struct libinput_event *)); 68c29fa5a6Sopenharmony_ci MOCK_METHOD(uint32_t, LibinputEventKeyboardGetKey, (struct libinput_event_keyboard *)); 69c29fa5a6Sopenharmony_ci MOCK_METHOD(enum libinput_key_state, LibinputEventKeyboardGetKeyState, (struct libinput_event_keyboard *)); 70c29fa5a6Sopenharmony_ci}; 71c29fa5a6Sopenharmony_ci} // namespace MMI 72c29fa5a6Sopenharmony_ci} // namespace OHOS 73c29fa5a6Sopenharmony_ci#endif // LIBINPUT_MOCK_H 74