Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
MenuHook.h
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//==============================================================================
45class PVRMenuhook : public CStructHdl<PVRMenuhook, PVR_MENUHOOK>
46{
47 friend class CInstancePVRClient;
48
49public:
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
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) {}
91
94
97 void SetHookId(unsigned int hookId) { m_cStructure->iHookId = hookId; }
98
100 unsigned int GetHookId() const { return m_cStructure->iHookId; }
101
104 void SetLocalizedStringId(unsigned int localizedStringId)
105 {
106 m_cStructure->iLocalizedStringId = localizedStringId;
107 }
108
110 unsigned int GetLocalizedStringId() const { return m_cStructure->iLocalizedStringId; }
111
114 void SetCategory(PVR_MENUHOOK_CAT category) { m_cStructure->category = category; }
115
117 PVR_MENUHOOK_CAT GetCategory() const { return m_cStructure->category; }
119
120private:
121 PVRMenuhook(const PVR_MENUHOOK* data) : CStructHdl(data) {}
122 PVRMenuhook(PVR_MENUHOOK* data) : CStructHdl(data) {}
123};
125//------------------------------------------------------------------------------
126
127} /* namespace addon */
128} /* namespace kodi */
129
130#endif /* __cplusplus */
Definition AddonBase.h:206
Definition MenuHook.h:46
PVR_MENUHOOK_CAT
Definition pvr_menu_hook.h:29
@ PVR_MENUHOOK_UNKNOWN
-1 : Unknown menu hook.
Definition pvr_menu_hook.h:31
void SetHookId(unsigned int hookId)
required This hook's identifier.
Definition MenuHook.h:97
unsigned int GetHookId() const
To get with SetHookId() changed values.
Definition MenuHook.h:100
PVR_MENUHOOK_CAT GetCategory() const
To get with SetCategory() changed values.
Definition MenuHook.h:117
unsigned int GetLocalizedStringId() const
To get with SetLocalizedStringId() changed values.
Definition MenuHook.h:110
void SetLocalizedStringId(unsigned int localizedStringId)
required The id of the label for this hook in kodi::GetLocalizedString().
Definition MenuHook.h:104
void SetCategory(PVR_MENUHOOK_CAT category)
required Category of menu hook.
Definition MenuHook.h:114
"C" PVR add-on menu hook.
Definition pvr_menu_hook.h:65