1 /* 2 * Copyright (c) 2021-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 DistributedInputs and 13 * limitations under the License. 14 */ 15 16 #ifndef I_DISTRIBUTED_SOURCE_INPUT_H 17 #define I_DISTRIBUTED_SOURCE_INPUT_H 18 19 #include <string> 20 #include <vector> 21 22 #include "iremote_broker.h" 23 #include "iremote_object.h" 24 25 #include "constants_dinput.h" 26 #include "i_add_white_list_infos_call_back.h" 27 #include "i_del_white_list_infos_call_back.h" 28 #include "i_prepare_d_input_call_back.h" 29 #include "i_register_d_input_call_back.h" 30 #include "i_start_d_input_call_back.h" 31 #include "i_stop_d_input_call_back.h" 32 #include "i_start_stop_d_inputs_call_back.h" 33 #include "i_start_stop_result_call_back.h" 34 #include "i_unprepare_d_input_call_back.h" 35 #include "i_unregister_d_input_call_back.h" 36 #include "i_input_node_listener.h" 37 #include "i_simulation_event_listener.h" 38 39 namespace OHOS { 40 namespace DistributedHardware { 41 namespace DistributedInput { 42 class IDistributedSourceInput : public IRemoteBroker { 43 public: 44 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IDistributedSourceInput"); 45 46 virtual int32_t Init() = 0; 47 48 virtual int32_t Release() = 0; 49 50 virtual int32_t RegisterDistributedHardware( 51 const std::string &devId, const std::string &dhId, const std::string ¶meters, 52 sptr<IRegisterDInputCallback> callback) = 0; 53 54 virtual int32_t UnregisterDistributedHardware( 55 const std::string &devId, const std::string &dhId, 56 sptr<IUnregisterDInputCallback> callback) = 0; 57 58 virtual int32_t PrepareRemoteInput(const std::string &deviceId, sptr<IPrepareDInputCallback> callback) = 0; 59 60 virtual int32_t UnprepareRemoteInput(const std::string &deviceId, sptr<IUnprepareDInputCallback> callback) = 0; 61 62 virtual int32_t StartRemoteInput( 63 const std::string &deviceId, const uint32_t &inputTypes, sptr<IStartDInputCallback> callback) = 0; 64 65 virtual int32_t StopRemoteInput( 66 const std::string &deviceId, const uint32_t &inputTypes, sptr<IStopDInputCallback> callback) = 0; 67 68 virtual int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes, 69 sptr<IStartDInputCallback> callback) = 0; 70 71 virtual int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes, 72 sptr<IStopDInputCallback> callback) = 0; 73 74 virtual int32_t PrepareRemoteInput(const std::string &srcId, const std::string &sinkId, 75 sptr<IPrepareDInputCallback> callback) = 0; 76 77 virtual int32_t UnprepareRemoteInput(const std::string &srcId, const std::string &sinkId, 78 sptr<IUnprepareDInputCallback> callback) = 0; 79 80 virtual int32_t StartRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds, 81 sptr<IStartStopDInputsCallback> callback) = 0; 82 83 virtual int32_t StopRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds, 84 sptr<IStartStopDInputsCallback> callback) = 0; 85 86 virtual int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId, 87 const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback) = 0; 88 89 virtual int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId, 90 const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback) = 0; 91 92 virtual int32_t RegisterAddWhiteListCallback(sptr<IAddWhiteListInfosCallback> addWhiteListCallback) = 0; 93 virtual int32_t RegisterDelWhiteListCallback(sptr<IDelWhiteListInfosCallback> delWhiteListCallback) = 0; 94 virtual int32_t RegisterInputNodeListener(sptr<InputNodeListener> listener) = 0; 95 virtual int32_t UnregisterInputNodeListener(sptr<InputNodeListener> listener) = 0; 96 97 virtual int32_t SyncNodeInfoRemoteInput(const std::string &userDevId, const std::string &dhid, 98 const std::string &nodeDesc) = 0; 99 virtual int32_t RegisterSimulationEventListener(sptr<ISimulationEventListener> listener) = 0; 100 virtual int32_t UnregisterSimulationEventListener(sptr<ISimulationEventListener> listener) = 0; 101 }; 102 } // namespace DistributedInput 103 } // namespace DistributedHardware 104 } // namespace OHOS 105 106 #endif // I_DISTRIBUTED_SOURCE_INPUT_H 107