summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/MenuHook.h
blob: 053a4d5cf126921a3bd39034ccc5aafa41ef14ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
 *  Copyright (C) 2005-2018 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#pragma once

#include "../../AddonBase.h"
#include "../../c-api/addon-instance/pvr/pvr_menu_hook.h"

//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
// "C++" Definitions group 7 - Menu hook
#ifdef __cplusplus

namespace kodi
{
namespace addon
{

//==============================================================================
/// @defgroup cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook class PVRMenuhook
/// @ingroup cpp_kodi_addon_pvr_Defs_Menuhook
/// @brief **Context menu hook**\n
/// Menu hooks that are available in the context menus while playing a stream via this add-on.
/// And in the Live TV settings dialog.
///
/// Possible menu's given to Kodi.
///
/// This can be becomes used on this, if @ref kodi::addon::CInstancePVRClient::AddMenuHook()
/// was set to related type:
/// - @ref kodi::addon::CInstancePVRClient::CallSettingsMenuHook()
/// - @ref kodi::addon::CInstancePVRClient::CallChannelMenuHook()
/// - @ref kodi::addon::CInstancePVRClient::CallEPGMenuHook()
/// - @ref kodi::addon::CInstancePVRClient::CallRecordingMenuHook()
/// - @ref kodi::addon::CInstancePVRClient::CallTimerMenuHook()
///
/// ----------------------------------------------------------------------------
///
/// @copydetails cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook_Help
///
///@{
class PVRMenuhook : public CStructHdl<PVRMenuhook, PVR_MENUHOOK>
{
  friend class CInstancePVRClient;

public:
  /// @addtogroup cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook
  /// @brief Optional class constructor with value set.
  ///
  /// @param[in] hookId This hook's identifier
  /// @param[in] localizedStringId Localized string identifier
  /// @param[in] category Category of menu hook, defined with @ref PVR_MENUHOOK_CAT
  ///
  ///
  /// --------------------------------------------------------------------------
  ///
  /// Example:
  /// ~~~~~~~~~~~~~{.cpp}
  /// AddMenuHook(kodi::addon::PVRMenuhook(1, 30001, PVR_MENUHOOK_CHANNEL));
  /// ~~~~~~~~~~~~~
  ///
  PVRMenuhook(unsigned int hookId, unsigned int localizedStringId, PVR_MENUHOOK_CAT category)
  {
    m_cStructure->iHookId = hookId;
    m_cStructure->iLocalizedStringId = localizedStringId;
    m_cStructure->category = category;
  }

  /*! \cond PRIVATE */
  PVRMenuhook()
  {
    m_cStructure->iHookId = 0;
    m_cStructure->iLocalizedStringId = 0;
    m_cStructure->category = PVR_MENUHOOK_UNKNOWN;
  }
  PVRMenuhook(const PVRMenuhook& data) : CStructHdl(data) {}
  /*! \endcond */

  /// @defgroup cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook_Help Value Help
  /// @ingroup cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook
  ///
  /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook :</b>
  /// | Name | Type | Set call | Get call | Usage
  /// |------|------|----------|----------|-----------
  /// | **This hook's identifier** | `unsigned int` | @ref PVRMenuhook::SetHookId "SetHookId" | @ref PVRMenuhook::GetHookId "GetHookId" | *required to set*
  /// | **Localized string Identifier** | `unsigned int` | @ref PVRMenuhook::SetLocalizedStringId "SetLocalizedStringId" | @ref PVRMenuhook::GetLocalizedStringId "GetLocalizedStringId" | *required to set*
  /// | **Category of menu hook** | @ref PVR_MENUHOOK_CAT | @ref PVRMenuhook::SetCategory "SetCategory" | @ref PVRMenuhook::GetCategory "GetCategory" | *required to set*

  /// @addtogroup cpp_kodi_addon_pvr_Defs_Menuhook_PVRMenuhook
  ///@{

  /// @brief **required**\n
  /// This hook's identifier.
  void SetHookId(unsigned int hookId) { m_cStructure->iHookId = hookId; }

  /// @brief To get with @ref SetHookId() changed values.
  unsigned int GetHookId() const { return m_cStructure->iHookId; }

  /// @brief **required**\n
  /// The id of the label for this hook in @ref kodi::GetLocalizedString().
  void SetLocalizedStringId(unsigned int localizedStringId)
  {
    m_cStructure->iLocalizedStringId = localizedStringId;
  }

  /// @brief To get with @ref SetLocalizedStringId() changed values.
  unsigned int GetLocalizedStringId() const { return m_cStructure->iLocalizedStringId; }

  /// @brief **required**\n
  /// Category of menu hook.
  void SetCategory(PVR_MENUHOOK_CAT category) { m_cStructure->category = category; }

  /// @brief To get with @ref SetCategory() changed values.
  PVR_MENUHOOK_CAT GetCategory() const { return m_cStructure->category; }
  ///@}

private:
  PVRMenuhook(const PVR_MENUHOOK* data) : CStructHdl(data) {}
  PVRMenuhook(PVR_MENUHOOK* data) : CStructHdl(data) {}
};
///@}
//------------------------------------------------------------------------------

} /* namespace addon */
} /* namespace kodi */

#endif /* __cplusplus */