summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/MenuHook.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/MenuHook.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/MenuHook.h130
1 files changed, 130 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/MenuHook.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/MenuHook.h
new file mode 100644
index 0000000..053a4d5
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/MenuHook.h
@@ -0,0 +1,130 @@
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/pvr_menu_hook.h"
13
14//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
15// "C++" Definitions group 7 - Menu hook
16#ifdef __cplusplus
17
18namespace kodi
19{
20namespace addon
21{
22
23//==============================================================================
24/// @defgroup cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook class PVRMenuhook
25/// @ingroup cpp_kodi_addon_pvr_Defs_Menuhook
26/// @brief **Context menu hook**\n
27/// Menu hooks that are available in the context menus while playing a stream via this add-on.
28/// And in the Live TV settings dialog.
29///
30/// Possible menu's given to Kodi.
31///
32/// This can be becomes used on this, if @ref kodi::addon::CInstancePVRClient::AddMenuHook()
33/// was set to related type:
34/// - @ref kodi::addon::CInstancePVRClient::CallSettingsMenuHook()
35/// - @ref kodi::addon::CInstancePVRClient::CallChannelMenuHook()
36/// - @ref kodi::addon::CInstancePVRClient::CallEPGMenuHook()
37/// - @ref kodi::addon::CInstancePVRClient::CallRecordingMenuHook()
38/// - @ref kodi::addon::CInstancePVRClient::CallTimerMenuHook()
39///
40/// ----------------------------------------------------------------------------
41///
42/// @copydetails cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook_Help
43///
44///@{
45class PVRMenuhook : public CStructHdl<PVRMenuhook, PVR_MENUHOOK>
46{
47 friend class CInstancePVRClient;
48
49public:
50 /// @addtogroup cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook
51 /// @brief Optional class constructor with value set.
52 ///
53 /// @param[in] hookId This hook's identifier
54 /// @param[in] localizedStringId Localized string identifier
55 /// @param[in] category Category of menu hook, defined with @ref PVR_MENUHOOK_CAT
56 ///
57 ///
58 /// --------------------------------------------------------------------------
59 ///
60 /// Example:
61 /// ~~~~~~~~~~~~~{.cpp}
62 /// AddMenuHook(kodi::addon::PVRMenuhook(1, 30001, PVR_MENUHOOK_CHANNEL));
63 /// ~~~~~~~~~~~~~
64 ///
65 PVRMenuhook(unsigned int hookId, unsigned int localizedStringId, PVR_MENUHOOK_CAT category)
66 {
67 m_cStructure->iHookId = hookId;
68 m_cStructure->iLocalizedStringId = localizedStringId;
69 m_cStructure->category = category;
70 }
71
72 /*! \cond PRIVATE */
73 PVRMenuhook()
74 {
75 m_cStructure->iHookId = 0;
76 m_cStructure->iLocalizedStringId = 0;
77 m_cStructure->category = PVR_MENUHOOK_UNKNOWN;
78 }
79 PVRMenuhook(const PVRMenuhook& data) : CStructHdl(data) {}
80 /*! \endcond */
81
82 /// @defgroup cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook_Help Value Help
83 /// @ingroup cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook
84 ///
85 /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook :</b>
86 /// | Name | Type | Set call | Get call | Usage
87 /// |------|------|----------|----------|-----------
88 /// | **This hook's identifier** | `unsigned int` | @ref PVRMenuhook::SetHookId "SetHookId" | @ref PVRMenuhook::GetHookId "GetHookId" | *required to set*
89 /// | **Localized string Identifier** | `unsigned int` | @ref PVRMenuhook::SetLocalizedStringId "SetLocalizedStringId" | @ref PVRMenuhook::GetLocalizedStringId "GetLocalizedStringId" | *required to set*
90 /// | **Category of menu hook** | @ref PVR_MENUHOOK_CAT | @ref PVRMenuhook::SetCategory "SetCategory" | @ref PVRMenuhook::GetCategory "GetCategory" | *required to set*
91
92 /// @addtogroup cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook
93 ///@{
94
95 /// @brief **required**\n
96 /// This hook's identifier.
97 void SetHookId(unsigned int hookId) { m_cStructure->iHookId = hookId; }
98
99 /// @brief To get with @ref SetHookId() changed values.
100 unsigned int GetHookId() const { return m_cStructure->iHookId; }
101
102 /// @brief **required**\n
103 /// The id of the label for this hook in @ref kodi::GetLocalizedString().
104 void SetLocalizedStringId(unsigned int localizedStringId)
105 {
106 m_cStructure->iLocalizedStringId = localizedStringId;
107 }
108
109 /// @brief To get with @ref SetLocalizedStringId() changed values.
110 unsigned int GetLocalizedStringId() const { return m_cStructure->iLocalizedStringId; }
111
112 /// @brief **required**\n
113 /// Category of menu hook.
114 void SetCategory(PVR_MENUHOOK_CAT category) { m_cStructure->category = category; }
115
116 /// @brief To get with @ref SetCategory() changed values.
117 PVR_MENUHOOK_CAT GetCategory() const { return m_cStructure->category; }
118 ///@}
119
120private:
121 PVRMenuhook(const PVR_MENUHOOK* data) : CStructHdl(data) {}
122 PVRMenuhook(PVR_MENUHOOK* data) : CStructHdl(data) {}
123};
124///@}
125//------------------------------------------------------------------------------
126
127} /* namespace addon */
128} /* namespace kodi */
129
130#endif /* __cplusplus */