Skip to content

Commit 1cc4f46

Browse files
authored
RDKEMW-2854 : IXCast.h interface headers not following coding guidelines
1 parent cc4d4ba commit 1cc4f46

File tree

1 file changed

+179
-31
lines changed

1 file changed

+179
-31
lines changed

apis/XCast/IXCast.h

Lines changed: 179 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,51 +26,199 @@
2626

2727
namespace WPEFramework {
2828
namespace Exchange {
29+
/* @json 1.0.0 @text:keep */
2930
struct EXTERNAL IXCast : virtual public Core::IUnknown {
3031
enum { ID = ID_XCAST };
3132

32-
struct ApplicationInfo {
33-
string appName;
34-
string prefixes;
35-
string cors;
36-
string query;
37-
string payload;
38-
int allowStop;
33+
enum State : uint8_t {
34+
RUNNING = 0 /* @text running */,
35+
STOPPED = 1/* @text stopped */,
36+
HIDDEN = 2 /* @text suspended */
37+
};
38+
39+
enum StandbyBehavior : uint8_t {
40+
ACTIVE = 0 /* @text active */,
41+
INACTIVE = 1 /* @text inactive */
42+
};
43+
44+
enum ErrorCode : uint16_t {
45+
NONE = 200 /* @text none */ ,
46+
FORBIDDEN = 403 /* @text forbidden */ ,
47+
UNAVAILABLE = 404 /* @text unavailable */ ,
48+
INVALID = 400 /* @text invalid */,
49+
INTERNAL = 500 /* @text internal */
50+
};
51+
52+
53+
struct EXTERNAL ApplicationInfo {
54+
string appName /* @text names */ /* @brief Group of acceptable names for a related application. Application name in request URI must have exact match to one of the names. Otherwise, matching prefix is needed. If the application name in request URI does not match any names or prefixes, then the request shall fail */;
55+
string prefixes /* @text prefixes */ /* @brief If the application name in request URI does not match the list of names, it must contain one of the prefixes.If the application name in request URI does not match any names or prefixes, then the request shall fail */;
56+
string cors /* @text cors */ /* @brief a set of origins allowed for the application. This must not be empty */;
57+
string query /* @text query */ /* @brief query string that need to be appended in launch request */;
58+
string payload /* @text payload */ /* @brief optional payload string that need to be appended in launch request */;
59+
int allowStop /* @text allowStop */ /* @brief is the application (matching name list or prefix list) allowed to stop (no PID presence) after launched */;
3960
};
4061

4162
using IApplicationInfoIterator = RPC::IIteratorType<ApplicationInfo,ID_XCAST_APPLICATION_INFO_ITERATOR>;
63+
using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;
4264

43-
struct INotification : virtual public Core::IUnknown {
65+
//@event
66+
struct EXTERNAL INotification : virtual public Core::IUnknown {
4467
enum { ID = ID_XCAST_NOTIFICATION };
4568

46-
~INotification() override = default;
47-
48-
virtual void onApplicationLaunchRequestWithLaunchParam(const string& appName, const string& strPayLoad, const string& strQuery, const string& strAddDataUrl) = 0;
49-
virtual void onApplicationLaunchRequest(const string& appName, const string& parameter) = 0;
50-
virtual void onApplicationStopRequest(const string& appName, const string& appID) = 0;
51-
virtual void onApplicationHideRequest(const string& appName, const string& appID) = 0;
52-
virtual void onApplicationStateRequest(const string& appName, const string& appID) = 0;
53-
virtual void onApplicationResumeRequest(const string& appName, const string& appID) = 0;
54-
virtual void onUpdatePowerStateRequest(const string& powerState) = 0;
69+
// @text onApplicationLaunchRequest
70+
// @brief Triggered when the cast service receives a launch request from a client with launch params
71+
// @param applicationName: Registered application name
72+
// @param strPayLoad: Payload string to be passed to the application
73+
// @param strQuery: Query string to be appended in launch request
74+
// @param strAddDataUrl: Additional data URL to be passed to the application
75+
virtual void OnApplicationLaunchRequestWithLaunchParam(const string& appName /* @text applicationName */ , const string& strPayLoad /* @text strPayLoad */, const string& strQuery /* @text strQuery */, const string& strAddDataUrl /* @text strAddDataUrl */) {};
76+
// @text onApplicationLaunchRequest
77+
// @brief Triggered when the cast service receives a launch request from a client with launch params
78+
// @param applicationName: Registered application name
79+
// @param parameter: Application launch string
80+
virtual void OnApplicationLaunchRequest(const string& appName /* @text applicationName */ , const string& parameter /* @text parameters */ ) {};
81+
// @text onApplicationStopRequest
82+
// @brief Triggered when the cast service receives a stop request from a client
83+
// @param applicationName: Registered application name
84+
// @param applicationId: Application instance ID
85+
virtual void OnApplicationStopRequest(const string& appName /* @text applicationName */, const string& appID /* @text applicationId */) {};
86+
// @text onApplicationHideRequest
87+
// @brief Triggered when the cast service receives a hide request from a client
88+
// @param applicationName: Registered application name
89+
// @param applicationId: Application instance ID
90+
virtual void OnApplicationHideRequest(const string& appName /* @text applicationName */ , const string& appID /* @text applicationId */ ) {};
91+
// @text onApplicationStateRequest
92+
// @brief Triggered when the cast service needs an update of the application state
93+
// @param applicationName: Registered application name
94+
// @param applicationId: Application instance ID
95+
virtual void OnApplicationStateRequest(const string& appName /* @text applicationName */ , const string& appID /* @text applicationId */ ) {};
96+
// @text onApplicationResumeRequest
97+
// @brief Triggered when the cast service receives a resume request from a client
98+
// @param applicationName: Registered application name
99+
// @param applicationId: Application instance ID
100+
virtual void OnApplicationResumeRequest(const string& appName /* @text applicationName */ , const string& appID /* @text applicationId */) {};
55101
};
56102

57-
~IXCast() override = default;
103+
virtual Core::hresult Register(IXCast::INotification* sink /* @in */) = 0;
104+
virtual Core::hresult Unregister(IXCast::INotification* sink /* @in */) = 0;
105+
106+
/****************************************applicationStateChanged()*****************************/
107+
// @text onApplicationStateChanged
108+
// @brief Triggered when the cast service receives an application state change notification from a client
109+
// @param applicationName: Registered application name
110+
// @param state: Application state
111+
// @param applicationId: Application instance ID
112+
// @param error: Error string, if any
113+
virtual Core::hresult ApplicationStateChanged(const string& applicationName /* @in @text applicationName */, const State& state /* @in @text state */, const string& applicationId /* @in @text applicationId */, const ErrorCode& error /* @in @text error */) = 0;
114+
/****************************************applicationStateChanged()*****************************/
115+
116+
/****************************************getProtocolVersion()**********************************/
117+
// @text getProtocolVersion
118+
// @brief Returns the DIAL protocol version supported by the server
119+
// @param version: DIAL protocol version
120+
// @param success: Whether the request succeeded
121+
virtual Core::hresult GetProtocolVersion(string &protocolVersion /* @out @text version */, bool &success /* @out */) = 0;
122+
/***************************************** getProtocolVersion() **********************************/
123+
124+
/****************************************setManufacturerName()**********************************/
125+
// @text setManufacturerName
126+
// @brief Sets the manufacturer name of the device
127+
// @param manufacturer: The Manufacturer name of the device which used to update in dd.xml
128+
virtual Core::hresult SetManufacturerName(const string &manufacturername /* @in @text manufacturer */) = 0;
129+
/***************************************** setManufacturerName() **********************************/
130+
131+
/****************************************getManufacturerName()**********************************/
132+
// @text getManufacturerName
133+
// @brief Returns the manufacturer name set by setManufacturerName API
134+
// @param manufacturer: The Manufacturer name of the device which used to update in dd.xml
135+
// @param success: Whether the request succeeded
136+
virtual Core::hresult GetManufacturerName(string &manufacturername /* @out @text manufacturer */, bool &success /* @out */) = 0;
137+
/***************************************** getManufacturerName() *********************************/
138+
139+
/****************************************setModelName()**********************************/
140+
// @text setModelName
141+
// @brief Sets the model name of the device
142+
// @param model: The Model name of the device which used to update in dd.xml
143+
virtual Core::hresult SetModelName(const string &modelname /* @in @text model */) = 0;
144+
/***************************************** setModelName() **********************************/
145+
146+
/****************************************getModelName()**********************************/
147+
// @text getModelName
148+
// @brief Returns the model name set by setModelName API
149+
// @param model: The Model name of the device which used to update in dd.xml
150+
// @param success: Whether the request succeeded
151+
virtual Core::hresult GetModelName(string &modelname /* @out @text model */, bool &success /* @out */) = 0;
152+
/***************************************** getModelName() *********************************/
153+
154+
/****************************************setEnabled()**********************************/
155+
// @text setEnabled
156+
// @brief Enable or disable XCAST service
157+
// @parm enabled: true for enabled or false for disabled
158+
virtual Core::hresult SetEnabled(const bool& enabled /* @in @text enabled */) = 0;
159+
/***************************************** setEnabled() **********************************/
160+
161+
/****************************************getEnabled()**********************************/
162+
// @text getEnabled
163+
// @brief Reports whether xcast plugin is enabled or disabled
164+
// @param enabled: true for enabled or false for disabled
165+
// @param success: Whether the request succeeded
166+
virtual Core::hresult GetEnabled(bool &enabled /* @out @text enabled */, bool &success /* @out */) = 0;
167+
/***************************************** getEnabled() **********************************/
168+
169+
/****************************************setStandbyBehavior()**********************************/
170+
// @text setStandbyBehavior
171+
// @brief Sets the expected xcast behavior in standby mode
172+
// @param standbybehavior: whether to remain active or inactive during standby mode (must be one of the following: active, inactive)
173+
virtual Core::hresult SetStandbyBehavior(const StandbyBehavior &standbybehavior /* @in @text standbybehavior */) = 0;
174+
/***************************************** setStandbyBehavior() *********************************/
175+
176+
/****************************************getStandbyBehavior()**********************************/
177+
// @text getStandbyBehavior
178+
// @brief Return current standby behavior option string set uisng setStandbyBehavior or default value
179+
// @param standbybehavior: whether to remain active or inactive during standby mode (must be one of the following: active, inactive)
180+
// @param success: Whether the request succeeded
181+
virtual Core::hresult GetStandbyBehavior(StandbyBehavior &standbybehavior /* @out @text standbybehavior */, bool &success /* @out */) = 0;
182+
/***************************************** getStandbyBehavior() *********************************/
183+
184+
/****************************************setFriendlyName()**********************************/
185+
// @text setFriendlyName
186+
// @brief Sets the friendly name of the device
187+
// @param friendlyname: The friendly name of the device which used to display on the client device list
188+
virtual Core::hresult SetFriendlyName(const string &friendlyname /* @in @text friendlyname */) = 0;
189+
/***************************************** setFriendlyName() **********************************/
190+
191+
/****************************************getFriendlyName()**********************************/
192+
// @text getFriendlyName
193+
// @brief Returns the friendly name set by setFriendlyName API
194+
// @param friendlyname: The friendly name of the device which used to display on the client device list
195+
// @param success: Whether the request succeeded
196+
virtual Core::hresult GetFriendlyName(string &friendlyname /* @out @text friendlyname */, bool &success /* @out */) = 0;
197+
/***************************************** getFriendlyName() *********************************/
198+
199+
/****************************************getApiVersionNumber()**********************************/
200+
// @text getApiVersionNumber
201+
// @brief Gets the API version number
202+
// @param version: a version number
203+
// @param success: Whether the request succeeded
204+
virtual Core::hresult GetApiVersionNumber(uint32_t &version /* @out @text version */, bool &success/* @out */) = 0;
205+
/****************************************getApiVersionNumber()**********************************/
58206

59-
virtual void Register(IXCast::INotification* sink) = 0;
60-
virtual void Unregister(IXCast::INotification* sink) = 0;
207+
/****************************************registerApplications()**********************************/
208+
// @text registerApplications
209+
// @brief Registers an application
210+
// @param applications: Json array with one or more application details to register
211+
virtual Core::hresult RegisterApplications(IApplicationInfoIterator* const appInfoList /* @text applications */ ) = 0;
212+
/****************************************registerApplications()**********************************/
61213

62-
virtual uint32_t Initialize(bool networkStandbyMode) = 0;
63-
virtual void Deinitialize(void) = 0;
214+
/****************************************unregisterApplications()**********************************/
215+
// @text unregisterApplications
216+
// @brief Unregisters an application
217+
// @param applications: One or more application name to unregister
218+
virtual Core::hresult UnregisterApplications(IStringIterator* const applications /* @in @text applications */) = 0;
219+
/****************************************unregisterApplications()**********************************/
220+
64221

65-
virtual uint32_t applicationStateChanged(const string& applicationName, const string& state, const string& applicationId, const string& error) const = 0;
66-
virtual uint32_t enableCastService(string friendlyname,bool enableService) const = 0;
67-
virtual uint32_t getProtocolVersion(string &protocolVersion /* @out */ ) const = 0;
68-
virtual uint32_t registerApplications(IApplicationInfoIterator * const appInfoList /* @in */ ) = 0;
69-
virtual uint32_t setNetworkStandbyMode(bool networkStandbyMode) = 0;
70-
virtual uint32_t setManufacturerName(string manufacturername) const = 0;
71-
virtual uint32_t getManufacturerName(string &manufacturername /* @out */ ) const = 0;
72-
virtual uint32_t setModelName(string modelname) const = 0;
73-
virtual uint32_t getModelName(string &modelname /* @out */ ) const = 0;
74222
};
75223

76224
} // Exchange

0 commit comments

Comments
 (0)