You.i Engine
YiNullInterface.h
Go to the documentation of this file.
1 // © You i Labs Inc. All rights reserved.
2 #ifndef _YI_NULL_INTERFACE_H_
3 #define _YI_NULL_INTERFACE_H_
4 
6 
18 {
19 public:
20  CYINullInterface() = default;
21  virtual ~CYINullInterface(){};
22 
23  virtual bool IsCloudServer() override { return false; }
24  virtual bool IsUsingNullRenderer() const override { return true; }
25 
26  virtual bool SendFocusMap(CYISceneManager * = nullptr) override { return true; }
27 
28  virtual bool SetExportHint(CYISceneNode *, const CYIString &, const CYIString &) override { return true; }
29 
31 
33 
34  virtual void SetInitalScrollIndexWithFocus(CYIListView *, uint32_t) override {}
35 
36  virtual bool SetVideoNodeProperties(const CYIBundle &) override { return true; }
37  virtual bool SetVideoSurfaceProperties(const CYIBundle &, CYIVideoSurfaceView *) override { return true; }
38 
40  {
42  return info;
43  }
44 
45  virtual void SetFocusOnSceneNode(const CYISceneNode *) override {}
46  virtual void ClearClientFocus() override {}
47  virtual bool IsLowEndDevice() override { return false; }
48  virtual void InvokeCommand(const CYIString, const CYIBundle &, CYIClientCallback) override {}
49 
50  virtual const CYIString &GetClientExternalIp() const override { return CYIString::EmptyString(); }
51  virtual const CYIString &GetClientLocalIp() const override { return CYIString::EmptyString(); }
52  virtual const glm::vec2 GetClientUIResolution() const override { return {0, 0}; }
53  virtual void TerminateApplication() override {}
54  virtual void SetDisconnectOnInactivityEnabled(bool) override{};
55 
56  virtual void ShowWaitSpinnerNow() override {}
57 
58  virtual void SetSpinnerDelayMs(uint32_t) override {}
59 
60  virtual void ShowWaitSpinner() override {}
61  virtual void HideWaitSpinner() override {}
62  virtual void SetWaitSpinnerAccessibilityAttributes(CYIAccessibilityAttributes::Accessible, std::unique_ptr<const CYIAccessibilityAttributes>) override {}
63 
64  virtual void AddModalScene(const CYIString &, const CYISceneNode *, int32_t = 0, std::set<CYIString> = std::set<CYIString>()) override {}
65 
66  virtual void RemoveModalScene(const CYIString &) override {}
67 
68  virtual void SendScrollToNode(const CYIScrollingView *, const CYISceneNode *) override {}
69 
70  virtual void SendScrollingTextViewUpdate(const CYISceneNode *, const CYIString &, const CYIString &) override {}
71 
72  virtual void SetDefaultCloudKeyboardTitle(const CYIString &) override {}
73 
74  virtual const CYIString &GetDefaultCloudKeyboardTitle() const override { return CYIString::EmptyString(); }
75 
76  virtual uint64_t RegisterDataListener(CYIString eventId, std::function<bool(CYIString eventId, const yi::rapidjson::Document *pEvent)> handler) override
77  {
78  YI_UNUSED(eventId);
79  YI_UNUSED(handler);
80  return 0;
81  }
82 
83  virtual void UnregisterDataListener(CYIString eventId, uint64_t listenerId) override
84  {
85  YI_UNUSED(eventId);
86  YI_UNUSED(listenerId);
87  }
88 
89  virtual void RegisterPersistentStore(const CYIString &, CYIPersistentStore *) override {}
90 
91  virtual void UnregisterPersistentStore(CYIPersistentStore *) override {}
92 
93  virtual void SendRokuAnalyticsEvent(const CYIString &, const CYIString &) override {}
94 
95  virtual void GetIAPCustomerUID(std::function<void(const CloudIAPRequestStatus &, const CloudIAPCustomerUID &)>) override {}
96  virtual void GetChannelCredentials(std::function<void(const CloudIAPRequestStatus &, const CloudIAPChannelCredentials &channelCredentials)>) override {}
97  virtual void SaveChannelCredentials(const CYIString &, std::function<void(const CloudIAPRequestStatus &status)>) override {}
98  virtual void GetIAPUser(std::function<void(const CloudIAPRequestStatus &, const CloudIAPUser &)>) override {}
99  virtual void GetAvailableProducts(std::function<void(const CloudIAPRequestStatus &, const std::vector<std::shared_ptr<CloudIAPProduct>> &)>) override {}
100  virtual void GetUserPurchases(std::function<void(const CloudIAPRequestStatus &, const std::vector<std::shared_ptr<CloudIAPPurchase>> &)>) override {}
101  virtual void RequestPurchase(const CYIString &, std::function<void(const CloudIAPRequestStatus &, const CloudIAPReceipt &)>) override {}
102 
104 
105  virtual bool SetVideoPlayerColor(CYIAbstractVideoPlayer *, const CYIColor &) override { return false; }
106 
107  virtual void SendStopVideo() override {}
108 
109  virtual bool ConfigureContentOverlay(const CYIContentOverlay::Configuration &) override { return false; }
110 
111  virtual bool ContentOverlaySetState(const CYISceneView *, const CYIContentOverlay::State &) override { return false; }
112 
113  virtual void SendStopAnimation(const CYIString &, const CYISceneNode *) override {}
114 
115  virtual void SendEpgContent(CYISceneNode *, const CloudEpgContentModel &) override {}
116 
117  virtual void SendFocusEpgProgram(CYISceneNode *, const CYIString &, const int64_t) override {}
118 
119  virtual void ReplaceSubtree(const CYISceneNode *, bool) override {}
120 
121  virtual void SendErrorMessage(const CYIString &) override {}
122 
123  virtual void PauseExportUpdates() override {}
124  virtual void ResumeExportUpdates() override {}
125  virtual bool AreExportUpdatesPaused() override { return false; }
126 
127  virtual void SetNavigationPersistenceKey(const CYIString &) override {}
128  virtual const CYIString &GetStatus() const override { return CYIString::EmptyString(); }
129  virtual const CYIString &GetSavedInstanceState() const override { return CYIString::EmptyString(); }
130  virtual void SaveInstanceState(const CYIString &) override {}
131 
132  virtual void EnqueuePostExportAction(std::function<void()>) override
133  {
134  }
135 
136  virtual std::shared_ptr<CYIPersistentStore> FindUnusedPersistentStore(const CYIString &) override { return nullptr; }
137 
138  virtual void SendAppBeacon(const CYIString &) override {}
139 
140 protected:
141  virtual void AddUnusedPersistentStoreData(const CYIString &, yi::rapidjson::Value *) override {}
142 };
143 
146 #endif
virtual void ResumeExportUpdates() override
Resumes the automatic export process. Changes to the scene tree will again result in automated export...
Definition: YiNullInterface.h:124
virtual ~CYINullInterface()
Definition: YiNullInterface.h:21
virtual void SetNavigationPersistenceKey(const CYIString &) override
Sets the persistence key for the navigate state. App will save the navigation history only if this ge...
Definition: YiNullInterface.h:127
virtual void SendRokuAnalyticsEvent(const CYIString &, const CYIString &) override
Send the given event and paramaters to the Roku analytics framework.
Definition: YiNullInterface.h:93
CYINullInterface()=default
virtual void UnregisterDataListener(CYIString eventId, uint64_t listenerId) override
Unregister a data listener so that it no longer receives client data.
Definition: YiNullInterface.h:83
virtual bool IsCloudServer() override
Returns true if the implementation is a cloud server.
Definition: YiNullInterface.h:23
Structure identifying the recently played session information if it&#39;s available.
Definition: YiClientPlayer.h:58
The CYIPersistentStore class manages storing and retrieving application state data.
Definition: YiPersistentStore.h:61
Scene trees composed of CYISceneNode objects are registered with the scene manager in order for them ...
Definition: YiSceneManager.h:82
virtual void TerminateApplication() override
Terminate the Application and return to the home screen.
Definition: YiNullInterface.h:53
The base class for all view types. Views are containers of renderable elements that often define inte...
Definition: YiSceneView.h:46
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:32
virtual void UnregisterPersistentStore(CYIPersistentStore *) override
Unregister the given persistent object so that it is no longer synchronized with the client...
Definition: YiNullInterface.h:91
virtual void SetDisconnectOnInactivityEnabled(bool) override
Sets whether disconnect on inactivity is enabled or disabled for the application. ...
Definition: YiNullInterface.h:54
virtual bool ConfigureContentOverlay(const CYIContentOverlay::Configuration &) override
Configure the content overlay with required properties.
Definition: YiNullInterface.h:109
virtual void SendStopAnimation(const CYIString &, const CYISceneNode *) override
Sends a message to the client to stop the given animation.
Definition: YiNullInterface.h:113
virtual bool SetVideoSurfaceProperties(const CYIBundle &, CYIVideoSurfaceView *) override
Set the video surface view properties.
Definition: YiNullInterface.h:37
CYIBundle represents a collection of key-value pairs.
Definition: YiBundle.h:46
virtual void InvokeCommand(const CYIString, const CYIBundle &, CYIClientCallback) override
Invoke custom client command.
Definition: YiNullInterface.h:48
virtual bool SetVideoPlayerColor(CYIAbstractVideoPlayer *, const CYIColor &) override
Set the color of the video player controls. Note: Must be called after a video surface view has been ...
Definition: YiNullInterface.h:105
virtual void SendAppBeacon(const CYIString &) override
Sends an app beacon of the provided name to the client.
Definition: YiNullInterface.h:138
virtual void RemoveModalScene(const CYIString &) override
Remove an overlay scene from the set of registered modals.
Definition: YiNullInterface.h:66
virtual bool ConfigureVideoDrawer(CYIAbstractVideoPlayer *, CYISceneNode *, const CYIClientPlayer::ContentDrawerAnimations &) override
Associate video drawer with player.
Definition: YiNullInterface.h:103
The cloud interface provides a binding to the Cloud SDK.
Definition: YiNullInterface.h:17
virtual void ShowWaitSpinnerNow() override
Show the wait spinner right away.
Definition: YiNullInterface.h:56
virtual void SaveChannelCredentials(const CYIString &, std::function< void(const CloudIAPRequestStatus &status)>) override
Request saving the client in-app purchase channel credentials. This is an asynchronous network operat...
Definition: YiNullInterface.h:97
virtual void SaveInstanceState(const CYIString &) override
Provide the stringified state of the application to be used when restarting the app instance...
Definition: YiNullInterface.h:130
virtual void RequestPurchase(const CYIString &, std::function< void(const CloudIAPRequestStatus &, const CloudIAPReceipt &)>) override
Definition: YiNullInterface.h:101
Structure identifying the settings for a cloud content overlay.
Definition: YiContentOverlay.h:17
static const CYIString & EmptyString()
virtual void SetWaitSpinnerAccessibilityAttributes(CYIAccessibilityAttributes::Accessible, std::unique_ptr< const CYIAccessibilityAttributes >) override
Configure CYIAccessibilityAttributes and accessibility of the Roku wait spinner.
Definition: YiNullInterface.h:62
virtual bool SendFocusMap(CYISceneManager *=nullptr) override
Send a generated focus map to the client.
Definition: YiNullInterface.h:26
virtual void SendFocusEpgProgram(CYISceneNode *, const CYIString &, const int64_t) override
Sends request focus to the specified program with given channel title and start time.
Definition: YiNullInterface.h:117
A class that provides streaming functionality in a scrolling view.
Definition: YiListView.h:35
virtual void GetUserPurchases(std::function< void(const CloudIAPRequestStatus &, const std::vector< std::shared_ptr< CloudIAPPurchase >> &)>) override
In app purchases request of user purchases This is an asynchronous network operation. The given responder will be invoked when complete.
Definition: YiNullInterface.h:100
Structure identifying the video content drawer animation names for In and Out.
Definition: YiClientPlayer.h:20
virtual const CYIString & GetDefaultCloudKeyboardTitle() const override
Get currently set default title for the cloud device.
Definition: YiNullInterface.h:74
An abstract video player that provides a basic interface that all subclasses must implement...
Definition: YiAbstractVideoPlayer.h:59
virtual void RegisterPersistentStore(const CYIString &, CYIPersistentStore *) override
Register the given persistent store object for synchronization with the client.
Definition: YiNullInterface.h:89
virtual void SetFocusOnSceneNode(const CYISceneNode *) override
Set client focus on the specified scene node.
Definition: YiNullInterface.h:45
virtual const CYIString & GetClientExternalIp() const override
Return the external IP of the client.
Definition: YiNullInterface.h:50
virtual bool AreExportUpdatesPaused() override
Returns true if the automatic export process is paused.
Definition: YiNullInterface.h:125
Abstract structure describing the user information.
Definition: YiCloudIAP.h:44
virtual uint64_t RegisterDataListener(CYIString eventId, std::function< bool(CYIString eventId, const yi::rapidjson::Document *pEvent)> handler) override
Register a data listener so that it may receive client data.
Definition: YiNullInterface.h:76
ListIncomingFocusStyle
Definition: YiCloudInterface.h:64
Abstract structure describing the receipt information.
Definition: YiCloudIAP.h:68
State
Enumeration that defines the different content overlay states.
Definition: YiContentOverlay.h:44
virtual void GetIAPUser(std::function< void(const CloudIAPRequestStatus &, const CloudIAPUser &)>) override
Definition: YiNullInterface.h:98
virtual void SendEpgContent(CYISceneNode *, const CloudEpgContentModel &) override
Sends updated EPG content data. Notes: The given node must be specified as an EPG Grid with EXPORT_CL...
Definition: YiNullInterface.h:115
virtual void HideWaitSpinner() override
Hide the wait spinner.
Definition: YiNullInterface.h:61
Cloud In App Purchase abstract interface.
Definition: YiCloudIAP.h:18
virtual const glm::vec2 GetClientUIResolution() const override
Returns the UI resolution of the client.
Definition: YiNullInterface.h:52
virtual void ReplaceSubtree(const CYISceneNode *, bool) override
Replace the given subtree on the client. A common use of this method is to update the content data of...
Definition: YiNullInterface.h:119
virtual bool SetVideoNodeProperties(const CYIBundle &) override
Add video node properties such as content metadata including DRM configuration, notificationInterval...
Definition: YiNullInterface.h:36
A scene node is the base type for all nodes which are used by the scene manager; it is an integral pa...
Definition: YiSceneNode.h:105
virtual const CYIClientPlayer::PlaybackSessionInfo & GetLastPlaybackSessionInfo() const override
Get the recently updated playback session information such as bookmark and audio/cc settings...
Definition: YiNullInterface.h:39
virtual bool IsLowEndDevice() override
Returns true if the device is low end.
Definition: YiNullInterface.h:47
virtual void GetChannelCredentials(std::function< void(const CloudIAPRequestStatus &, const CloudIAPChannelCredentials &channelCredentials)>) override
Definition: YiNullInterface.h:96
virtual void SetOutgoingFocusStyle(CYIListView *, ListOutgoingFocusStyle) override
Used to set up how focus will be calculated when list recieves focus from another item...
Definition: YiNullInterface.h:32
virtual void EnqueuePostExportAction(std::function< void()>) override
Enqueue an action that will execute after the next scene export.
Definition: YiNullInterface.h:132
virtual void SetDefaultCloudKeyboardTitle(const CYIString &) override
Set the title string that will be shown when the keyboard is displayed. The default title will be sup...
Definition: YiNullInterface.h:72
#define YI_UNUSED(param)
Definition: YiPredef.h:45
virtual const CYIString & GetStatus() const override
Gets the stringified cloud app status from client.
Definition: YiNullInterface.h:128
virtual const CYIString & GetSavedInstanceState() const override
Retrieve the stringified saved state.
Definition: YiNullInterface.h:129
virtual bool IsUsingNullRenderer() const override
Return true if the cloud sdk is using the null renderer.
Definition: YiNullInterface.h:24
Abstract structure describing the customer unique ID.
Definition: YiCloudIAP.h:28
The structure of cloud EPG content model.
Definition: YiCloudEpgGridView.h:45
virtual void SendScrollingTextViewUpdate(const CYISceneNode *, const CYIString &, const CYIString &) override
Update the text for a scrolling text view.
Definition: YiNullInterface.h:70
virtual bool SetExportHint(CYISceneNode *, const CYIString &, const CYIString &) override
Apply the given export hint to a scene node.
Definition: YiNullInterface.h:28
virtual void SendScrollToNode(const CYIScrollingView *, const CYISceneNode *) override
Scroll the given scrolling view to the provided node.
Definition: YiNullInterface.h:68
Abstract structure describing the channel credentials.
Definition: YiCloudIAP.h:36
Allows users to scroll and pan through content inside.
Definition: YiScrollingView.h:147
virtual void PauseExportUpdates() override
Pauses the automatic export process. Until resumed, changes to the scene tree will not result in auto...
Definition: YiNullInterface.h:123
virtual void AddUnusedPersistentStoreData(const CYIString &, yi::rapidjson::Value *) override
Adds data to the list of unused persistent store data.
Definition: YiNullInterface.h:141
virtual bool ContentOverlaySetState(const CYISceneView *, const CYIContentOverlay::State &) override
Attempt to set the content overlay to the provided state. Configured parameters for that state will b...
Definition: YiNullInterface.h:111
Accessible
The accessible type of the CYIAccessibilityAttributes class instance.
Definition: YiAccessibilityAttributes.h:31
virtual void GetAvailableProducts(std::function< void(const CloudIAPRequestStatus &, const std::vector< std::shared_ptr< CloudIAPProduct >> &)>) override
In app purchases request of available products for the channel This is an asynchronous network operat...
Definition: YiNullInterface.h:99
virtual void SetInitalScrollIndexWithFocus(CYIListView *, uint32_t) override
Call setInitalScrollIndexWithFocus to set the initial scroll index of the list. This method will also...
Definition: YiNullInterface.h:34
virtual std::shared_ptr< CYIPersistentStore > FindUnusedPersistentStore(const CYIString &) override
Retrieve a persistent store containing data that was not stored when the app is started.
Definition: YiNullInterface.h:136
std::function< void(bool, CYIBundle)> CYIClientCallback
Definition: YiCloudInterface.h:39
virtual void SetIncomingFocusStyle(CYIListView *, ListIncomingFocusStyle) override
Used to set up how focus will be calculated when list recieves focus from another item...
Definition: YiNullInterface.h:30
virtual void GetIAPCustomerUID(std::function< void(const CloudIAPRequestStatus &, const CloudIAPCustomerUID &)>) override
Definition: YiNullInterface.h:95
A class used to represent a color value.
Definition: YiColor.h:35
virtual void SendErrorMessage(const CYIString &) override
Send the given string to be displayed as a Roku error message.
Definition: YiNullInterface.h:121
virtual void SendStopVideo() override
Sends a &#39;stop&#39; command to the active video node.
Definition: YiNullInterface.h:107
virtual void ShowWaitSpinner() override
Show the wait spinner with configured delay.
Definition: YiNullInterface.h:60
virtual void AddModalScene(const CYIString &, const CYISceneNode *, int32_t=0, std::set< CYIString >=std::set< CYIString >()) override
Identify overlay scene to be exported with initial components.
Definition: YiNullInterface.h:64
ListOutgoingFocusStyle
Definition: YiCloudInterface.h:71
View representation of a CYIAbstractVideoPlayer&#39;s CYIVideoSurface.
Definition: YiVideoSurfaceView.h:32
virtual void ClearClientFocus() override
Clear the client&#39;s focus. The server will then push its own focus state once a view has focus...
Definition: YiNullInterface.h:46
The cloud interface provides a binding to the Cloud SDK.
Definition: YiCloudInterface.h:51
virtual void SetSpinnerDelayMs(uint32_t) override
Sets the time of spinner delay in milliseconds.
Definition: YiNullInterface.h:58
virtual const CYIString & GetClientLocalIp() const override
Return the local IP of the client.
Definition: YiNullInterface.h:51