diff --git a/figures/distributedinput_arch.png b/figures/distributedinput_arch.png new file mode 100644 index 0000000..9f46752 Binary files /dev/null and b/figures/distributedinput_arch.png differ diff --git a/frameworks/include/i_add_white_list_infos_call_back.h b/frameworks/include/i_add_white_list_infos_call_back.h new file mode 100644 index 0000000..1cc37b4 --- /dev/null +++ b/frameworks/include/i_add_white_list_infos_call_back.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef I_ADD_WHITE_LIST_INFOS_CALL_BACK_H +#define I_ADD_WHITE_LIST_INFOS_CALL_BACK_H + +#include +#include + +namespace OHOS { +namespace DistributedHardware { +namespace DistributedInput { +class IAddWhiteListInfosCallback : public IRemoteBroker { +public: + virtual void OnResult(const std::string& deviceId, const std::string& strJson) = 0; + + enum class Message { + RESULT, + }; + + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IAddWhiteListInfosCallback"); +}; +} // namespace DistributedHardware +} // namespace DistributedInput +} // namespace OHOS + +#endif // I_ADD_WHITE_LIST_INFOS_CALL_BACK_H diff --git a/frameworks/include/i_del_white_list_infos_call_back.h b/frameworks/include/i_del_white_list_infos_call_back.h new file mode 100644 index 0000000..19497fb --- /dev/null +++ b/frameworks/include/i_del_white_list_infos_call_back.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef I_DEL_WHITE_LIST_INFOS_CALL_BACK_H +#define I_DEL_WHITE_LIST_INFOS_CALL_BACK_H + +#include +#include + +namespace OHOS { +namespace DistributedHardware { +namespace DistributedInput { +class IDelWhiteListInfosCallback : public IRemoteBroker { +public: + virtual void OnResult(const std::string& deviceId) = 0; + + enum class Message { + RESULT, + }; + + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IDelWhiteListInfosCallback"); +}; +} // namespace DistributedHardware +} // namespace DistributedInput +} // namespace OHOS + +#endif // I_ADD_WHITE_LIST_INFOS_CALL_BACK_H diff --git a/frameworks/include/i_distributed_sink_input.h b/frameworks/include/i_distributed_sink_input.h new file mode 100644 index 0000000..c6ab18f --- /dev/null +++ b/frameworks/include/i_distributed_sink_input.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing DistributedInputs and + * limitations under the License. + */ + +#ifndef I_DISTRIBUTED_SINK_INPUT_H +#define I_DISTRIBUTED_SINK_INPUT_H +#include +#include "../../common/include/constants_dinput.h" +#include "iremote_broker.h" +#include "iremote_object.h" +#include "i_start_d_input_server_call_back.h" + +namespace OHOS { +namespace DistributedHardware { +namespace DistributedInput { +class IDistributedSinkInput : public IRemoteBroker { +public: + static const int32_t SA_ID_DISTRIBUTED_INPUT_SINK_SERVICE = 4810; + + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IDistributedSinkInput"); + + virtual int32_t Init() = 0; + + virtual int32_t Release() = 0; + + virtual int32_t IsStartDistributedInput( + const uint32_t& inputType, sptr callback) = 0; + + enum class MessageCode { + INIT = 0xf011, + RELEASE = 0xf012, + ISSTART_REMOTE_INPUT = 0xf013, + }; +}; +} // namespace DistributedInput +} // namespace DistributedHardware +} // namespace OHOS + +#endif // I_DISTRIBUTED_SINK_INPUT_H diff --git a/frameworks/include/i_distributed_source_input.h b/frameworks/include/i_distributed_source_input.h new file mode 100644 index 0000000..67e4659 --- /dev/null +++ b/frameworks/include/i_distributed_source_input.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing DistributedInputs and + * limitations under the License. + */ + +#ifndef I_DISTRIBUTED_INPUT_H +#define I_DISTRIBUTED_INPUT_H +#include +#include "../../common/include/constants_dinput.h" +#include "iremote_broker.h" +#include "iremote_object.h" +#include "i_register_d_input_call_back.h" +#include "i_unregister_d_input_call_back.h" +#include "i_prepare_d_input_call_back.h" +#include "i_unprepare_d_input_call_back.h" +#include "i_start_d_input_call_back.h" +#include "i_stop_d_input_call_back.h" +#include "i_start_d_input_server_call_back.h" +#include "i_add_white_list_infos_call_back.h" +#include "i_del_white_list_infos_call_back.h" + +namespace OHOS { +namespace DistributedHardware { +namespace DistributedInput { +class IDistributedSourceInput : public IRemoteBroker { +public: + static const int32_t SA_ID_DISTRIBUTED_INPUT_SOURCE_SERVICE = 4809; + + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IDistributedSourceInput"); + + virtual int32_t Init() = 0; + + virtual int32_t Release() = 0; + + virtual int32_t RegisterDistributedHardware( + const std::string& devId, const std::string& dhId, const std::string& parameters, + sptr callback) = 0; + + virtual int32_t UnregisterDistributedHardware( + const std::string& devId, const std::string& dhId, + sptr callback) = 0; + + virtual int32_t PrepareRemoteInput( + const std::string& deviceId, sptr callback, + sptr addWhiteListCallback) = 0; + + virtual int32_t UnprepareRemoteInput( + const std::string& deviceId, sptr callback, + sptr delWhiteListCallback) = 0; + + virtual int32_t StartRemoteInput( + const std::string& deviceId, const uint32_t& inputTypes, sptr callback) = 0; + + virtual int32_t StopRemoteInput( + const std::string& deviceId, const uint32_t& inputTypes, sptr callback) = 0; + + virtual int32_t IsStartDistributedInput( + const uint32_t& inputType, sptr callback) = 0; + + enum class MessageCode { + INIT = 0xf001, + RELEASE = 0xf002, + REGISTER_REMOTE_INPUT = 0xf003, + UNREGISTER_REMOTE_INPUT = 0xf004, + PREPARE_REMOTE_INPUT = 0xf005, + UNPREPARE_REMOTE_INPUT = 0xf006, + START_REMOTE_INPUT = 0xf007, + STOP_REMOTE_INPUT = 0xf008, + ISSTART_REMOTE_INPUT = 0xf009, + }; +}; +} // namespace DistributedInput +} // namespace DistributedHardware +} // namespace OHOS + +#endif // DISTRIBUTED_INPUT_INNERKITS_INCLUDE_I_DISTRIBUTED_INPUT_H diff --git a/frameworks/include/i_prepare_d_input_call_back.h b/frameworks/include/i_prepare_d_input_call_back.h new file mode 100644 index 0000000..2d45212 --- /dev/null +++ b/frameworks/include/i_prepare_d_input_call_back.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef I_PREPARE_D_INPUT_CALL_BACK_H +#define I_PREPARE_D_INPUT_CALL_BACK_H + +#include +#include + +namespace OHOS { +namespace DistributedHardware { +namespace DistributedInput { +class IPrepareDInputCallback : public IRemoteBroker { +public: + virtual void OnResult(const std::string& devId, const int32_t& status) = 0; + + enum class Message { + RESULT, + }; + + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IPrepareDInputCallback"); +}; +} // namespace DistributedHardware +} // namespace DistributedInput +} // namespace OHOS + +#endif // I_PREPARE_D_INPUT_CALL_BACK_H diff --git a/frameworks/include/i_register_d_input_call_back.h b/frameworks/include/i_register_d_input_call_back.h new file mode 100644 index 0000000..d79f222 --- /dev/null +++ b/frameworks/include/i_register_d_input_call_back.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef I_REGIST_D_INPUT_CALL_BACK_H +#define I_REGIST_D_INPUT_CALL_BACK_H + +#include +#include + +namespace OHOS { +namespace DistributedHardware { +namespace DistributedInput { +class IRegisterDInputCallback : public IRemoteBroker { +public: + virtual void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status) = 0; + + enum class Message { + RESULT, + }; + + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IRegisterDInputCallback"); +}; +} // namespace DistributedHardware +} // namespace DistributedInput +} // namespace OHOS + +#endif // I_REGIST_D_INPUT_CALL_BACK_H diff --git a/frameworks/include/i_start_d_input_call_back.h b/frameworks/include/i_start_d_input_call_back.h new file mode 100644 index 0000000..7638aec --- /dev/null +++ b/frameworks/include/i_start_d_input_call_back.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef I_START_D_INPUT_CALL_BACK_H +#define I_START_D_INPUT_CALL_BACK_H + +#include +#include + +namespace OHOS { +namespace DistributedHardware { +namespace DistributedInput { +class IStartDInputCallback : public IRemoteBroker { +public: + virtual void OnResult(const std::string& devId, const uint32_t& inputTypes, const int32_t& status) = 0; + + enum class Message { + RESULT, + }; + + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IStartDInputCallback"); +}; +} // namespace DistributedHardware +} // namespace DistributedInput +} // namespace OHOS + +#endif // I_START_D_INPUT_CALL_BACK_H diff --git a/frameworks/include/i_start_d_input_server_call_back.h b/frameworks/include/i_start_d_input_server_call_back.h new file mode 100644 index 0000000..2ab1a0d --- /dev/null +++ b/frameworks/include/i_start_d_input_server_call_back.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef I_START_D_INPUT_SERVER_CALL_BACK_H +#define I_START_D_INPUT_SERVER_CALL_BACK_H + +#include "../../common/include/constants_dinput.h" + +#include +#include + +namespace OHOS { +namespace DistributedHardware { +namespace DistributedInput { +class IStartDInputServerCallback : public IRemoteBroker { +public: + virtual void OnResult(const int32_t& status, const uint32_t& inputTypes) = 0; + + enum class Message { + RESULT, + }; + + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IStartDInputServerCallback"); +}; +} // namespace DistributedHardware +} // namespace DistributedInput +} // namespace OHOS + +#endif // I_START_D_INPUT_SERVER_CALL_BACK_H diff --git a/frameworks/include/i_stop_d_input_call_back.h b/frameworks/include/i_stop_d_input_call_back.h new file mode 100644 index 0000000..757acc6 --- /dev/null +++ b/frameworks/include/i_stop_d_input_call_back.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef I_STOP_D_INPUT_CALL_BACK_H +#define I_STOP_D_INPUT_CALL_BACK_H + +#include +#include + +namespace OHOS { +namespace DistributedHardware { +namespace DistributedInput { +class IStopDInputCallback : public IRemoteBroker { +public: + virtual void OnResult(const std::string& devId, const uint32_t& inputTypes, const int32_t& status) = 0; + + enum class Message { + RESULT, + }; + + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IStopDInputCallback"); +}; +} // namespace DistributedHardware +} // namespace DistributedInput +} // namespace OHOS + +#endif // I_STOP_D_INPUT_CALL_BACK_H diff --git a/frameworks/include/i_unprepare_d_input_call_back.h b/frameworks/include/i_unprepare_d_input_call_back.h new file mode 100644 index 0000000..181c76e --- /dev/null +++ b/frameworks/include/i_unprepare_d_input_call_back.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef I_UNPREPARE_D_INPUT_CALL_BACK_H +#define I_UNPREPARE_D_INPUT_CALL_BACK_H + +#include +#include + +namespace OHOS { +namespace DistributedHardware { +namespace DistributedInput { +class IUnprepareDInputCallback : public IRemoteBroker { +public: + virtual void OnResult(const std::string& devId, const int32_t& status) = 0; + + enum class Message { + RESULT, + }; + + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IUnprepareDInputCallback"); +}; +} // namespace DistributedHardware +} // namespace DistributedInput +} // namespace OHOS + +#endif // I_UNPREPARE_D_INPUT_CALL_BACK_H diff --git a/frameworks/include/i_unregister_d_input_call_back.h b/frameworks/include/i_unregister_d_input_call_back.h new file mode 100644 index 0000000..bbdeaf1 --- /dev/null +++ b/frameworks/include/i_unregister_d_input_call_back.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef I_UNREGIST_D_INPUT_CALL_BACK_H +#define I_UNREGIST_D_INPUT_CALL_BACK_H + +#include +#include + +namespace OHOS { +namespace DistributedHardware { +namespace DistributedInput { +class IUnregisterDInputCallback : public IRemoteBroker { +public: + virtual void OnResult(const std::string& devId, const std::string& dhId, const int32_t& status) = 0; + + enum class Message { + RESULT, + }; + + DECLARE_INTERFACE_DESCRIPTOR(u"ohos.DistributedHardware.DistributedInput.IUnregisterDInputCallback"); +}; +} // namespace DistributedHardware +} // namespace DistributedInput +} // namespace OHOS + +#endif // I_UNREGIST_D_INPUT_CALL_BACK_H