summaryrefslogtreecommitdiffstats
path: root/xbmc/pvr/addons/PVRClientMenuHooks.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
commitc04dcc2e7d834218ef2d4194331e383402495ae1 (patch)
tree7333e38d10d75386e60f336b80c2443c1166031d /xbmc/pvr/addons/PVRClientMenuHooks.h
parentInitial commit. (diff)
downloadkodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz
kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/pvr/addons/PVRClientMenuHooks.h')
-rw-r--r--xbmc/pvr/addons/PVRClientMenuHooks.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/xbmc/pvr/addons/PVRClientMenuHooks.h b/xbmc/pvr/addons/PVRClientMenuHooks.h
new file mode 100644
index 0000000..69d7f79
--- /dev/null
+++ b/xbmc/pvr/addons/PVRClientMenuHooks.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2012-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 <functional>
+#include <memory>
+#include <string>
+#include <vector>
+
+struct PVR_MENUHOOK;
+
+namespace PVR
+{
+ class CPVRClientMenuHook
+ {
+ public:
+ CPVRClientMenuHook() = delete;
+ virtual ~CPVRClientMenuHook() = default;
+
+ CPVRClientMenuHook(const std::string& addonId, const PVR_MENUHOOK& hook);
+
+ bool operator ==(const CPVRClientMenuHook& right) const;
+
+ bool IsAllHook() const;
+ bool IsChannelHook() const;
+ bool IsTimerHook() const;
+ bool IsEpgHook() const;
+ bool IsRecordingHook() const;
+ bool IsDeletedRecordingHook() const;
+ bool IsSettingsHook() const;
+
+ std::string GetAddonId() const;
+ unsigned int GetId() const;
+ unsigned int GetLabelId() const;
+ std::string GetLabel() const;
+
+ private:
+ std::string m_addonId;
+ std::shared_ptr<PVR_MENUHOOK> m_hook;
+ };
+
+ class CPVRClientMenuHooks
+ {
+ public:
+ CPVRClientMenuHooks() = default;
+ virtual ~CPVRClientMenuHooks() = default;
+
+ explicit CPVRClientMenuHooks(const std::string& addonId) : m_addonId(addonId) {}
+
+ void AddHook(const PVR_MENUHOOK& addonHook);
+ void Clear();
+
+ std::vector<CPVRClientMenuHook> GetChannelHooks() const;
+ std::vector<CPVRClientMenuHook> GetTimerHooks() const;
+ std::vector<CPVRClientMenuHook> GetEpgHooks() const;
+ std::vector<CPVRClientMenuHook> GetRecordingHooks() const;
+ std::vector<CPVRClientMenuHook> GetDeletedRecordingHooks() const;
+ std::vector<CPVRClientMenuHook> GetSettingsHooks() const;
+
+ private:
+ std::vector<CPVRClientMenuHook> GetHooks(
+ const std::function<bool(const CPVRClientMenuHook& hook)>& function) const;
+
+ std::string m_addonId;
+ std::unique_ptr<std::vector<CPVRClientMenuHook>> m_hooks;
+ };
+}