You.i Engine
YiCloudEpgGridView.h
Go to the documentation of this file.
1 // © You i Labs Inc. All rights reserved.
2 #ifndef _YI_CLOUD_EPG_GRID_VIEW_H_
3 #define _YI_CLOUD_EPG_GRID_VIEW_H_
4 
6 #include <utility/YiString.h>
8 
14 {
16  int64_t playStart;
17  int64_t playDuration;
19 
20  CloudEpgProgramModel(const CYIString &titleParam, const int64_t startParam, const int64_t durationParam, const CYIString &urlParam)
21  : title(titleParam)
22  , playStart(startParam)
23  , playDuration(durationParam)
24  , iconUrl(urlParam)
25  {
26  }
27 };
28 
34 {
35  size_t index = std::numeric_limits<size_t>::max();
38  std::vector<CloudEpgProgramModel> shows;
39 };
40 
46 {
48  std::vector<CloudEpgChannelModel> channels;
49 };
50 
52 {
53 public:
58  {
59  DIRECTION_LEFT,
60  DIRECTION_RIGHT,
61  DIRECTION_UP,
62  DIRECTION_DOWN
63  };
64 
66  virtual ~CYIEpgGridView();
67 
71  virtual bool Init() override;
72 
76  void SetContentStartTimeInEpoch(int64_t contentStartTimeInEpoch);
77 
82  int64_t GetContentStartTimeInEpoch() const;
83 
87  void SetInitialVisibleTimeOffsetInSec(int64_t initialVisibleTimeOffsetInSec);
88 
93  int64_t GetInitialVisibleTimeOffsetInSec() const;
94 
98  void SetVisibleDurationInSec(int32_t visibleDurationInSec);
99 
104  int32_t GetVisibleDurationInSec() const;
105 
109  void SetNumberOfVisibleChannels(int32_t numberOfVisibleChannels);
110 
115  int32_t GetNumberOfVisibleChannels() const;
116 
120  void SetMaxDays(int32_t days);
121 
126  int32_t GetMaxDays() const;
127 
131  void SetFocusBitmapUrl(const CYIString &focusBitmapUrl);
132 
137  const CYIString &GetFocusBitmapUrl() const;
138 
142  void SetNowBarBitmapUrl(const CYIString &nowBarBitmapUrl);
143 
148  const CYIString &GetNowBarBitmapUrl() const;
149 
153  void SetProgramBackgroundBitmapUrl(const CYIString &programBackground);
154 
159  const CYIString &GetProgramBackgroundBitmapUrl() const;
160 
164  void SetProgramTitleFont(const CYIString &programTitleFont);
165 
170  const CYIString &GetProgramTitleFont() const;
171 
175  void SetProgramTitleColor(const CYIString &programTitleColor);
176 
181  const CYIString &GetProgramTitleColor() const;
182 
186  void SetProgramTitleFocusedColor(const CYIString &programTitleFocusedColor);
187 
192  const CYIString &GetProgramTitleFocusedColor() const;
193 
197  void SetEpgContent(const CloudEpgContentModel &content, const std::pair<CYIString, int64_t> &programToFocus = std::make_pair(CYIString::EmptyString(), 0));
198 
202  void FocusProgram(const std::pair<CYIString, int64_t> &program);
203 
211 
219 
224 
229 
230 private:
231  void OnDataRequested(const CYIEpgGridView::DataRequestDirection direction, const std::pair<CYIString, int64_t> &requestingProgram, const std::pair<CYIString, int64_t> &focusedProgram);
232  void OnCurrentTimeRequested(const CYIString &focusedChannelTitle);
233  void OnDataUpdated();
234 
235  void HandleEpgShowSelectionEvent(const yi::rapidjson::Document *pEvent);
236  void HandleEpgDataRequestedEvent(const yi::rapidjson::Document *pEvent);
237  void HandleEpgCurrentTimeRequestedEvent(const yi::rapidjson::Document *pEvent);
238  void HandleEpgDataUpdatedEvent(const yi::rapidjson::Document *pEvent);
239 
240  int64_t m_selectionHandlerId = 0;
241  int64_t m_requestedHandlerId = 0;
242  int64_t m_resetHandlerId = 0;
243  int64_t m_updatedHandlerId = 0;
244 
245  int64_t m_contentStartEpochTime = 0;
246  int64_t m_initialVisibleTimeOffsetInSec = 3600;
247  int32_t m_visibleDurationInSec = 9000;
248  int32_t m_numberOfVisibleChannels = 6;
249  int32_t m_maxDays = 7;
250  CYIString m_focusBitmapUrl;
251  CYIString m_nowBarBitmapUrl;
252  CYIString m_programBackgroundBitmapUrl;
253  CYIString m_programTitleFont;
254  CYIString m_programTitleColor;
255  CYIString m_programTitleFocusedColor;
256 
257  std::pair<CYIString, int64_t> m_lastProgramFocused;
258 
260 };
261 
262 #endif
int64_t playStart
Definition: YiCloudEpgGridView.h:16
CloudEpgProgramModel(const CYIString &titleParam, const int64_t startParam, const int64_t durationParam, const CYIString &urlParam)
Definition: YiCloudEpgGridView.h:20
The structure of cloud EPG channel model.
Definition: YiCloudEpgGridView.h:33
CYIString title
Definition: YiCloudEpgGridView.h:36
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:32
CYISignal< const DataRequestDirection, const std::pair< CYIString, int64_t > &, const std::pair< CYIString, int64_t > & > DataRequested
Notifies when the focus hits the boundary of the available data.
Definition: YiCloudEpgGridView.h:218
CYISignal< const CYIString &, const CYIString &, const int64_t > ProgramSelected
Notifies when a program is selected.
Definition: YiCloudEpgGridView.h:210
CYISignal DataUpdated
Notifies when the EPG data updated. App can set the focus to a desired program at the time...
Definition: YiCloudEpgGridView.h:228
static const CYIString & EmptyString()
The structure of cloud EPG show model.
Definition: YiCloudEpgGridView.h:13
int64_t playDuration
Definition: YiCloudEpgGridView.h:17
CYIString title
Definition: YiCloudEpgGridView.h:15
CYIString iconUrl
Definition: YiCloudEpgGridView.h:37
Definition: YiCloudEpgGridView.h:51
std::vector< CloudEpgProgramModel > shows
Definition: YiCloudEpgGridView.h:38
CYISignal< const CYIString & > CurrentTimeRequested
Notifies when the EPG has been reset to the current time, allowing the app to populate with appropria...
Definition: YiCloudEpgGridView.h:223
The structure of cloud EPG content model.
Definition: YiCloudEpgGridView.h:45
DataRequestDirection
defines the direction of requesting data.
Definition: YiCloudEpgGridView.h:57
int64_t contentStartTimeInEpoch
Definition: YiCloudEpgGridView.h:47
#define YI_TYPE_BASES(CLASS, BASES...)
Definition: YiRtti.h:259
std::vector< CloudEpgChannelModel > channels
Definition: YiCloudEpgGridView.h:48
Provides an implementation of a button which accepts user interaction in the form of a press and rele...
Definition: YiPushButtonView.h:34
CYIString iconUrl
Definition: YiCloudEpgGridView.h:18