summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/EPG.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2020-07-02 23:09:26 +0200
committermanuel <manuel@mausz.at>2020-07-02 23:09:26 +0200
commit5f8335c1e49ce108ef3481863833c98efa00411b (patch)
treef02b5c1c9765bb6a14c8eb42bb4f81b9face0b55 /xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/EPG.h
parente317daf081a1048904fdf0b548946fa3ba6593a7 (diff)
downloadkodi-pvr-build-5f8335c1e49ce108ef3481863833c98efa00411b.tar.gz
kodi-pvr-build-5f8335c1e49ce108ef3481863833c98efa00411b.tar.bz2
kodi-pvr-build-5f8335c1e49ce108ef3481863833c98efa00411b.zip
sync with upstreamHEADmaster
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/EPG.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/EPG.h500
1 files changed, 500 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/EPG.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/EPG.h
new file mode 100644
index 0000000..e1fc04f
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/EPG.h
@@ -0,0 +1,500 @@
1/*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#include "../../AddonBase.h"
12#include "../../c-api/addon-instance/pvr.h"
13
14//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
15// "C++" Definitions group 4 - PVR EPG
16#ifdef __cplusplus
17
18namespace kodi
19{
20namespace addon
21{
22
23//==============================================================================
24/// @defgroup cpp_kodi_addon_pvr_Defs_epg_PVREPGTag class PVREPGTag
25/// @ingroup cpp_kodi_addon_pvr_Defs_epg
26/// @brief **PVR add-on EPG data tag**\n
27/// Representation of an EPG event.
28///
29/// Herewith all EPG related data are saved in one class whereby the data can
30/// be exchanged with Kodi, or can also be used on the addon to save there.
31///
32/// See @ref cpp_kodi_addon_pvr_EPGTag "EPG methods" about usage.
33///
34/// ----------------------------------------------------------------------------
35///
36/// @copydetails cpp_kodi_addon_pvr_Defs_epg_PVREPGTag_Help
37///
38///@{
39class PVREPGTag : public CStructHdl<PVREPGTag, EPG_TAG>
40{
41 friend class CInstancePVRClient;
42
43public:
44 /*! \cond PRIVATE */
45 PVREPGTag()
46 {
47 memset(m_cStructure, 0, sizeof(EPG_TAG));
48 m_cStructure->iSeriesNumber = EPG_TAG_INVALID_SERIES_EPISODE;
49 m_cStructure->iEpisodeNumber = EPG_TAG_INVALID_SERIES_EPISODE;
50 m_cStructure->iEpisodePartNumber = EPG_TAG_INVALID_SERIES_EPISODE;
51 }
52 PVREPGTag(const PVREPGTag& epg) : CStructHdl(epg)
53 {
54 m_title = epg.m_title;
55 m_plotOutline = epg.m_plotOutline;
56 m_plot = epg.m_plot;
57 m_originalTitle = epg.m_originalTitle;
58 m_cast = epg.m_cast;
59 m_director = epg.m_director;
60 m_writer = epg.m_writer;
61 m_IMDBNumber = epg.m_IMDBNumber;
62 m_iconPath = epg.m_iconPath;
63 m_genreDescription = epg.m_genreDescription;
64 m_episodeName = epg.m_episodeName;
65 m_seriesLink = epg.m_seriesLink;
66 m_firstAired = epg.m_firstAired;
67 }
68 /*! \endcond */
69
70
71 /// @defgroup cpp_kodi_addon_pvr_Defs_epg_PVREPGTag_Help Value Help
72 /// @ingroup cpp_kodi_addon_pvr_Defs_epg_PVREPGTag
73 ///
74 /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_pvr_Defs_epg_PVREPGTag :</b>
75 /// | Name | Type | Set call | Get call | Usage
76 /// |------|------|----------|----------|---------
77 /// | **Unique broadcast id** | `unsigned int` | @ref PVREPGTag::SetUniqueBroadcastId "SetUniqueBroadcastId" | @ref PVREPGTag::GetUniqueBroadcastId "GetUniqueBroadcastId" | *required to set*
78 /// | **Unique channel id** | `unsigned int` | @ref PVREPGTag::SetUniqueChannelId "SetUniqueChannelId" | @ref PVREPGTag::GetUniqueChannelId "GetUniqueChannelId" | *required to set*
79 /// | **Title** | `std::string` | @ref PVREPGTag::SetTitle "SetTitle" | @ref PVREPGTag::GetTitle "GetTitle" | *required to set*
80 /// | **Start time** | `time_t` | @ref PVREPGTag::SetStartTime "SetStartTime" | @ref PVREPGTag::GetStartTime "GetStartTime" | *required to set*
81 /// | **End time** | `time_t` | @ref PVREPGTag::SetEndTime "SetEndTime" | @ref PVREPGTag::GetEndTime "GetEndTime" | *required to set*
82 /// | **Plot outline** | `std::string` | @ref PVREPGTag::SetPlotOutline "SetPlotOutline" | @ref PVREPGTag::GetPlotOutline "GetPlotOutline" | *optional*
83 /// | **Plot** | `std::string` | @ref PVREPGTag::SetPlot "SetPlot" | @ref PVREPGTag::GetPlot "GetPlot" | *optional*
84 /// | **Original title** | `std::string` | @ref PVREPGTag::SetOriginalTitle "SetOriginalTitle" | @ref PVREPGTag::GetOriginalTitle "GetOriginalTitle" | *optional*
85 /// | **Cast** | `std::string` | @ref PVREPGTag::SetCast "SetCast" | @ref PVREPGTag::GetCast "GetCast" | *optional*
86 /// | **Director** | `std::string` | @ref PVREPGTag::SetDirector "SetDirector" | @ref PVREPGTag::GetDirector "GetDirector" | *optional*
87 /// | **Writer** | `std::string` | @ref PVREPGTag::SetWriter "SetWriter" | @ref PVREPGTag::GetWriter "GetWriter" | *optional*
88 /// | **Year** | `int` | @ref PVREPGTag::SetYear "SetYear" | @ref PVREPGTag::GetYear "GetYear" | *optional*
89 /// | **IMDB number** | `std::string` | @ref PVREPGTag::SetIMDBNumber "SetIMDBNumber" | @ref PVREPGTag::GetIMDBNumber "GetIMDBNumber" | *optional*
90 /// | **Icon path** | `std::string` | @ref PVREPGTag::SetIconPath "SetIconPath" | @ref PVREPGTag::GetIconPath "GetIconPath" | *optional*
91 /// | **Genre type** | `int` | @ref PVREPGTag::SetGenreType "SetGenreType" | @ref PVREPGTag::GetGenreType "GetGenreType" | *optional*
92 /// | **Genre sub type** | `int` | @ref PVREPGTag::SetGenreSubType "SetGenreSubType" | @ref PVREPGTag::GetGenreSubType "GetGenreSubType" | *optional*
93 /// | **Genre description** | `std::string` | @ref PVREPGTag::SetGenreDescription "SetGenreDescription" | @ref PVREPGTag::GetGenreDescription "GetGenreDescription" | *optional*
94 /// | **First aired** | `time_t` | @ref PVREPGTag::SetFirstAired "SetFirstAired" | @ref PVREPGTag::GetFirstAired "GetFirstAired" | *optional*
95 /// | **Parental rating** | `int` | @ref PVREPGTag::SetParentalRating "SetParentalRating" | @ref PVREPGTag::GetParentalRating "GetParentalRating" | *optional*
96 /// | **Star rating** | `int` | @ref PVREPGTag::SetStarRating "SetStarRating" | @ref PVREPGTag::GetStarRating "GetStarRating" | *optional*
97 /// | **Series number** | `int` | @ref PVREPGTag::SetSeriesNumber "SetSeriesNumber" | @ref PVREPGTag::GetSeriesNumber "GetSeriesNumber" | *optional*
98 /// | **Episode number** | `int` | @ref PVREPGTag::SetEpisodeNumber "SetEpisodeNumber" | @ref PVREPGTag::GetEpisodeNumber "GetEpisodeNumber" | *optional*
99 /// | **Episode part number** | `int` | @ref PVREPGTag::SetEpisodePartNumber "SetEpisodePartNumber" | @ref PVREPGTag::GetEpisodePartNumber "GetEpisodePartNumber" | *optional*
100 /// | **Episode name** | `std::string` | @ref PVREPGTag::SetEpisodeName "SetEpisodeName" | @ref PVREPGTag::GetEpisodeName "GetEpisodeName" | *optional*
101 /// | **Flags** | `unsigned int` | @ref PVREPGTag::SetFlags "SetFlags" | @ref PVREPGTag::GetFlags "GetFlags" | *optional*
102 /// | **Series link** | `std::string` | @ref PVREPGTag::SetSeriesLink "SetSeriesLink" | @ref PVREPGTag::GetSeriesLink "GetSeriesLink" | *optional*
103 ///
104
105 /// @addtogroup cpp_kodi_addon_pvr_Defs_epg_PVREPGTag
106 ///@{
107
108 /// @brief **required**\n
109 /// Identifier for this event. Event uids must be unique for a channel. Valid uids must be greater than @ref EPG_TAG_INVALID_UID.
110 void SetUniqueBroadcastId(unsigned int uniqueBroadcastId)
111 {
112 m_cStructure->iUniqueBroadcastId = uniqueBroadcastId;
113 }
114
115 /// @brief To get with @ref SetUniqueBroadcastId changed values.
116 unsigned int GetUniqueBroadcastId() const { return m_cStructure->iUniqueBroadcastId; }
117
118 /// @brief **required**\n
119 /// Unique identifier of the channel this event belongs to.
120 void SetUniqueChannelId(unsigned int uniqueChannelId)
121 {
122 m_cStructure->iUniqueChannelId = uniqueChannelId;
123 }
124
125 /// @brief To get with @ref SetUniqueChannelId changed values
126 unsigned int GetUniqueChannelId() const { return m_cStructure->iUniqueChannelId; }
127
128 /// @brief **required**\n
129 /// This event's title.
130 void SetTitle(const std::string& title) { m_title = title; }
131
132 /// @brief To get with @ref SetTitle changed values.
133 std::string GetTitle() const { return m_title; }
134
135 /// @brief **required**\n
136 /// Start time in UTC.
137 ///
138 /// Seconds elapsed since 00:00 hours, Jan 1, 1970 UTC.
139 void SetStartTime(time_t startTime) { m_cStructure->startTime = startTime; }
140
141 /// @brief To get with @ref SetStartTime changed values.
142 time_t GetStartTime() const { return m_cStructure->startTime; }
143
144 /// @brief **required**\n
145 /// End time in UTC.
146 ///
147 /// Seconds elapsed since 00:00 hours, Jan 1, 1970 UTC.
148 void SetEndTime(time_t endTime) { m_cStructure->endTime = endTime; }
149
150 /// @brief To get with @ref SetEndTime changed values.
151 time_t GetEndTime() const { return m_cStructure->endTime; }
152
153 /// @brief **optional**\n
154 /// Plot outline name.
155 void SetPlotOutline(const std::string& plotOutline) { m_plotOutline = plotOutline; }
156
157 /// @brief To get with @ref SetPlotOutline changed values.
158 std::string GetPlotOutline() const { return m_plotOutline; }
159
160 /// @brief **optional**\n
161 /// Plot name.
162 void SetPlot(const std::string& plot) { m_plot = plot; }
163
164 /// @brief To get with @ref GetPlot changed values.
165 std::string GetPlot() const { return m_plot; }
166
167 /// @brief **optional**\n
168 /// Original title.
169 void SetOriginalTitle(const std::string& originalTitle) { m_originalTitle = originalTitle; }
170
171 /// @brief To get with @ref SetOriginalTitle changed values
172 std::string GetOriginalTitle() const { return m_originalTitle; }
173
174 /// @brief **optional**\n
175 /// Cast name(s).
176 ///
177 /// @note Use @ref EPG_STRING_TOKEN_SEPARATOR to separate different persons.
178 void SetCast(const std::string& cast) { m_cast = cast; }
179
180 /// @brief To get with @ref SetCast changed values
181 std::string GetCast() const { return m_cast; }
182
183 /// @brief **optional**\n
184 /// Director name(s).
185 ///
186 /// @note Use @ref EPG_STRING_TOKEN_SEPARATOR to separate different persons.
187 void SetDirector(const std::string& director) { m_director = director; }
188
189 /// @brief To get with @ref SetDirector changed values.
190 std::string GetDirector() const { return m_director; }
191
192 /// @brief **optional**\n
193 /// Writer name(s).
194 ///
195 /// @note Use @ref EPG_STRING_TOKEN_SEPARATOR to separate different persons.
196 void SetWriter(const std::string& writer) { m_writer = writer; }
197
198 /// @brief To get with @ref SetDirector changed values
199 std::string GetWriter() const { return m_writer; }
200
201 /// @brief **optional**\n
202 /// Year.
203 void SetYear(int year) { m_cStructure->iYear = year; }
204
205 /// @brief To get with @ref SetYear changed values.
206 int GetYear() const { return m_cStructure->iYear; }
207
208 /// @brief **optional**\n
209 /// [IMDB](https://en.wikipedia.org/wiki/IMDb) identification number.
210 void SetIMDBNumber(const std::string& IMDBNumber) { m_IMDBNumber = IMDBNumber; }
211
212 /// @brief To get with @ref SetIMDBNumber changed values.
213 std::string GetIMDBNumber() const { return m_IMDBNumber; }
214
215 /// @brief **optional**\n
216 /// Icon path.
217 void SetIconPath(const std::string& iconPath) { m_iconPath = iconPath; }
218
219 /// @brief To get with @ref SetIconPath changed values.
220 std::string GetIconPath() const { return m_iconPath; }
221
222 /// @brief **optional**\n
223 /// Genre type.
224 ///
225 /// --------------------------------------------------------------------------
226 ///
227 /// @copydetails EPG_EVENT_CONTENTMASK
228 ///
229 /// Use @ref EPG_GENRE_USE_STRING if type becomes given by @ref SetGenreDescription.
230 ///
231 /// @note If confirmed that backend brings the types in [ETSI EN 300 468](https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.14.01_60/en_300468v011401p.pdf)
232 /// conform values, can be @ref EPG_EVENT_CONTENTMASK ignored and to set here
233 /// with backend value.
234 ///
235 ///
236 /// --------------------------------------------------------------------------
237 ///
238 /// **Example 1:**
239 /// ~~~~~~~~~~~~~{.cpp}
240 /// kodi::addon::PVREPGTag tag;
241 /// tag.SetGenreType(EPG_EVENT_CONTENTMASK_MOVIEDRAMA);
242 /// ~~~~~~~~~~~~~
243 ///
244 /// --------------------------------------------------------------------------
245 ///
246 /// **Example 2** (in case of other, not ETSI EN 300 468 conform genre types):
247 /// ~~~~~~~~~~~~~{.cpp}
248 /// kodi::addon::PVREPGTag tag;
249 /// tag.SetGenreType(EPG_GENRE_USE_STRING);
250 /// tag.SetGenreDescription("My special genre name"); // Should use (if possible) kodi::GetLocalizedString(...) to have match user language.
251 /// ~~~~~~~~~~~~~
252 ///
253 void SetGenreType(int genreType) { m_cStructure->iGenreType = genreType; }
254
255 /// @brief To get with @ref SetGenreType changed values
256 int GetGenreType() const { return m_cStructure->iGenreType; }
257
258 /// @brief **optional**\n
259 /// Genre sub type.
260 ///
261 /// @copydetails EPG_EVENT_CONTENTMASK
262 ///
263 /// Subtypes groups related to set by @ref SetGenreType:
264 /// | Main genre type | List with available sub genre types
265 /// |-----------------|-----------------------------------------
266 /// | @ref EPG_EVENT_CONTENTMASK_UNDEFINED | Nothing, should be 0
267 /// | @ref EPG_EVENT_CONTENTMASK_MOVIEDRAMA | @ref EPG_EVENT_CONTENTSUBMASK_MOVIEDRAMA
268 /// | @ref EPG_EVENT_CONTENTMASK_NEWSCURRENTAFFAIRS | @ref EPG_EVENT_CONTENTSUBMASK_NEWSCURRENTAFFAIRS
269 /// | @ref EPG_EVENT_CONTENTMASK_SHOW | @ref EPG_EVENT_CONTENTSUBMASK_SHOW
270 /// | @ref EPG_EVENT_CONTENTMASK_SPORTS | @ref EPG_EVENT_CONTENTSUBMASK_SPORTS
271 /// | @ref EPG_EVENT_CONTENTMASK_CHILDRENYOUTH | @ref EPG_EVENT_CONTENTSUBMASK_CHILDRENYOUTH
272 /// | @ref EPG_EVENT_CONTENTMASK_MUSICBALLETDANCE | @ref EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE
273 /// | @ref EPG_EVENT_CONTENTMASK_ARTSCULTURE | @ref EPG_EVENT_CONTENTSUBMASK_ARTSCULTURE
274 /// | @ref EPG_EVENT_CONTENTMASK_SOCIALPOLITICALECONOMICS | @ref EPG_EVENT_CONTENTSUBMASK_SOCIALPOLITICALECONOMICS
275 /// | @ref EPG_EVENT_CONTENTMASK_EDUCATIONALSCIENCE | @ref EPG_EVENT_CONTENTSUBMASK_EDUCATIONALSCIENCE
276 /// | @ref EPG_EVENT_CONTENTMASK_LEISUREHOBBIES | @ref EPG_EVENT_CONTENTSUBMASK_LEISUREHOBBIES
277 /// | @ref EPG_EVENT_CONTENTMASK_SPECIAL | @ref EPG_EVENT_CONTENTSUBMASK_SPECIAL
278 /// | @ref EPG_EVENT_CONTENTMASK_USERDEFINED | Can be defined by you
279 /// | @ref EPG_GENRE_USE_STRING | **Kodi's own value**, which declares that the type with @ref SetGenreDescription is given.
280 ///
281 /// --------------------------------------------------------------------------
282 ///
283 /// **Example:**
284 /// ~~~~~~~~~~~~~{.cpp}
285 /// kodi::addon::PVREPGTag tag;
286 /// tag.SetGenreType(EPG_EVENT_CONTENTMASK_MUSICBALLETDANCE);
287 /// tag.SetGenreSubType(EPG_EVENT_CONTENTSUBMASK_MUSICBALLETDANCE_JAZZ);
288 /// ~~~~~~~~~~~~~
289 ///
290 void SetGenreSubType(int genreSubType) { m_cStructure->iGenreSubType = genreSubType; }
291
292 /// @brief To get with @ref SetGenreSubType changed values.
293 int GetGenreSubType() const { return m_cStructure->iGenreSubType; }
294
295 /// @brief **optional**\n genre. Will be used only when genreType == @ref EPG_GENRE_USE_STRING
296 /// or genreSubType == @ref EPG_GENRE_USE_STRING.
297 ///
298 /// Use @ref EPG_STRING_TOKEN_SEPARATOR to separate different genres.
299 ///
300 /// In case of other, not [ETSI EN 300 468](https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.14.01_60/en_300468v011401p.pdf)
301 /// conform genre types or something special.
302 ///
303 /// --------------------------------------------------------------------------
304 ///
305 /// **Example:**
306 /// ~~~~~~~~~~~~~{.cpp}
307 /// kodi::addon::PVREPGTag tag;
308 /// tag.SetGenreType(EPG_GENRE_USE_STRING);
309 /// tag.SetGenreDescription("Action" + EPG_STRING_TOKEN_SEPARATOR + "Thriller");
310 /// ~~~~~~~~~~~~~
311 ///
312 void SetGenreDescription(const std::string& genreDescription)
313 {
314 m_genreDescription = genreDescription;
315 }
316
317 /// @brief To get with @ref SetGenreDescription changed values.
318 std::string GetGenreDescription() const { return m_genreDescription; }
319
320 /// @brief **optional**\n
321 /// First aired in UTC.
322 void SetFirstAired(const std::string& firstAired) { m_firstAired = firstAired; }
323
324 /// @brief To get with @ref SetFirstAired changed values.
325 std::string GetFirstAired() const { return m_firstAired; }
326
327 /// @brief **optional**\n
328 /// Parental rating.
329 void SetParentalRating(int parentalRating) { m_cStructure->iParentalRating = parentalRating; }
330
331 /// @brief To get with @ref SetParentalRatinge changed values.
332 int GetParentalRating() const { return m_cStructure->iParentalRating; }
333
334 /// @brief **optional**\n
335 /// Star rating.
336 void SetStarRating(int starRating) { m_cStructure->iStarRating = starRating; }
337
338 /// @brief To get with @ref SetStarRating changed values.
339 int GetStarRating() const { return m_cStructure->iStarRating; }
340
341 /// @brief **optional**\n
342 /// Series number.
343 void SetSeriesNumber(int seriesNumber) { m_cStructure->iSeriesNumber = seriesNumber; }
344
345 /// @brief To get with @ref SetSeriesNumber changed values.
346 int GetSeriesNumber() const { return m_cStructure->iSeriesNumber; }
347
348 /// @brief **optional**\n
349 /// Episode number.
350 void SetEpisodeNumber(int episodeNumber) { m_cStructure->iEpisodeNumber = episodeNumber; }
351
352 /// @brief To get with @ref SetEpisodeNumber changed values.
353 int GetEpisodeNumber() const { return m_cStructure->iEpisodeNumber; }
354
355 /// @brief **optional**\n
356 /// Episode part number.
357 void SetEpisodePartNumber(int episodePartNumber)
358 {
359 m_cStructure->iEpisodePartNumber = episodePartNumber;
360 }
361
362 /// @brief To get with @ref SetEpisodePartNumber changed values.
363 int GetEpisodePartNumber() const { return m_cStructure->iEpisodePartNumber; }
364
365 /// @brief **optional**\n
366 /// Episode name.
367 void SetEpisodeName(const std::string& episodeName) { m_episodeName = episodeName; }
368
369 /// @brief To get with @ref SetEpisodeName changed values.
370 std::string GetEpisodeName() const { return m_episodeName; }
371
372 /// @brief **optional**\n
373 /// Bit field of independent flags associated with the EPG entry.
374 ///
375 /// See @ref cpp_kodi_addon_pvr_Defs_epg_EPG_TAG_FLAG for available bit flags.
376 ///
377 /// --------------------------------------------------------------------------
378 ///
379 /// @copydetails cpp_kodi_addon_pvr_Defs_epg_EPG_TAG_FLAG
380 ///
381 void SetFlags(unsigned int flags) { m_cStructure->iFlags = flags; }
382
383 /// @brief To get with @ref SetFlags changed values.
384 unsigned int GetFlags() const { return m_cStructure->iFlags; }
385
386 /// @brief **optional**\n
387 /// Series link for this event.
388 void SetSeriesLink(const std::string& seriesLink) { m_seriesLink = seriesLink; }
389
390 /// @brief To get with @ref SetSeriesLink changed values.
391 std::string GetSeriesLink() const { return m_seriesLink; }
392
393 ///@}
394
395 // Internal used, as this have own memory for strings and to translate them to "C"
396 EPG_TAG* GetTag() const
397 {
398 m_cStructure->strTitle = m_title.c_str();
399 m_cStructure->strPlotOutline = m_plotOutline.c_str();
400 m_cStructure->strPlot = m_plot.c_str();
401 m_cStructure->strOriginalTitle = m_originalTitle.c_str();
402 m_cStructure->strCast = m_cast.c_str();
403 m_cStructure->strDirector = m_director.c_str();
404 m_cStructure->strWriter = m_writer.c_str();
405 m_cStructure->strIMDBNumber = m_IMDBNumber.c_str();
406 m_cStructure->strIconPath = m_iconPath.c_str();
407 m_cStructure->strGenreDescription = m_genreDescription.c_str();
408 m_cStructure->strEpisodeName = m_episodeName.c_str();
409 m_cStructure->strSeriesLink = m_seriesLink.c_str();
410 m_cStructure->strFirstAired = m_firstAired.c_str();
411
412 return m_cStructure;
413 }
414
415private:
416 PVREPGTag(const EPG_TAG* epg) : CStructHdl(epg) { SetData(epg); }
417 PVREPGTag(EPG_TAG* epg) : CStructHdl(epg) { SetData(epg); }
418
419 const PVREPGTag& operator=(const PVREPGTag& right);
420 const PVREPGTag& operator=(const EPG_TAG& right);
421 operator EPG_TAG*();
422
423 std::string m_title;
424 std::string m_plotOutline;
425 std::string m_plot;
426 std::string m_originalTitle;
427 std::string m_cast;
428 std::string m_director;
429 std::string m_writer;
430 std::string m_IMDBNumber;
431 std::string m_episodeName;
432 std::string m_iconPath;
433 std::string m_seriesLink;
434 std::string m_genreDescription;
435 std::string m_firstAired;
436
437 void SetData(const EPG_TAG* tag)
438 {
439 m_title = tag->strTitle == nullptr ? "" : tag->strTitle;
440 m_plotOutline = tag->strPlotOutline == nullptr ? "" : tag->strPlotOutline;
441 m_plot = tag->strPlot == nullptr ? "" : tag->strPlot;
442 m_originalTitle = tag->strOriginalTitle == nullptr ? "" : tag->strOriginalTitle;
443 m_cast = tag->strCast == nullptr ? "" : tag->strCast;
444 m_director = tag->strDirector == nullptr ? "" : tag->strDirector;
445 m_writer = tag->strWriter == nullptr ? "" : tag->strWriter;
446 m_IMDBNumber = tag->strIMDBNumber == nullptr ? "" : tag->strIMDBNumber;
447 m_iconPath = tag->strIconPath == nullptr ? "" : tag->strIconPath;
448 m_genreDescription = tag->strGenreDescription == nullptr ? "" : tag->strGenreDescription;
449 m_episodeName = tag->strEpisodeName == nullptr ? "" : tag->strEpisodeName;
450 m_seriesLink = tag->strSeriesLink == nullptr ? "" : tag->strSeriesLink;
451 m_firstAired = tag->strFirstAired == nullptr ? "" : tag->strFirstAired;
452 }
453};
454///@}
455//------------------------------------------------------------------------------
456
457//==============================================================================
458/// @defgroup cpp_kodi_addon_pvr_Defs_epg_PVREPGTagsResultSet class PVREPGTagsResultSet
459/// @ingroup cpp_kodi_addon_pvr_Defs_epg_PVREPGTag
460/// @brief **PVR add-on EPG entry transfer class**\n
461/// To transfer the content of @ref kodi::addon::CInstancePVRClient::GetEPGForChannel().
462///
463/// @note This becomes only be used on addon call above, not usable outside on
464/// addon itself.
465///@{
466class PVREPGTagsResultSet
467{
468public:
469 /*! \cond PRIVATE */
470 PVREPGTagsResultSet() = delete;
471 PVREPGTagsResultSet(const AddonInstance_PVR* instance, ADDON_HANDLE handle)
472 : m_instance(instance), m_handle(handle)
473 {
474 }
475 /*! \endcond */
476
477 /// @addtogroup cpp_kodi_addon_pvr_Defs_epg_PVREPGTagsResultSet
478 ///@{
479
480 /// @brief To add and give content from addon to Kodi on related call.
481 ///
482 /// @param[in] tag The to transferred data.
483 void Add(const kodi::addon::PVREPGTag& tag)
484 {
485 m_instance->toKodi->TransferEpgEntry(m_instance->toKodi->kodiInstance, m_handle, tag.GetTag());
486 }
487
488 ///@}
489
490private:
491 const AddonInstance_PVR* m_instance = nullptr;
492 const ADDON_HANDLE m_handle;
493};
494///@}
495//------------------------------------------------------------------------------
496
497} /* namespace addon */
498} /* namespace kodi */
499
500#endif /* __cplusplus */