diff --git a/interfaces/IFireboltDiscovery.h b/interfaces/IFireboltDiscovery.h new file mode 100644 index 00000000..3e3d108f --- /dev/null +++ b/interfaces/IFireboltDiscovery.h @@ -0,0 +1,94 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2024 Metrological + * + * 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. + */ + +#pragma once +#include "Module.h" + +// @insert + +namespace WPEFramework { + +namespace Exchange { + + + struct EXTERNAL IFireboltDiscovery : virtual public Core::IUnknown { + + enum { ID = ID_FIREBOLT_DISCOVERY }; + struct EXTERNAL DiscoveryPolicy{ + bool enableRecommendation; + bool shareWatchHistory; + bool rememberWatchedProgram; + }; + + // @event + struct EXTERNAL INotification : virtual public Core::IUnknown { + enum { ID = ID_FIREBOLT_DISCOVERY_NOTIFICATION }; + ~INotification() override = default; + + // @brief Notifies that PolicyValue Changed + /* @text:onPolicyChanged */ + virtual void OnPolicyChanged(const struct DiscoveryPolicy policy) = 0; + }; + + // Pushing notifications to interested sinks + virtual Core::hresult Register(IFireboltDiscovery::INotification* sink) = 0; + virtual Core::hresult Unregister(IFireboltDiscovery::INotification* sink) = 0; + + // @brief Provides Current Policy in action + virtual Core::hresult GetDiscoveryPolicy(DiscoveryPolicy& policy /* @out */) = 0; + + virtual Core::hresult watched(const string& appId) = 0; + }; + + namespace JSONRPC { + + /* @json 1.0.0 */ + struct EXTERNAL IFireboltDiscoveryJSONRPC { + + virtual ~IFireboltDiscoveryJSONRPC() = default; + + + /* @event */ + struct EXTERNAL INotification { + + virtual ~INotification() = default; + + // @brief Notifies change in the discovery policy + virtual void PolicyChanged(const IFireboltDiscovery::DiscoveryPolicy policy) = 0; + }; + // @text SignIn + // @brief Signin the user in the app + // @details AppID shall be passed through the security token. + // @param signin: True - SignIn + // @retval ERROR_PRIVILIGED_REQUEST: App security errors + virtual Core::hresult SignIn(const Core::JSONRPC::Context& context, const bool signin /*@optional*/) = 0; + + // @text Policy + // @brief Signin the user in the app + // @details Get the current Discovery Policy + // @retval ERROR_PRIVILIGED_REQUEST: App security errors + virtual Core::hresult Policy(const Core::JSONRPC::Context& context, IFireboltDiscovery::DiscoveryPolicy& policy /*@out*/) = 0; + + }; + + } // namespace JSONRPC + +} // namespace Exchange + +} diff --git a/interfaces/IFireboltPrivacy.h b/interfaces/IFireboltPrivacy.h new file mode 100644 index 00000000..3b5421af --- /dev/null +++ b/interfaces/IFireboltPrivacy.h @@ -0,0 +1,72 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2022 Metrological + * + * 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. + */ + +#pragma once +#include "Module.h" +namespace WPEFramework { +namespace Exchange { + + /* @json 1.0.0*/ + struct EXTERNAL IFireboltPrivacy : virtual public Core::IUnknown { + enum { ID = ID_FIREBOLT_PRIVACY }; + + // @event + struct EXTERNAL INotification : virtual public Core::IUnknown { + enum { ID = ID_FIREBOLT_PRIVACY_NOTIFICATION }; + ~INotification() override = default; + + // @brief Notifies that Allow Resume points value change + /* @text:onAllowResumePointsChanged */ + virtual void OnAllowResumePointsChanged(const bool value) = 0; + // @brief Notifies that Allow personalization value change + /* @text:onAllowPersonalizationChanged */ + virtual void OnAllowPersonalizationChanged(const bool value) = 0; + // @brief Notifies that Allow Watch History value change + /* @text:onAllowWatchHistoryChanged */ + virtual void OnAllowWatchHistoryChanged(const bool value) = 0; + }; + + ~IFireboltPrivacy() override = default; + + // Pushing notifications to interested sinks + virtual Core::hresult Register(IFireboltPrivacy::INotification* sink) = 0; + virtual Core::hresult Unregister(IFireboltPrivacy::INotification* sink) = 0; + + // @brief Provides Current resume watch status + // @text:AllowResumePoints + virtual Core::hresult GetAllowResumePoints(bool& allow /* @out */) const = 0; + // @brief sets the current resume watch status + // @text:SetAllowResumePoints + virtual Core::hresult SetAllowResumePoints(const bool& value ) = 0; + // @brief Provides Current resume watch status + // @text:AllowPersonalization + virtual Core::hresult GetAllowPersonalization(bool& allow /* @out */) const = 0; + // @brief sets the current resume watch status + // @text:SetAllowPersonalization + virtual Core::hresult SetAllowPersonalization(const bool& value ) = 0; + // @brief Provides Current resume watch status + // @text:AllowWatchHistory + virtual Core::hresult GetAllowWatchHistory(bool& allow /* @out */) const = 0; + // @brief sets the current resume watch status + // @text:SetAllowWatchHistory + virtual Core::hresult SetAllowWatchHistory(const bool& value ) = 0; + + }; +} +} diff --git a/interfaces/Ids.h b/interfaces/Ids.h index c2ee007f..a0c6c65c 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -378,7 +378,14 @@ namespace Exchange { ID_DNS_SERVER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4E0, ID_DNS_ZONE = ID_DNS_SERVER + 1, - ID_DNS_RECORD = ID_DNS_SERVER + 2 + ID_DNS_RECORD = ID_DNS_SERVER + 2, + + ID_FIREBOLT_PRIVACY = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4F0, + ID_FIREBOLT_PRIVACY_NOTIFICATION = ID_FIREBOLT_PRIVACY + 1, + + ID_FIREBOLT_DISCOVERY = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x500, + ID_FIREBOLT_DISCOVERY_NOTIFICATION = ID_FIREBOLT_DISCOVERY + 1, + ID_FIREBOLT_DISCOVERY_POLICY = ID_FIREBOLT_DISCOVERY + 2 }; } }