xbmc
GUIDialogPVRGuideSearch.h
1 /*
2  * Copyright (C) 2012-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "XBDateTime.h"
12 #include "guilib/GUIDialog.h"
13 
14 #include <map>
15 #include <memory>
16 #include <string>
17 
18 namespace PVR
19 {
20  class CPVREpgSearchFilter;
21  class CPVRChannelGroupMember;
22 
24  {
25  public:
27  ~CGUIDialogPVRGuideSearch() override = default;
28  bool OnMessage(CGUIMessage& message) override;
29  void OnWindowLoaded() override;
30 
31  void SetFilterData(const std::shared_ptr<CPVREpgSearchFilter>& searchFilter);
32 
33  enum class Result
34  {
35  SEARCH,
36  SAVE,
37  CANCEL
38  };
39  Result GetResult() const { return m_result; }
40 
41  protected:
42  void OnInitWindow() override;
43 
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();
52 
53  bool IsRadioSelected(int controlID);
54  int GetSpinValue(int controlID);
55  std::string GetEditValue(int controlID);
56 
57  Result m_result = Result::CANCEL;
58  std::shared_ptr<CPVREpgSearchFilter> m_searchFilter;
59  std::map<int, std::shared_ptr<CPVRChannelGroupMember>> m_channelsMap;
60 
61  CDateTime m_startDateTime;
62  CDateTime m_endDateTime;
63  };
64 }
Definition: GUIDialogPVRGuideSearch.h:23
Definition: ContextMenuManager.h:24
void OnInitWindow() override
Called on window open.
Definition: GUIDialogPVRGuideSearch.cpp:235
Definition: GUIDialog.h:35
DateTime class, which uses FileTime as it&#39;s base.
Definition: XBDateTime.h:63
Definition: GUIMessage.h:365