2 * Copyright (C) 2016-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.
11 #include "utils/EventStream.h"
16 class IContextMenuItem
;
20 enum class PVRContextMenuEventAction
26 struct PVRContextMenuEvent
28 PVRContextMenuEvent(const PVRContextMenuEventAction
& a
,
29 const std::shared_ptr
<IContextMenuItem
>& i
)
34 PVRContextMenuEventAction action
;
35 std::shared_ptr
<IContextMenuItem
> item
;
38 class CPVRClientMenuHook
;
40 class CPVRContextMenuManager
43 static CPVRContextMenuManager
& GetInstance();
45 std::vector
<std::shared_ptr
<IContextMenuItem
>> GetMenuItems() const { return m_items
; }
47 void AddMenuHook(const CPVRClientMenuHook
& hook
);
48 void RemoveMenuHook(const CPVRClientMenuHook
& hook
);
51 * @brief Query the events available for CEventStream
53 CEventStream
<PVRContextMenuEvent
>& Events() { return m_events
; }
56 CPVRContextMenuManager();
57 CPVRContextMenuManager(const CPVRContextMenuManager
&) = delete;
58 CPVRContextMenuManager
const& operator=(CPVRContextMenuManager
const&) = delete;
59 virtual ~CPVRContextMenuManager() = default;
61 std::vector
<std::shared_ptr
<IContextMenuItem
>> m_items
;
62 CEventSource
<PVRContextMenuEvent
> m_events
;