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 #include "i_session_state_callback.h"
39 
40 namespace OHOS {
41 namespace DistributedHardware {
42 namespace DistributedInput {
43 class IDistributedSourceInput : public IRemoteBroker {
44 public:
45     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IDistributedSourceInput");
46 
47     virtual int32_t Init() = 0;
48 
49     virtual int32_t Release() = 0;
50 
51     virtual int32_t RegisterDistributedHardware(
52         const std::string &devId, const std::string &dhId, const std::string &parameters,
53         sptr<IRegisterDInputCallback> callback) = 0;
54 
55     virtual int32_t UnregisterDistributedHardware(
56         const std::string &devId, const std::string &dhId,
57         sptr<IUnregisterDInputCallback> callback) = 0;
58 
59     virtual int32_t PrepareRemoteInput(const std::string &deviceId, sptr<IPrepareDInputCallback> callback) = 0;
60 
61     virtual int32_t UnprepareRemoteInput(const std::string &deviceId, sptr<IUnprepareDInputCallback> callback) = 0;
62 
63     virtual int32_t StartRemoteInput(
64         const std::string &deviceId, const uint32_t &inputTypes, sptr<IStartDInputCallback> callback) = 0;
65 
66     virtual int32_t StopRemoteInput(
67         const std::string &deviceId, const uint32_t &inputTypes, sptr<IStopDInputCallback> callback) = 0;
68 
69     virtual int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
70         sptr<IStartDInputCallback> callback) = 0;
71 
72     virtual int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId, const uint32_t &inputTypes,
73         sptr<IStopDInputCallback> callback) = 0;
74 
75     virtual int32_t PrepareRemoteInput(const std::string &srcId, const std::string &sinkId,
76         sptr<IPrepareDInputCallback> callback) = 0;
77 
78     virtual int32_t UnprepareRemoteInput(const std::string &srcId, const std::string &sinkId,
79         sptr<IUnprepareDInputCallback> callback) = 0;
80 
81     virtual int32_t StartRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
82         sptr<IStartStopDInputsCallback> callback) = 0;
83 
84     virtual int32_t StopRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
85         sptr<IStartStopDInputsCallback> callback) = 0;
86 
87     virtual int32_t StartRemoteInput(const std::string &srcId, const std::string &sinkId,
88         const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback) = 0;
89 
90     virtual int32_t StopRemoteInput(const std::string &srcId, const std::string &sinkId,
91         const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback) = 0;
92 
93     virtual int32_t RegisterAddWhiteListCallback(sptr<IAddWhiteListInfosCallback> addWhiteListCallback) = 0;
94     virtual int32_t RegisterDelWhiteListCallback(sptr<IDelWhiteListInfosCallback> delWhiteListCallback) = 0;
95 
96     virtual int32_t RegisterSimulationEventListener(sptr<ISimulationEventListener> listener) = 0;
97     virtual int32_t UnregisterSimulationEventListener(sptr<ISimulationEventListener> listener) = 0;
98     virtual int32_t RegisterSessionStateCb(sptr<ISessionStateCallback> callback) = 0;
99     virtual int32_t UnregisterSessionStateCb() = 0;
100 };
101 } // namespace DistributedInput
102 } // namespace DistributedHardware
103 } // namespace OHOS
104 
105 #endif // I_DISTRIBUTED_SOURCE_INPUT_H
106