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_IINPUTINTERFACES_H 17#define OHOS_HDI_INPUT_V1_0_IINPUTINTERFACES_H 18 19#include <stdint.h> 20#include <string> 21#include <vector> 22#include <hdf_base.h> 23#include <hdi_base.h> 24#include "input/v1_0/iinput_callback.h" 25#include "input/v1_0/input_types.h" 26 27namespace OHOS { 28namespace HDI { 29namespace Input { 30namespace V1_0 { 31using namespace OHOS; 32using namespace OHOS::HDI; 33 34class IInputInterfaces : public HdiBase { 35public: 36 DECLARE_HDI_DESCRIPTOR(u"ohos.hdi.input.v1_0.IInputInterfaces"); 37 38 virtual ~IInputInterfaces() = default; 39 40 static sptr<OHOS::HDI::Input::V1_0::IInputInterfaces> Get(bool isStub = false); 41 static sptr<OHOS::HDI::Input::V1_0::IInputInterfaces> Get(const std::string &serviceName, bool isStub = false); 42 43 virtual int32_t ScanInputDevice(std::vector<OHOS::HDI::Input::V1_0::DevDesc>& staArr) = 0; 44 45 virtual int32_t OpenInputDevice(uint32_t devIndex) = 0; 46 47 virtual int32_t CloseInputDevice(uint32_t devIndex) = 0; 48 49 virtual int32_t GetInputDevice(uint32_t devIndex, OHOS::HDI::Input::V1_0::DeviceInfo& devInfo) = 0; 50 51 virtual int32_t GetInputDeviceList(uint32_t& devNum, std::vector<OHOS::HDI::Input::V1_0::DeviceInfo>& devList, 52 uint32_t size) = 0; 53 54 virtual int32_t SetPowerStatus(uint32_t devIndex, uint32_t status) = 0; 55 56 virtual int32_t GetPowerStatus(uint32_t devIndex, uint32_t& status) = 0; 57 58 virtual int32_t GetDeviceType(uint32_t devIndex, uint32_t& deviceType) = 0; 59 60 virtual int32_t GetChipInfo(uint32_t devIndex, std::string& chipInfo) = 0; 61 62 virtual int32_t GetVendorName(uint32_t devIndex, std::string& vendorName) = 0; 63 64 virtual int32_t GetChipName(uint32_t devIndex, std::string& chipName) = 0; 65 66 virtual int32_t SetGestureMode(uint32_t devIndex, uint32_t gestureMode) = 0; 67 68 virtual int32_t RunCapacitanceTest(uint32_t devIndex, uint32_t testType, std::string& result, uint32_t length) = 0; 69 70 virtual int32_t RunExtraCommand(uint32_t devIndex, const OHOS::HDI::Input::V1_0::ExtraCmd& cmd) = 0; 71 72 virtual int32_t RegisterReportCallback(uint32_t devIndex, 73 const sptr<OHOS::HDI::Input::V1_0::IInputCallback>& eventPkgCallback) = 0; 74 75 virtual int32_t UnregisterReportCallback(uint32_t devIndex) = 0; 76 77 virtual int32_t RegisterHotPlugCallback(const sptr<OHOS::HDI::Input::V1_0::IInputCallback>& hotPlugCallback) = 0; 78 79 virtual int32_t UnregisterHotPlugCallback() = 0; 80 81 virtual int32_t GetVersion(uint32_t& majorVer, uint32_t& minorVer) 82 { 83 majorVer = 1; 84 minorVer = 0; 85 return HDF_SUCCESS; 86 } 87 88 virtual bool IsProxy() 89 { 90 return false; 91 } 92 93 virtual const std::u16string GetDesc() 94 { 95 return metaDescriptor_; 96 } 97}; 98} // V1_0 99} // Input 100} // HDI 101} // OHOS 102 103#endif // OHOS_HDI_INPUT_V1_0_IINPUTINTERFACES_H 104 105