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 IINPUT_HOST_CALLBACK_H 17 #define IINPUT_HOST_CALLBACK_H 18 19 #include <iremote_broker.h> 20 #include "input_type.h" 21 22 namespace OHOS { 23 namespace Input { 24 enum { 25 CMD_INPUT_CALLBACK_REMOTE_REPROT_EVENT = 100, 26 CMD_INPUT_CALLBACK_REMOTE_REPROT_HOT_PLUG_EVENT 27 }; 28 class InputReportEventCb : public IRemoteBroker { 29 public: 30 DECLARE_INTERFACE_DESCRIPTOR(u"HDI.INPUT.V1_0.InputReportEventCb"); ~InputReportEventCb()31 virtual ~InputReportEventCb() {} 32 public: 33 /** 34 * @brief Reports input event data by the registered callback. 35 * 36 * @param pkgs describes the input event data package. 37 * @param count Indicates the number of input event data packets. 38 * @param devIndex Indicates the index of an input device. 39 * @since 1.0 40 * @version 1.0 41 */ 42 virtual void ReportEventPkgCallback(const EventPackage *pkgs, uint32_t count, uint32_t devIndex) = 0; 43 }; 44 class InputReportHostCb : public IRemoteBroker { 45 public: 46 DECLARE_INTERFACE_DESCRIPTOR(u"HDI.INPUT.V1_0.InputReportHostCb"); ~InputReportHostCb()47 virtual ~InputReportHostCb() {} 48 public: 49 /** 50 * @brief Reports hot plug event data by the registered callback. 51 * 52 * @param event Indicates the pointer to the hot plug event data reported by the input driver. 53 * @since 1.0 54 * @version 1.0 55 */ 56 virtual void ReportHotPlugEventCallback(const HotPlugEvent *event) = 0; 57 }; 58 } // namespace Input 59 } // namespace OHOS 60 #endif // IINPUT_HOST_CALLBACK_H 61