xbmc
GUIDialogPVRChannelManager.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 "dialogs/GUIDialogContextMenu.h"
12 #include "guilib/GUIDialog.h"
13 #include "view/GUIViewControl.h"
14 
15 #include <memory>
16 #include <vector>
17 
18 class CAction;
19 class CFileItemList;
20 class CGUIMessage;
21 
22 namespace PVR
23 {
24  class CPVRChannelGroup;
25  class CPVRClient;
26 
28  {
29  public:
31  ~CGUIDialogPVRChannelManager() override;
32  bool OnMessage(CGUIMessage& message) override;
33  bool OnAction(const CAction& action) override;
34  void OnWindowLoaded() override;
35  void OnWindowUnload() override;
36  bool HasListItems() const override{ return true; }
37  CFileItemPtr GetCurrentListItem(int offset = 0) override;
38 
39  void Open(const std::shared_ptr<CFileItem>& initialSelection);
40  void SetRadio(bool bIsRadio);
41 
42  protected:
43  void OnInitWindow() override;
44  void OnDeinitWindow(int nextWindowID) override;
45 
46  private:
47  void Clear();
48  void Update();
49  void PromptAndSaveList();
50  void SaveList();
51  void Renumber();
52  void SetData(int iItem);
53  void RenameChannel(const CFileItemPtr& pItem);
54 
55  void ClearChannelOptions();
56  void EnableChannelOptions(bool bEnable);
57 
58  bool OnPopupMenu(int iItem);
59  bool OnContextButton(int itemNumber, CONTEXT_BUTTON button);
60  bool OnActionMove(const CAction& action);
61  bool OnMessageClick(const CGUIMessage& message);
62  bool OnClickListChannels(const CGUIMessage& message);
63  bool OnClickButtonOK();
64  bool OnClickButtonApply();
65  bool OnClickButtonCancel();
66  bool OnClickButtonRadioTV();
67  bool OnClickButtonRadioActive();
68  bool OnClickButtonRadioParentalLocked();
69  bool OnClickButtonEditName();
70  bool OnClickButtonChannelLogo();
71  bool OnClickButtonUseEPG();
72  bool OnClickEPGSourceSpin();
73  bool OnClickButtonGroupManager();
74  bool OnClickButtonNewChannel();
75  bool OnClickButtonRefreshChannelLogos();
76 
77  bool PersistChannel(const CFileItemPtr& pItem, const std::shared_ptr<CPVRChannelGroup>& group);
78 
79  bool HasChangedItems() const;
80  void SetItemChanged(const CFileItemPtr& pItem);
81 
82  bool m_bIsRadio = false;
83  bool m_bMovingMode = false;
84  bool m_bAllowNewChannel = false;
85  bool m_bAllowRenumber = false;
86  bool m_bAllowReorder = false;
87 
88  std::shared_ptr<CFileItem> m_initialSelection;
89  int m_iSelected = 0;
90  CFileItemList* m_channelItems;
91  CGUIViewControl m_viewControl;
92 
93  std::vector<std::shared_ptr<CPVRClient>> m_clientsWithSettingsList;
94  };
95 }
Definition: GUIViewControl.h:19
Definition: ContextMenuManager.h:24
Represents a list of files.
Definition: FileItem.h:713
void OnInitWindow() override
Called on window open.
Definition: GUIDialogPVRChannelManager.cpp:188
Definition: GUIDialogPVRChannelManager.h:27
class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition: Action.h:22
Definition: GUIDialog.h:35
Definition: GUIMessage.h:365
Definition: SmartPlayList.cpp:137