• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 permissions and
13  * limitations under the License.
14  */
15 
16 #include "distributed_input_kit.h"
17 
18 namespace OHOS {
19 namespace DistributedHardware {
20 namespace DistributedInput {
PrepareRemoteInput(const std::string & sinkId,sptr<IPrepareDInputCallback> callback)21 int32_t DistributedInputKit::PrepareRemoteInput(
22     const std::string &sinkId, sptr<IPrepareDInputCallback> callback)
23 {
24     return DistributedInputClient::GetInstance().PrepareRemoteInput(sinkId, callback);
25 }
26 
UnprepareRemoteInput(const std::string & sinkId,sptr<IUnprepareDInputCallback> callback)27 int32_t DistributedInputKit::UnprepareRemoteInput(
28     const std::string &sinkId, sptr<IUnprepareDInputCallback> callback)
29 {
30     return DistributedInputClient::GetInstance().UnprepareRemoteInput(sinkId, callback);
31 }
32 
StartRemoteInput(const std::string & sinkId,const uint32_t & inputTypes,sptr<IStartDInputCallback> callback)33 int32_t DistributedInputKit::StartRemoteInput(
34     const std::string &sinkId, const uint32_t &inputTypes, sptr<IStartDInputCallback> callback)
35 {
36     return DistributedInputClient::GetInstance().StartRemoteInput(sinkId, inputTypes, callback);
37 }
38 
StopRemoteInput(const std::string & sinkId,const uint32_t & inputTypes,sptr<IStopDInputCallback> callback)39 int32_t DistributedInputKit::StopRemoteInput(
40     const std::string &sinkId, const uint32_t &inputTypes, sptr<IStopDInputCallback> callback)
41 {
42     return DistributedInputClient::GetInstance().StopRemoteInput(sinkId, inputTypes, callback);
43 }
44 
StartRemoteInput(const std::string & srcId,const std::string & sinkId,const uint32_t & inputTypes,sptr<IStartDInputCallback> callback)45 int32_t DistributedInputKit::StartRemoteInput(const std::string &srcId, const std::string &sinkId,
46     const uint32_t &inputTypes, sptr<IStartDInputCallback> callback)
47 {
48     return DistributedInputClient::GetInstance().StartRemoteInput(srcId, sinkId, inputTypes, callback);
49 }
50 
StopRemoteInput(const std::string & srcId,const std::string & sinkId,const uint32_t & inputTypes,sptr<IStopDInputCallback> callback)51 int32_t DistributedInputKit::StopRemoteInput(const std::string &srcId, const std::string &sinkId,
52     const uint32_t &inputTypes, sptr<IStopDInputCallback> callback)
53 {
54     return DistributedInputClient::GetInstance().StopRemoteInput(srcId, sinkId, inputTypes, callback);
55 }
56 
IsNeedFilterOut(const std::string & sinkId,const BusinessEvent & event)57 bool DistributedInputKit::IsNeedFilterOut(const std::string &sinkId, const BusinessEvent &event)
58 {
59     return DistributedInputClient::GetInstance().IsNeedFilterOut(sinkId, event);
60 }
61 
IsTouchEventNeedFilterOut(const TouchScreenEvent & event)62 bool DistributedInputKit::IsTouchEventNeedFilterOut(const TouchScreenEvent &event)
63 {
64     return DistributedInputClient::GetInstance().IsTouchEventNeedFilterOut(event);
65 }
66 
IsStartDistributedInput(const uint32_t & inputType)67 DInputServerType DistributedInputKit::IsStartDistributedInput(const uint32_t &inputType)
68 {
69     return DInputServerType::NULL_SERVER_TYPE;
70 }
71 
IsStartDistributedInput(const std::string & dhId)72 bool DistributedInputKit::IsStartDistributedInput(const std::string &dhId)
73 {
74     return DistributedInputClient::GetInstance().IsStartDistributedInput(dhId);
75 }
76 
PrepareRemoteInput(const std::string & srcId,const std::string & sinkId,sptr<IPrepareDInputCallback> callback)77 int32_t DistributedInputKit::PrepareRemoteInput(const std::string &srcId, const std::string &sinkId,
78     sptr<IPrepareDInputCallback> callback)
79 {
80     return DistributedInputClient::GetInstance().PrepareRemoteInput(srcId, sinkId, callback);
81 }
82 
UnprepareRemoteInput(const std::string & srcId,const std::string & sinkId,sptr<IUnprepareDInputCallback> callback)83 int32_t DistributedInputKit::UnprepareRemoteInput(const std::string &srcId, const std::string &sinkId,
84     sptr<IUnprepareDInputCallback> callback)
85 {
86     return DistributedInputClient::GetInstance().UnprepareRemoteInput(srcId, sinkId, callback);
87 }
88 
StartRemoteInput(const std::string & sinkId,const std::vector<std::string> & dhIds,sptr<IStartStopDInputsCallback> callback)89 int32_t DistributedInputKit::StartRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
90     sptr<IStartStopDInputsCallback> callback)
91 {
92     return DistributedInputClient::GetInstance().StartRemoteInput(sinkId, dhIds, callback);
93 }
94 
StopRemoteInput(const std::string & sinkId,const std::vector<std::string> & dhIds,sptr<IStartStopDInputsCallback> callback)95 int32_t DistributedInputKit::StopRemoteInput(const std::string &sinkId, const std::vector<std::string> &dhIds,
96     sptr<IStartStopDInputsCallback> callback)
97 {
98     return DistributedInputClient::GetInstance().StopRemoteInput(sinkId, dhIds, callback);
99 }
100 
StartRemoteInput(const std::string & srcId,const std::string & sinkId,const std::vector<std::string> & dhIds,sptr<IStartStopDInputsCallback> callback)101 int32_t DistributedInputKit::StartRemoteInput(const std::string &srcId, const std::string &sinkId,
102     const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback)
103 {
104     return DistributedInputClient::GetInstance().StartRemoteInput(srcId, sinkId, dhIds, callback);
105 }
106 
StopRemoteInput(const std::string & srcId,const std::string & sinkId,const std::vector<std::string> & dhIds,sptr<IStartStopDInputsCallback> callback)107 int32_t DistributedInputKit::StopRemoteInput(const std::string &srcId, const std::string &sinkId,
108     const std::vector<std::string> &dhIds, sptr<IStartStopDInputsCallback> callback)
109 {
110     return DistributedInputClient::GetInstance().StopRemoteInput(srcId, sinkId, dhIds, callback);
111 }
112 
RegisterInputNodeListener(sptr<InputNodeListener> listener)113 int32_t DistributedInputKit::RegisterInputNodeListener(sptr<InputNodeListener> listener)
114 {
115     return DistributedInputClient::GetInstance().RegisterInputNodeListener(listener);
116 }
117 
UnregisterInputNodeListener(sptr<InputNodeListener> listener)118 int32_t DistributedInputKit::UnregisterInputNodeListener(sptr<InputNodeListener> listener)
119 {
120     return DistributedInputClient::GetInstance().UnregisterInputNodeListener(listener);
121 }
122 
RegisterSimulationEventListener(sptr<ISimulationEventListener> listener)123 int32_t DistributedInputKit::RegisterSimulationEventListener(sptr<ISimulationEventListener> listener)
124 {
125     return DistributedInputClient::GetInstance().RegisterSimulationEventListener(listener);
126 }
127 
UnregisterSimulationEventListener(sptr<ISimulationEventListener> listener)128 int32_t DistributedInputKit::UnregisterSimulationEventListener(sptr<ISimulationEventListener> listener)
129 {
130     return DistributedInputClient::GetInstance().UnregisterSimulationEventListener(listener);
131 }
132 } // namespace DistributedInput
133 } // namespace DistributedHardware
134 } // namespace OHOS
135