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 TEST_WUKONG_MULTIMODE_MANAGER_H 17 #define TEST_WUKONG_MULTIMODE_MANAGER_H 18 19 #include <iostream> 20 #include <string> 21 22 #include "input_manager.h" 23 #include "singleton.h" 24 #include "wukong_define.h" 25 26 namespace OHOS { 27 namespace WuKong { 28 class MultimodeManager : public DelayedSingleton<MultimodeManager> { 29 public: 30 MultimodeManager(); 31 virtual ~MultimodeManager(); 32 33 /** 34 * @brief the function of pointer input. 35 * @param x x coordinate. 36 * @param y y coordinate. 37 * @param pointertype pointer type,refer to [AxisType]. 38 * @param actiontype action type. 39 * @return Return ERR_OK on success, others on failure. 40 */ 41 ErrCode PointerInput(int x, int y, int pointertype, int actiontype); 42 43 /** 44 * @brief input single keycode. 45 * @param keycode keycode type. 46 * @param downtime pressed time. 47 * @return Return ERR_OK on success, others on failure. 48 */ 49 ErrCode SingleKeyCodeInput(int keycode, int downtime); 50 51 /** 52 * @brief get the list of valid keycode. 53 * @param keycodelist the list of valid keycode. 54 */ 55 void GetKeycodeList(std::vector<int> &keycodelist); 56 57 /** 58 * @brief input multiple keycodes randomly. 59 * @param downtime pressed time. 60 * @return Return ERR_OK on success, others on failure. 61 */ 62 ErrCode MultiKeyCodeInput(int downtime); 63 64 /** 65 * @brief segmented input swap event 66 * @param xSrcPosition the x coordinate of the start of the swap 67 * @param ySrcPosition the y coordinate of the start of the swap 68 * @param xDstPosition the x coordinate of the end of the swap 69 * @param yDstPosition the y coordinate of the end of the swap 70 * @return Return ERR_OK on success, others on failure. 71 */ 72 ErrCode IntervalSwap(int xSrcPosition, int ySrcPosition, int xDstPosition, int yDstPosition); 73 74 private: 75 // keycodelist 76 std::vector<int> keycodelist_; 77 }; 78 } // namespace WuKong 79 } // namespace OHOS 80 #endif 81