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.
11 #include "dialogs/GUIDialogContextMenu.h"
12 #include "pvr/dialogs/GUIDialogPVRGuideSearch.h"
13 #include "pvr/windows/GUIWindowPVRBase.h"
22 class CPVREpgSearchFilter
;
24 class CGUIWindowPVRSearchBase
: public CGUIWindowPVRBase
27 CGUIWindowPVRSearchBase(bool bRadio
, int id
, const std::string
& xmlFile
);
28 ~CGUIWindowPVRSearchBase() override
;
30 bool OnAction(const CAction
& action
) override
;
31 bool OnMessage(CGUIMessage
& message
) override
;
32 void GetContextButtons(int itemNumber
, CContextButtons
& buttons
) override
;
33 bool OnContextButton(int itemNumber
, CONTEXT_BUTTON button
) override
;
34 bool Update(const std::string
& strDirectory
, bool updateFilterPath
= true) override
;
35 void UpdateButtons() override
;
38 * @brief set the item to search similar events for.
39 * @param item the epg event to search similar events for.
41 void SetItemToSearch(const CFileItem
& item
);
44 * @brief Open the search dialog for the given search filter item.
45 * @param item the epg search filter.
46 * @return The result of the dialog
48 CGUIDialogPVRGuideSearch::Result
OpenDialogSearch(const CFileItem
& item
);
51 void OnPrepareFileItems(CFileItemList
& items
) override
;
54 bool OnContextButtonClear(CFileItem
* item
, CONTEXT_BUTTON button
);
56 CGUIDialogPVRGuideSearch::Result
OpenDialogSearch(
57 const std::shared_ptr
<CPVREpgSearchFilter
>& searchFilter
);
61 void SetSearchFilter(const std::shared_ptr
<CPVREpgSearchFilter
>& searchFilter
);
63 bool m_bSearchConfirmed
= false;
64 std::shared_ptr
<CPVREpgSearchFilter
> m_searchfilter
;
67 class CGUIWindowPVRTVSearch
: public CGUIWindowPVRSearchBase
70 CGUIWindowPVRTVSearch() : CGUIWindowPVRSearchBase(false, WINDOW_TV_SEARCH
, "MyPVRSearch.xml") {}
73 std::string
GetRootPath() const override
;
74 std::string
GetStartFolder(const std::string
& dir
) override
;
75 std::string
GetDirectoryPath() override
;
78 class CGUIWindowPVRRadioSearch
: public CGUIWindowPVRSearchBase
81 CGUIWindowPVRRadioSearch() : CGUIWindowPVRSearchBase(true, WINDOW_RADIO_SEARCH
, "MyPVRSearch.xml")
86 std::string
GetRootPath() const override
;
87 std::string
GetStartFolder(const std::string
& dir
) override
;
88 std::string
GetDirectoryPath() override
;