Merge pull request #26076 from notspiff/seekhandler_seektype_enum_class
[xbmc.git] / xbmc / pvr / addons / PVRClientMenuHooks.h
blob7b7ef02149ebe232c6dbf141221f8fb85e20fdd9
1 /*
2 * Copyright (C) 2012-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include <functional>
12 #include <memory>
13 #include <string>
14 #include <vector>
16 struct PVR_MENUHOOK;
18 namespace PVR
20 class CPVRClientMenuHook
22 public:
23 CPVRClientMenuHook() = delete;
24 virtual ~CPVRClientMenuHook() = default;
26 CPVRClientMenuHook(const std::string& addonId, const PVR_MENUHOOK& hook);
28 bool operator ==(const CPVRClientMenuHook& right) const;
30 bool IsAllHook() const;
31 bool IsChannelHook() const;
32 bool IsTimerHook() const;
33 bool IsEpgHook() const;
34 bool IsRecordingHook() const;
35 bool IsDeletedRecordingHook() const;
36 bool IsSettingsHook() const;
38 const std::string& GetAddonId() const { return m_addonId; }
39 unsigned int GetId() const;
40 unsigned int GetLabelId() const;
41 std::string GetLabel() const;
43 private:
44 std::string m_addonId;
45 std::shared_ptr<PVR_MENUHOOK> m_hook;
48 class CPVRClientMenuHooks
50 public:
51 CPVRClientMenuHooks() = default;
52 virtual ~CPVRClientMenuHooks() = default;
54 explicit CPVRClientMenuHooks(const std::string& addonId) : m_addonId(addonId) {}
56 void AddHook(const PVR_MENUHOOK& addonHook);
57 void Clear();
59 std::vector<CPVRClientMenuHook> GetChannelHooks() const;
60 std::vector<CPVRClientMenuHook> GetTimerHooks() const;
61 std::vector<CPVRClientMenuHook> GetEpgHooks() const;
62 std::vector<CPVRClientMenuHook> GetRecordingHooks() const;
63 std::vector<CPVRClientMenuHook> GetDeletedRecordingHooks() const;
64 std::vector<CPVRClientMenuHook> GetSettingsHooks() const;
66 private:
67 std::vector<CPVRClientMenuHook> GetHooks(
68 const std::function<bool(const CPVRClientMenuHook& hook)>& function) const;
70 std::string m_addonId;
71 std::unique_ptr<std::vector<CPVRClientMenuHook>> m_hooks;