• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 #ifndef UPDATER_UI_INPUT_EVENT_H
16 #define UPDATER_UI_INPUT_EVENT_H
17 #include <linux/input.h>
18 #include "dock/key_input_device.h"
19 #include "dock/pointer_input_device.h"
20 #include "input_manager.h"
21 #include "macros.h"
22 
23 namespace Updater {
24 class TouchInputDevice : public OHOS::PointerInputDevice {
25     DISALLOW_COPY_MOVE(TouchInputDevice);
26 public:
27     TouchInputDevice() = default;
28     virtual ~TouchInputDevice() = default;
29     static TouchInputDevice &GetInstance();
30     bool Read(OHOS::DeviceData &data) override;
31 };
32 
33 class KeysInputDevice : public OHOS::KeyInputDevice {
34     DISALLOW_COPY_MOVE(KeysInputDevice);
35 public:
36     KeysInputDevice() = default;
37     virtual ~KeysInputDevice() = default;
38     static KeysInputDevice &GetInstance();
39     bool Read(OHOS::DeviceData &data) override;
40 };
41 
42 int HandleInputEvent(const struct input_event *iev);
43 void ReportEventPkgCallback(const InputEventPackage **pkgs, const uint32_t count, uint32_t devIndex);
44 int HdfInit();
45 } // namespace Updater
46 #endif // UPDATER_UI_INPUT_EVENT_H
47