[video] fix selection after changing video or extra art
[xbmc.git] / xbmc / pvr / dialogs / GUIDialogPVRGuideSearch.h
blob4d021676cd4e783b2ff51ded7ca5d0793376110d
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 "XBDateTime.h"
12 #include "guilib/GUIDialog.h"
14 #include <map>
15 #include <memory>
16 #include <string>
18 namespace PVR
20 class CPVREpgSearchFilter;
21 class CPVRChannelGroupMember;
23 class CGUIDialogPVRGuideSearch : public CGUIDialog
25 public:
26 CGUIDialogPVRGuideSearch();
27 ~CGUIDialogPVRGuideSearch() override = default;
28 bool OnMessage(CGUIMessage& message) override;
29 void OnWindowLoaded() override;
31 void SetFilterData(const std::shared_ptr<CPVREpgSearchFilter>& searchFilter);
33 enum class Result
35 SEARCH,
36 SAVE,
37 CANCEL
39 Result GetResult() const { return m_result; }
41 protected:
42 void OnInitWindow() override;
44 private:
45 void UpdateSearchFilter();
46 void UpdateChannelSpin();
47 void UpdateGroupsSpin();
48 void UpdateGenreSpin();
49 void UpdateDurationSpin();
50 CDateTime ReadDateTime(const std::string& strDate, const std::string& strTime) const;
51 void Update();
53 bool IsRadioSelected(int controlID);
54 int GetSpinValue(int controlID);
55 std::string GetEditValue(int controlID);
57 Result m_result = Result::CANCEL;
58 std::shared_ptr<CPVREpgSearchFilter> m_searchFilter;
59 std::map<int, std::shared_ptr<CPVRChannelGroupMember>> m_channelsMap;
61 CDateTime m_startDateTime;
62 CDateTime m_endDateTime;