• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 OHOS_HDI_INPUT_V1_0_INPUTINTERFACEIMPL_H
17 #define OHOS_HDI_INPUT_V1_0_INPUTINTERFACEIMPL_H
18 
19 #include "input_manager.h"
20 #include "v1_0/iinput_interfaces.h"
21 
22 namespace OHOS {
23 namespace HDI {
24 namespace Input {
25 namespace V1_0 {
26 class InputInterfacesImpl : public IInputInterfaces {
27 public:
InputInterfacesImpl()28     InputInterfacesImpl(): inputInterface_(NULL) {}
~InputInterfacesImpl()29     virtual ~InputInterfacesImpl()
30     {
31         ReleaseInputInterface(&inputInterface_);
32     }
33     void Init();
34     int32_t ScanInputDevice(std::vector<DevDesc> &staArr) override;
35     int32_t OpenInputDevice(uint32_t devIndex) override;
36     int32_t CloseInputDevice(uint32_t devIndex) override;
37     int32_t GetInputDevice(uint32_t devIndex, DeviceInfo &devInfo) override;
38     int32_t GetInputDeviceList(uint32_t &devNum, std::vector<DeviceInfo> &devList, uint32_t size) override;
39     int32_t SetPowerStatus(uint32_t devIndex, uint32_t status) override;
40     int32_t GetPowerStatus(uint32_t devIndex, uint32_t &status) override;
41     int32_t GetDeviceType(uint32_t devIndex, uint32_t &deviceType) override;
42     int32_t GetChipInfo(uint32_t devIndex, std::string &chipInfo) override;
43     int32_t GetVendorName(uint32_t devIndex, std::string &vendorName) override;
44     int32_t GetChipName(uint32_t devIndex, std::string &chipName) override;
45     int32_t SetGestureMode(uint32_t devIndex, uint32_t gestureMode) override;
46     int32_t RunCapacitanceTest(uint32_t devIndex, uint32_t testType, std::string &result,
47         uint32_t length) override;
48     int32_t RunExtraCommand(uint32_t devIndex, const ExtraCmd &cmd) override;
49     int32_t RegisterReportCallback(uint32_t devIndex, const sptr<IInputCallback> &eventPkgCallback) override;
50     int32_t UnregisterReportCallback(uint32_t devIndex) override;
51     int32_t RegisterHotPlugCallback(const sptr<IInputCallback> &hotPlugCallback) override;
52     int32_t UnregisterHotPlugCallback() override;
53 private:
54     IInputInterface *inputInterface_;
55 };
56 } // V1_0
57 } // Input
58 } // HDI
59 } // OHOS
60 
61 #endif // OHOS_HDI_INPUT_V1_0_INPUTINTERFACEIMPL_H