1 /* 2 * Copyright (c) 2022-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 I_DEVICE_H 17 #define I_DEVICE_H 18 19 #include <string> 20 21 namespace OHOS { 22 namespace Msdp { 23 namespace DeviceStatus { 24 class IDevice { 25 public: 26 enum KeyboardType { 27 KEYBOARD_TYPE_NONE, 28 KEYBOARD_TYPE_UNKNOWN, 29 KEYBOARD_TYPE_ALPHABETICKEYBOARD, 30 KEYBOARD_TYPE_DIGITALKEYBOARD, 31 KEYBOARD_TYPE_HANDWRITINGPEN, 32 KEYBOARD_TYPE_REMOTECONTROL, 33 KEYBOARD_TYPE_MAX 34 }; 35 36 public: 37 IDevice() = default; 38 virtual ~IDevice() = default; 39 40 virtual int32_t Open() = 0; 41 virtual void Close() = 0; 42 43 virtual void SetDevPath(const std::string &devPath) = 0; 44 virtual void SetSysPath(const std::string &sysPath) = 0; 45 46 virtual int32_t GetId() const = 0; 47 virtual std::string GetDevPath() const = 0; 48 virtual std::string GetSysPath() const = 0; 49 virtual std::string GetName() const = 0; 50 virtual int32_t GetBus() const = 0; 51 virtual int32_t GetVersion() const = 0; 52 virtual int32_t GetProduct() const = 0; 53 virtual int32_t GetVendor() const = 0; 54 virtual std::string GetPhys() const = 0; 55 virtual std::string GetUniq() const = 0; 56 virtual KeyboardType GetKeyboardType() const = 0; 57 virtual bool IsPointerDevice() const = 0; 58 virtual bool IsKeyboard() const = 0; 59 }; 60 } // namespace DeviceStatus 61 } // namespace Msdp 62 } // namespace OHOS 63 #endif // I_DEVICE_H