aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kai.sommerfeld@gmx.com>2022-09-22 15:45:52 +0200
committerKai Sommerfeld <kai.sommerfeld@gmx.com>2022-09-27 13:17:23 +0200
commitf42dabe9675f4d0a8066c11845fc35ecddd673df (patch)
tree2c9e24d34f2094446cd77e69d45ced2578b16b4e
parent9a10c0676e88bcbbd16f613d9dd9eedf71095b21 (diff)
[PVR] Refactor CPVRGUIActions step 3: Move EPG related actions to own class.
-rw-r--r--xbmc/pvr/guilib/CMakeLists.txt2
-rw-r--r--xbmc/pvr/guilib/PVRGUIActions.cpp184
-rw-r--r--xbmc/pvr/guilib/PVRGUIActions.h54
-rw-r--r--xbmc/pvr/guilib/PVRGUIActionsEPG.cpp219
-rw-r--r--xbmc/pvr/guilib/PVRGUIActionsEPG.h78
5 files changed, 305 insertions, 232 deletions
diff --git a/xbmc/pvr/guilib/CMakeLists.txt b/xbmc/pvr/guilib/CMakeLists.txt
index 9bf165ee0f..5a5f549a62 100644
--- a/xbmc/pvr/guilib/CMakeLists.txt
+++ b/xbmc/pvr/guilib/CMakeLists.txt
@@ -2,6 +2,7 @@ set(SOURCES GUIEPGGridContainer.cpp
GUIEPGGridContainerModel.cpp
PVRGUIActionListener.cpp
PVRGUIActions.cpp
+ PVRGUIActionsEPG.cpp
PVRGUIActionsRecordings.cpp
PVRGUIActionsTimers.cpp
PVRGUIChannelIconUpdater.cpp
@@ -12,6 +13,7 @@ set(HEADERS GUIEPGGridContainer.h
GUIEPGGridContainerModel.h
PVRGUIActionListener.h
PVRGUIActions.h
+ PVRGUIActionsEPG.h
PVRGUIActionsRecordings.h
PVRGUIActionsTimers.h
PVRGUIChannelIconUpdater.h
diff --git a/xbmc/pvr/guilib/PVRGUIActions.cpp b/xbmc/pvr/guilib/PVRGUIActions.cpp
index a8028fa194..d98b5d191a 100644
--- a/xbmc/pvr/guilib/PVRGUIActions.cpp
+++ b/xbmc/pvr/guilib/PVRGUIActions.cpp
@@ -12,13 +12,13 @@
#include "ServiceBroker.h"
#include "application/ApplicationEnums.h"
#include "cores/DataCacheCore.h"
+#include "dialogs/GUIDialogContextMenu.h"
#include "dialogs/GUIDialogKaiToast.h"
#include "dialogs/GUIDialogNumeric.h"
#include "dialogs/GUIDialogProgress.h"
#include "dialogs/GUIDialogSelect.h"
#include "dialogs/GUIDialogYesNo.h"
#include "guilib/GUIComponent.h"
-#include "guilib/GUIKeyboardFactory.h"
#include "guilib/GUIWindowManager.h"
#include "guilib/LocalizeStrings.h"
#include "guilib/WindowIDs.h"
@@ -41,18 +41,15 @@
#include "pvr/channels/PVRChannelGroupMember.h"
#include "pvr/channels/PVRChannelGroups.h"
#include "pvr/channels/PVRChannelGroupsContainer.h"
-#include "pvr/dialogs/GUIDialogPVRChannelGuide.h"
-#include "pvr/dialogs/GUIDialogPVRGuideInfo.h"
#include "pvr/epg/EpgContainer.h"
#include "pvr/epg/EpgDatabase.h"
#include "pvr/epg/EpgInfoTag.h"
-#include "pvr/epg/EpgSearchFilter.h"
#include "pvr/recordings/PVRRecording.h"
#include "pvr/recordings/PVRRecordings.h"
#include "pvr/recordings/PVRRecordingsPath.h"
#include "pvr/timers/PVRTimerInfoTag.h"
#include "pvr/timers/PVRTimers.h"
-#include "pvr/windows/GUIWindowPVRSearch.h"
+#include "pvr/windows/GUIWindowPVRBase.h"
#include "settings/MediaSettings.h"
#include "settings/Settings.h"
#include "utils/StringUtils.h"
@@ -72,27 +69,6 @@
using namespace KODI::MESSAGING;
-namespace
-{
-PVR::CGUIWindowPVRSearchBase* GetSearchWindow(bool bRadio)
-{
- const int windowSearchId = bRadio ? WINDOW_RADIO_SEARCH : WINDOW_TV_SEARCH;
-
- PVR::CGUIWindowPVRSearchBase* windowSearch;
-
- CGUIWindowManager& windowMgr = CServiceBroker::GetGUI()->GetWindowManager();
- if (bRadio)
- windowSearch = windowMgr.GetWindow<PVR::CGUIWindowPVRRadioSearch>(windowSearchId);
- else
- windowSearch = windowMgr.GetWindow<PVR::CGUIWindowPVRTVSearch>(windowSearchId);
-
- if (!windowSearch)
- CLog::LogF(LOGERROR, "Unable to get {}!", bRadio ? "WINDOW_RADIO_SEARCH" : "WINDOW_TV_SEARCH");
-
- return windowSearch;
-}
-} // unnamed namespace
-
namespace PVR
{
CPVRGUIActions::CPVRGUIActions()
@@ -106,82 +82,6 @@ CPVRGUIActions::CPVRGUIActions()
{
}
- bool CPVRGUIActions::ShowEPGInfo(const CFileItemPtr& item) const
- {
- const std::shared_ptr<CPVRChannel> channel(CPVRItem(item).GetChannel());
- if (channel && CheckParentalLock(channel) != ParentalCheckResult::SUCCESS)
- return false;
-
- const std::shared_ptr<CPVREpgInfoTag> epgTag(CPVRItem(item).GetEpgInfoTag());
- if (!epgTag)
- {
- CLog::LogF(LOGERROR, "No epg tag!");
- return false;
- }
-
- CGUIDialogPVRGuideInfo* pDlgInfo = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogPVRGuideInfo>(WINDOW_DIALOG_PVR_GUIDE_INFO);
- if (!pDlgInfo)
- {
- CLog::LogF(LOGERROR, "Unable to get WINDOW_DIALOG_PVR_GUIDE_INFO!");
- return false;
- }
-
- pDlgInfo->SetProgInfo(epgTag);
- pDlgInfo->Open();
- return true;
- }
-
-
- bool CPVRGUIActions::ShowChannelEPG(const CFileItemPtr& item) const
- {
- const std::shared_ptr<CPVRChannel> channel(CPVRItem(item).GetChannel());
- if (channel && CheckParentalLock(channel) != ParentalCheckResult::SUCCESS)
- return false;
-
- CGUIDialogPVRChannelGuide* pDlgInfo = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogPVRChannelGuide>(WINDOW_DIALOG_PVR_CHANNEL_GUIDE);
- if (!pDlgInfo)
- {
- CLog::LogF(LOGERROR, "Unable to get WINDOW_DIALOG_PVR_CHANNEL_GUIDE!");
- return false;
- }
-
- pDlgInfo->Open(channel);
- return true;
- }
-
- bool CPVRGUIActions::FindSimilar(const std::shared_ptr<CFileItem>& item) const
- {
- CGUIWindowPVRSearchBase* windowSearch = GetSearchWindow(CPVRItem(item).IsRadio());
- if (!windowSearch)
- return false;
-
- //! @todo If we want dialogs to spawn program search in a clean way - without having to force-close any
- // other dialogs - we must introduce a search dialog with functionality similar to the search window.
-
- for (int iId = CServiceBroker::GetGUI()->GetWindowManager().GetTopmostModalDialog(true /* ignoreClosing */);
- iId != WINDOW_INVALID;
- iId = CServiceBroker::GetGUI()->GetWindowManager().GetTopmostModalDialog(true /* ignoreClosing */))
- {
- CLog::LogF(LOGWARNING,
- "Have to close modal dialog with id {} before search window can be opened.", iId);
-
- CGUIWindow* window = CServiceBroker::GetGUI()->GetWindowManager().GetWindow(iId);
- if (window)
- {
- window->Close();
- }
- else
- {
- CLog::LogF(LOGERROR, "Unable to get window instance {}! Cannot open search window.", iId);
- return false; // return, otherwise we run into an endless loop
- }
- }
-
- windowSearch->SetItemToSearch(item);
- CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(windowSearch->GetID());
- return true;
- };
-
std::string CPVRGUIActions::GetResumeLabel(const CFileItem& item) const
{
std::string resumeString;
@@ -1451,86 +1351,6 @@ CPVRGUIActions::CPVRGUIActions()
return false;
}
- bool CPVRGUIActions::ExecuteSavedSearch(const std::shared_ptr<CFileItem>& item)
- {
- const auto searchFilter = item->GetEPGSearchFilter();
-
- if (!searchFilter)
- {
- CLog::LogF(LOGERROR, "Wrong item type. No EPG search filter present.");
- return false;
- }
-
- CGUIWindowPVRSearchBase* windowSearch = GetSearchWindow(searchFilter->IsRadio());
- if (!windowSearch)
- return false;
-
- windowSearch->SetItemToSearch(item);
- CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(windowSearch->GetID());
- return true;
- }
-
- bool CPVRGUIActions::EditSavedSearch(const std::shared_ptr<CFileItem>& item)
- {
- const auto searchFilter = item->GetEPGSearchFilter();
-
- if (!searchFilter)
- {
- CLog::LogF(LOGERROR, "Wrong item type. No EPG search filter present.");
- return false;
- }
-
- CGUIWindowPVRSearchBase* windowSearch = GetSearchWindow(searchFilter->IsRadio());
- if (!windowSearch)
- return false;
-
- if (windowSearch->OpenDialogSearch(item) == CGUIDialogPVRGuideSearch::Result::SEARCH)
- CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(windowSearch->GetID());
-
- return true;
- }
-
- bool CPVRGUIActions::RenameSavedSearch(const std::shared_ptr<CFileItem>& item)
- {
- const auto searchFilter = item->GetEPGSearchFilter();
-
- if (!searchFilter)
- {
- CLog::LogF(LOGERROR, "Wrong item type. No EPG search filter present.");
- return false;
- }
-
- std::string title = searchFilter->GetTitle();
- if (CGUIKeyboardFactory::ShowAndGetInput(title,
- CVariant{g_localizeStrings.Get(528)}, // "Enter title"
- false))
- {
- searchFilter->SetTitle(title);
- CServiceBroker::GetPVRManager().EpgContainer().PersistSavedSearch(*searchFilter);
- return true;
- }
- return false;
- }
-
- bool CPVRGUIActions::DeleteSavedSearch(const std::shared_ptr<CFileItem>& item)
- {
- const auto searchFilter = item->GetEPGSearchFilter();
-
- if (!searchFilter)
- {
- CLog::LogF(LOGERROR, "Wrong item type. No EPG search filter present.");
- return false;
- }
-
- if (CGUIDialogYesNo::ShowAndGetInput(CVariant{122}, // "Confirm delete"
- CVariant{19338}, // "Delete this saved search?"
- CVariant{""}, CVariant{item->GetLabel()}))
- {
- return CServiceBroker::GetPVRManager().EpgContainer().DeleteSavedSearch(*searchFilter);
- }
- return false;
- }
-
void CPVRChannelSwitchingInputHandler::AppendChannelNumberCharacter(char cCharacter)
{
// special case. if only a single zero was typed in, switch to previously played channel.
diff --git a/xbmc/pvr/guilib/PVRGUIActions.h b/xbmc/pvr/guilib/PVRGUIActions.h
index 8f6b18cb87..8d5b589a45 100644
--- a/xbmc/pvr/guilib/PVRGUIActions.h
+++ b/xbmc/pvr/guilib/PVRGUIActions.h
@@ -9,6 +9,7 @@
#pragma once
#include "pvr/PVRChannelNumberInputHandler.h"
+#include "pvr/guilib/PVRGUIActionsEPG.h"
#include "pvr/guilib/PVRGUIActionsRecordings.h"
#include "pvr/guilib/PVRGUIActionsTimers.h"
#include "pvr/guilib/PVRGUIChannelNavigator.h"
@@ -65,34 +66,15 @@ namespace PVR
void SwitchToPreviousChannel();
};
- class CPVRGUIActions : public CPVRGUIActionsRecordings, public CPVRGUIActionsTimers
+ class CPVRGUIActions : public CPVRGUIActionsEPG,
+ public CPVRGUIActionsRecordings,
+ public CPVRGUIActionsTimers
{
public:
CPVRGUIActions();
virtual ~CPVRGUIActions() = default;
/*!
- * @brief Open a dialog with epg information for a given item.
- * @param item containing epg data to show. item must be an epg tag, a channel or a timer.
- * @return true on success, false otherwise.
- */
- bool ShowEPGInfo(const std::shared_ptr<CFileItem>& item) const;
-
- /*!
- * @brief Open a dialog with the epg list for a given item.
- * @param item containing channel info. item must be an epg tag, a channel or a timer.
- * @return true on success, false otherwise.
- */
- bool ShowChannelEPG(const std::shared_ptr<CFileItem>& item) const;
-
- /*!
- * @brief Open a window containing a list of epg tags 'similar' to a given item.
- * @param item containing epg data for matching. item must be an epg tag, a channel or a recording.
- * @return true on success, false otherwise.
- */
- bool FindSimilar(const std::shared_ptr<CFileItem>& item) const;
-
- /*!
* @brief Get a localized resume play label, if the given item can be resumed.
* @param item containing a recording or an epg tag.
* @return the localized resume play label that can be used for instance as context menu item label or an empty string if resume is not possible.
@@ -288,34 +270,6 @@ namespace PVR
*/
bool OnInfo(const std::shared_ptr<CFileItem>& item);
- /*!
- * @brief Execute a saved search. Displays result in search window if it is open.
- * @param item The item containing a search filter.
- * @return True on success, false otherwise.
- */
- bool ExecuteSavedSearch(const std::shared_ptr<CFileItem>& item);
-
- /*!
- * @brief Edit a saved search. Opens the search dialog.
- * @param item The item containing a search filter.
- * @return True on success, false otherwise.
- */
- bool EditSavedSearch(const std::shared_ptr<CFileItem>& item);
-
- /*!
- * @brief Rename a saved search. Opens a title input dialog.
- * @param item The item containing a search filter.
- * @return True on success, false otherwise.
- */
- bool RenameSavedSearch(const std::shared_ptr<CFileItem>& item);
-
- /*!
- * @brief Delete a saved search. Opens confirmation dialog before deleting.
- * @param item The item containing a search filter.
- * @return True on success, false otherwise.
- */
- bool DeleteSavedSearch(const std::shared_ptr<CFileItem>& item);
-
private:
CPVRGUIActions(const CPVRGUIActions&) = delete;
CPVRGUIActions const& operator=(CPVRGUIActions const&) = delete;
diff --git a/xbmc/pvr/guilib/PVRGUIActionsEPG.cpp b/xbmc/pvr/guilib/PVRGUIActionsEPG.cpp
new file mode 100644
index 0000000000..153d3df6b1
--- /dev/null
+++ b/xbmc/pvr/guilib/PVRGUIActionsEPG.cpp
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2016-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.
+ */
+
+#include "PVRGUIActionsEPG.h"
+
+#include "FileItem.h"
+#include "ServiceBroker.h"
+#include "dialogs/GUIDialogYesNo.h"
+#include "guilib/GUIComponent.h"
+#include "guilib/GUIKeyboardFactory.h"
+#include "guilib/GUIWindowManager.h"
+#include "guilib/LocalizeStrings.h"
+#include "guilib/WindowIDs.h"
+#include "pvr/PVRItem.h"
+#include "pvr/PVRManager.h"
+#include "pvr/dialogs/GUIDialogPVRChannelGuide.h"
+#include "pvr/dialogs/GUIDialogPVRGuideInfo.h"
+#include "pvr/epg/EpgContainer.h"
+#include "pvr/epg/EpgSearchFilter.h"
+#include "pvr/guilib/PVRGUIActions.h" //! @todo decouple
+#include "pvr/windows/GUIWindowPVRSearch.h"
+#include "utils/Variant.h"
+#include "utils/log.h"
+
+#include <memory>
+#include <string>
+
+using namespace PVR;
+
+namespace
+{
+PVR::CGUIWindowPVRSearchBase* GetSearchWindow(bool bRadio)
+{
+ const int windowSearchId = bRadio ? WINDOW_RADIO_SEARCH : WINDOW_TV_SEARCH;
+
+ PVR::CGUIWindowPVRSearchBase* windowSearch;
+
+ CGUIWindowManager& windowMgr = CServiceBroker::GetGUI()->GetWindowManager();
+ if (bRadio)
+ windowSearch = windowMgr.GetWindow<PVR::CGUIWindowPVRRadioSearch>(windowSearchId);
+ else
+ windowSearch = windowMgr.GetWindow<PVR::CGUIWindowPVRTVSearch>(windowSearchId);
+
+ if (!windowSearch)
+ CLog::LogF(LOGERROR, "Unable to get {}!", bRadio ? "WINDOW_RADIO_SEARCH" : "WINDOW_TV_SEARCH");
+
+ return windowSearch;
+}
+} // unnamed namespace
+
+bool CPVRGUIActionsEPG::ShowEPGInfo(const CFileItemPtr& item) const
+{
+ const std::shared_ptr<CPVRChannel> channel(CPVRItem(item).GetChannel());
+ //! @todo decouple
+ if (channel && CServiceBroker::GetPVRManager().GUIActions()->CheckParentalLock(channel) !=
+ ParentalCheckResult::SUCCESS)
+ return false;
+
+ const std::shared_ptr<CPVREpgInfoTag> epgTag(CPVRItem(item).GetEpgInfoTag());
+ if (!epgTag)
+ {
+ CLog::LogF(LOGERROR, "No epg tag!");
+ return false;
+ }
+
+ CGUIDialogPVRGuideInfo* pDlgInfo =
+ CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogPVRGuideInfo>(
+ WINDOW_DIALOG_PVR_GUIDE_INFO);
+ if (!pDlgInfo)
+ {
+ CLog::LogF(LOGERROR, "Unable to get WINDOW_DIALOG_PVR_GUIDE_INFO!");
+ return false;
+ }
+
+ pDlgInfo->SetProgInfo(epgTag);
+ pDlgInfo->Open();
+ return true;
+}
+
+bool CPVRGUIActionsEPG::ShowChannelEPG(const CFileItemPtr& item) const
+{
+ const std::shared_ptr<CPVRChannel> channel(CPVRItem(item).GetChannel());
+ //! @todo decouple
+ if (channel && CServiceBroker::GetPVRManager().GUIActions()->CheckParentalLock(channel) !=
+ ParentalCheckResult::SUCCESS)
+ return false;
+
+ CGUIDialogPVRChannelGuide* pDlgInfo =
+ CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogPVRChannelGuide>(
+ WINDOW_DIALOG_PVR_CHANNEL_GUIDE);
+ if (!pDlgInfo)
+ {
+ CLog::LogF(LOGERROR, "Unable to get WINDOW_DIALOG_PVR_CHANNEL_GUIDE!");
+ return false;
+ }
+
+ pDlgInfo->Open(channel);
+ return true;
+}
+
+bool CPVRGUIActionsEPG::FindSimilar(const std::shared_ptr<CFileItem>& item) const
+{
+ CGUIWindowPVRSearchBase* windowSearch = GetSearchWindow(CPVRItem(item).IsRadio());
+ if (!windowSearch)
+ return false;
+
+ //! @todo If we want dialogs to spawn program search in a clean way - without having to force-close any
+ // other dialogs - we must introduce a search dialog with functionality similar to the search window.
+
+ for (int iId = CServiceBroker::GetGUI()->GetWindowManager().GetTopmostModalDialog(
+ true /* ignoreClosing */);
+ iId != WINDOW_INVALID;
+ iId = CServiceBroker::GetGUI()->GetWindowManager().GetTopmostModalDialog(
+ true /* ignoreClosing */))
+ {
+ CLog::LogF(LOGWARNING,
+ "Have to close modal dialog with id {} before search window can be opened.", iId);
+
+ CGUIWindow* window = CServiceBroker::GetGUI()->GetWindowManager().GetWindow(iId);
+ if (window)
+ {
+ window->Close();
+ }
+ else
+ {
+ CLog::LogF(LOGERROR, "Unable to get window instance {}! Cannot open search window.", iId);
+ return false; // return, otherwise we run into an endless loop
+ }
+ }
+
+ windowSearch->SetItemToSearch(item);
+ CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(windowSearch->GetID());
+ return true;
+};
+
+bool CPVRGUIActionsEPG::ExecuteSavedSearch(const std::shared_ptr<CFileItem>& item)
+{
+ const auto searchFilter = item->GetEPGSearchFilter();
+
+ if (!searchFilter)
+ {
+ CLog::LogF(LOGERROR, "Wrong item type. No EPG search filter present.");
+ return false;
+ }
+
+ CGUIWindowPVRSearchBase* windowSearch = GetSearchWindow(searchFilter->IsRadio());
+ if (!windowSearch)
+ return false;
+
+ windowSearch->SetItemToSearch(item);
+ CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(windowSearch->GetID());
+ return true;
+}
+
+bool CPVRGUIActionsEPG::EditSavedSearch(const std::shared_ptr<CFileItem>& item)
+{
+ const auto searchFilter = item->GetEPGSearchFilter();
+
+ if (!searchFilter)
+ {
+ CLog::LogF(LOGERROR, "Wrong item type. No EPG search filter present.");
+ return false;
+ }
+
+ CGUIWindowPVRSearchBase* windowSearch = GetSearchWindow(searchFilter->IsRadio());
+ if (!windowSearch)
+ return false;
+
+ if (windowSearch->OpenDialogSearch(item) == CGUIDialogPVRGuideSearch::Result::SEARCH)
+ CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(windowSearch->GetID());
+
+ return true;
+}
+
+bool CPVRGUIActionsEPG::RenameSavedSearch(const std::shared_ptr<CFileItem>& item)
+{
+ const auto searchFilter = item->GetEPGSearchFilter();
+
+ if (!searchFilter)
+ {
+ CLog::LogF(LOGERROR, "Wrong item type. No EPG search filter present.");
+ return false;
+ }
+
+ std::string title = searchFilter->GetTitle();
+ if (CGUIKeyboardFactory::ShowAndGetInput(title,
+ CVariant{g_localizeStrings.Get(528)}, // "Enter title"
+ false))
+ {
+ searchFilter->SetTitle(title);
+ CServiceBroker::GetPVRManager().EpgContainer().PersistSavedSearch(*searchFilter);
+ return true;
+ }
+ return false;
+}
+
+bool CPVRGUIActionsEPG::DeleteSavedSearch(const std::shared_ptr<CFileItem>& item)
+{
+ const auto searchFilter = item->GetEPGSearchFilter();
+
+ if (!searchFilter)
+ {
+ CLog::LogF(LOGERROR, "Wrong item type. No EPG search filter present.");
+ return false;
+ }
+
+ if (CGUIDialogYesNo::ShowAndGetInput(CVariant{122}, // "Confirm delete"
+ CVariant{19338}, // "Delete this saved search?"
+ CVariant{""}, CVariant{item->GetLabel()}))
+ {
+ return CServiceBroker::GetPVRManager().EpgContainer().DeleteSavedSearch(*searchFilter);
+ }
+ return false;
+}
diff --git a/xbmc/pvr/guilib/PVRGUIActionsEPG.h b/xbmc/pvr/guilib/PVRGUIActionsEPG.h
new file mode 100644
index 0000000000..ecc5359129
--- /dev/null
+++ b/xbmc/pvr/guilib/PVRGUIActionsEPG.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2016-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 <memory>
+
+class CFileItem;
+
+namespace PVR
+{
+class CPVRGUIActionsEPG
+{
+public:
+ CPVRGUIActionsEPG() = default;
+ virtual ~CPVRGUIActionsEPG() = default;
+
+ /*!
+ * @brief Open a dialog with epg information for a given item.
+ * @param item containing epg data to show. item must be an epg tag, a channel or a timer.
+ * @return true on success, false otherwise.
+ */
+ bool ShowEPGInfo(const std::shared_ptr<CFileItem>& item) const;
+
+ /*!
+ * @brief Open a dialog with the epg list for a given item.
+ * @param item containing channel info. item must be an epg tag, a channel or a timer.
+ * @return true on success, false otherwise.
+ */
+ bool ShowChannelEPG(const std::shared_ptr<CFileItem>& item) const;
+
+ /*!
+ * @brief Open a window containing a list of epg tags 'similar' to a given item.
+ * @param item containing epg data for matching. item must be an epg tag, a channel or a
+ * recording.
+ * @return true on success, false otherwise.
+ */
+ bool FindSimilar(const std::shared_ptr<CFileItem>& item) const;
+
+ /*!
+ * @brief Execute a saved search. Displays result in search window if it is open.
+ * @param item The item containing a search filter.
+ * @return True on success, false otherwise.
+ */
+ bool ExecuteSavedSearch(const std::shared_ptr<CFileItem>& item);
+
+ /*!
+ * @brief Edit a saved search. Opens the search dialog.
+ * @param item The item containing a search filter.
+ * @return True on success, false otherwise.
+ */
+ bool EditSavedSearch(const std::shared_ptr<CFileItem>& item);
+
+ /*!
+ * @brief Rename a saved search. Opens a title input dialog.
+ * @param item The item containing a search filter.
+ * @return True on success, false otherwise.
+ */
+ bool RenameSavedSearch(const std::shared_ptr<CFileItem>& item);
+
+ /*!
+ * @brief Delete a saved search. Opens confirmation dialog before deleting.
+ * @param item The item containing a search filter.
+ * @return True on success, false otherwise.
+ */
+ bool DeleteSavedSearch(const std::shared_ptr<CFileItem>& item);
+
+private:
+ CPVRGUIActionsEPG(const CPVRGUIActionsEPG&) = delete;
+ CPVRGUIActionsEPG const& operator=(CPVRGUIActionsEPG const&) = delete;
+};
+
+} // namespace PVR