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 #ifndef POINTER_EVENT_H 17 #define POINTER_EVENT_H 18 19 #include <array> 20 #include <list> 21 #include <memory> 22 #include <ostream> 23 #include <set> 24 #include <vector> 25 26 #include "input_event.h" 27 28 namespace OHOS { 29 namespace MMI { 30 class PointerEvent : public InputEvent { 31 public: 32 static constexpr int32_t POINTER_ACTION_UNKNOWN = 0; 33 static constexpr int32_t POINTER_ACTION_CANCEL = 1; 34 static constexpr int32_t POINTER_ACTION_DOWN = 2; 35 static constexpr int32_t POINTER_ACTION_MOVE = 3; 36 static constexpr int32_t POINTER_ACTION_UP = 4; 37 static constexpr int32_t POINTER_ACTION_AXIS_BEGIN = 5; 38 static constexpr int32_t POINTER_ACTION_AXIS_UPDATE = 6; 39 static constexpr int32_t POINTER_ACTION_AXIS_END = 7; 40 static constexpr int32_t POINTER_ACTION_BUTTON_DOWN = 8; 41 static constexpr int32_t POINTER_ACTION_BUTTON_UP = 9; 42 static constexpr int32_t POINTER_ACTION_ENTER_WINDOW = 10; 43 static constexpr int32_t POINTER_ACTION_LEAVE_WINDOW = 11; 44 GetPointerAction()45 int32_t GetPointerAction() const 46 { 47 return 0; 48 } 49 50 class PointerItem { 51 public: 52 int32_t pointerId_ {}; GetDisplayX()53 int32_t GetDisplayX() const 54 { 55 return 0; 56 } 57 GetDisplayY()58 int32_t GetDisplayY() const 59 { 60 return 0; 61 } 62 SetDisplayY(int32_t y)63 void SetDisplayY(int32_t y) 64 { 65 pointerId_ = y; 66 } 67 SetDisplayX(int32_t x)68 void SetDisplayX(int32_t x) 69 { 70 pointerId_ = x; 71 } 72 SetWindowY(int32_t y)73 void SetWindowY(int32_t y) 74 { 75 pointerId_ = y; 76 } 77 SetWindowX(int32_t x)78 void SetWindowX(int32_t x) 79 { 80 pointerId_ = x; 81 } 82 }; 83 GetPointerItem(int32_t pointerId,PointerItem & pointerItem)84 bool GetPointerItem(int32_t pointerId, PointerItem &pointerItem) 85 { 86 pointerItem = PointerItem(); 87 pointerItem.pointerId_ = pointerId; 88 return true; 89 } 90 UpdatePointerItem(int32_t pointerId,PointerItem & pointerItem)91 void UpdatePointerItem(int32_t pointerId, PointerItem &pointerItem) 92 { 93 pointerItem.pointerId_ = pointerId; 94 } 95 GetPointerId()96 int32_t GetPointerId() const 97 { 98 return 0; 99 } 100 }; 101 } // namespace MMI 102 } // namespace OHOS 103 #endif // POINTER_EVENT_H