RDK Documentation (Open Sourced RDK Components)
rtcast.hpp
1 /*
2  * This header defines the public methods and names specified by XCAST Spec as in
3  * https://etwiki.sys.comcast.net/display/APPS/XCAST
4  */
5 #ifndef RT_CAST_H
6 #define RT_CAST_H
7 
8 #include "rtabstractservice.h"
9 #include "rtRemote.h"
10 #include "rtObject.h"
11 #include "rtError.h"
12 
13 
14 /*
15  * Error strings
16  */
17 enum CastError {
18  CAST_ERROR_NONE,
19  CAST_ERROR_FORBIDDEN,
20  CAST_ERROR_UNAVAILABLE,
21  CAST_ERROR_INVALID,
22  CAST_ERROR_INTERNAL
23 };
24 
25 struct rtCastError {
26  rtCastError(rtError errRt = RT_OK, CastError errCast = CAST_ERROR_NONE) : errRt(errRt),errCast(errCast){}
27  rtError errRt;
28  CastError errCast;
29 };
30 
31 #define RTCAST_ERROR_NONE(v) ((v).errRt==RT_OK && (v).errCast==CAST_ERROR_NONE)
32 #define RTCAST_ERROR_RT(v) ((v).errRt)
33 #define RTCAST_ERROR_CAST(v) ((v).errCast)
34 
35 
37 {
38  rtDeclareObject(rtCastRemoteObject, rtAbstractService);
39 
40 public:
41  rtCastRemoteObject(rtString SERVICE_NAME) : rtAbstractService(SERVICE_NAME){}
42  ~rtCastRemoteObject() {}
43 
44  rtMethod1ArgAndNoReturn("onApplicationStateChanged", applicationStateChanged, rtObjectRef);
45  virtual rtError applicationStateChanged(const rtObjectRef& params){ printf("applicationStateChanged rtCastRemoteObject");}
46 
47  /*
48  * rtCast implementation should emit these events:
49  * onApplicationLaunchRequest
50  * onApplicationStopRequest
51  * onApplicationHideRequest
52  * onApplicationResumeRequest
53  * onApplicationStatusRequest
54  * For details please reference XCAST spec
55  */
56 };
57 
58 
59 #endif //RT_CAST_H
rtCastError
Definition: rtcast.hpp:25
rtAbstractService
Definition: rtabstractservice.h:24
rtCastRemoteObject
Definition: rtcast.hpp:36