• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 VIRTUAL_TOUCHSCREEN_BUILDER_H
17 #define VIRTUAL_TOUCHSCREEN_BUILDER_H
18 
19 #include <memory>
20 
21 #include <nlohmann/json.hpp>
22 
23 #include "virtual_device_builder.h"
24 
25 namespace OHOS {
26 namespace Msdp {
27 namespace DeviceStatus {
28 class VirtualTouchScreenBuilder final : public VirtualDeviceBuilder {
29 public:
30     VirtualTouchScreenBuilder();
31     ~VirtualTouchScreenBuilder() = default;
32     DISALLOW_COPY_AND_MOVE(VirtualTouchScreenBuilder);
33 
34     static std::string GetDeviceName();
35     static void ShowUsage();
36     static void Mount();
37     static void Unmount();
38     static void Clone();
39     static void Monitor();
40     static void Act(int32_t argc, char *argv[]);
41 
42 private:
43     static void ReadDownAction(int32_t argc, char *argv[]);
44     static void ReadMoveAction(int32_t argc, char *argv[]);
45     static void ReadUpAction();
46     static void ReadMoveToAction(int32_t argc, char *argv[]);
47     static void ReadDragToAction(int32_t argc, char *argv[]);
48     static void ReadActions(const char *path);
49     static void ReadModel(const nlohmann::json &model, int32_t level);
50     static void ReadAction(const nlohmann::json &model);
51     static void HandleDown(const nlohmann::json &model);
52     static void HandleMove(const nlohmann::json &model);
53     static void HandleUp(const nlohmann::json &model);
54     static void HandleMoveTo(const nlohmann::json &model);
55     static void HandleWait(const nlohmann::json &model);
56     static void ReadRawInput(const char *path);
57     static void ReadRawModel(const nlohmann::json &model, int32_t level);
58     static void ReadRawData(const nlohmann::json &model);
59 };
60 } // namespace DeviceStatus
61 } // namespace Msdp
62 } // namespace OHOS
63 #endif  // VIRTUAL_TOUCHSCREEN_BUILDER_H