4 * Copyright (C) 2012-2013 Team XBMC
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
24 #include "windows/GUIMediaWindow.h"
25 #include "GUIWindowPVRCommon.h"
26 #include "threads/CriticalSection.h"
32 PVR_WINDOW_UNKNOWN = 0,
34 PVR_WINDOW_CHANNELS_TV = 2,
35 PVR_WINDOW_CHANNELS_RADIO = 3,
36 PVR_WINDOW_RECORDINGS = 4,
37 PVR_WINDOW_TIMERS = 5,
41 #define CONTROL_LIST_TIMELINE 10
42 #define CONTROL_LIST_CHANNELS_TV 11
43 #define CONTROL_LIST_CHANNELS_RADIO 12
44 #define CONTROL_LIST_RECORDINGS 13
45 #define CONTROL_LIST_TIMERS 14
46 #define CONTROL_LIST_GUIDE_CHANNEL 15
47 #define CONTROL_LIST_GUIDE_NOW_NEXT 16
48 #define CONTROL_LIST_SEARCH 17
50 #define CONTROL_LABELHEADER 29
51 #define CONTROL_LABELGROUP 30
53 #define CONTROL_BTNGUIDE 31
54 #define CONTROL_BTNCHANNELS_TV 32
55 #define CONTROL_BTNCHANNELS_RADIO 33
56 #define CONTROL_BTNRECORDINGS 34
57 #define CONTROL_BTNTIMERS 35
58 #define CONTROL_BTNSEARCH 36
59 #define CONTROL_BTNGUIDE_CHANNEL 37
60 #define CONTROL_BTNGUIDE_NOW 38
61 #define CONTROL_BTNGUIDE_NEXT 39
62 #define CONTROL_BTNGUIDE_TIMELINE 40
66 class CGUIWindowPVRCommon
68 friend class CGUIWindowPVR;
71 CGUIWindowPVRCommon(CGUIWindowPVR *parent, PVRWindow window,
72 unsigned int iControlButton, unsigned int iControlList);
73 virtual ~CGUIWindowPVRCommon(void) {};
75 bool operator ==(const CGUIWindowPVRCommon &right) const;
76 bool operator !=(const CGUIWindowPVRCommon &right) const;
78 virtual const char *GetName(void) const;
79 virtual PVRWindow GetWindowId(void) const { return m_window; }
80 virtual bool IsFocused(void) const;
81 virtual bool IsVisible(void) const;
82 virtual bool IsActive(void) const;
83 virtual bool IsSavedView(void) const;
84 virtual bool IsSelectedButton(CGUIMessage &message) const;
85 virtual bool IsSelectedControl(CGUIMessage &message) const;
86 virtual bool IsSelectedList(CGUIMessage &message) const;
88 virtual bool OnAction(const CAction &action);
89 virtual bool OnContextButton(int itemNumber, CONTEXT_BUTTON button);
91 virtual void GetContextButtons(int itemNumber, CContextButtons &buttons) const = 0;
92 virtual void UpdateData(bool bUpdateSelectedFile = true) = 0;
93 virtual void SetInvalid(void);
95 virtual void OnInitWindow(void);
96 virtual void OnWindowUnload(void);
99 virtual bool SelectPlayingFile(void);
100 virtual bool OnMessageFocus(CGUIMessage &message);
102 virtual bool OnClickButton(CGUIMessage &message) = 0;
103 virtual bool OnClickList(CGUIMessage &message) = 0;
105 virtual bool ActionDeleteTimer(CFileItem *item);
106 virtual bool ActionShowTimer(CFileItem *item);
107 virtual bool ActionRecord(CFileItem *item);
108 virtual bool ActionDeleteRecording(CFileItem *item);
109 virtual bool ActionPlayChannel(CFileItem *item);
110 virtual bool ActionPlayEpg(CFileItem *item);
111 virtual bool ActionDeleteChannel(CFileItem *item);
113 virtual bool PlayRecording(CFileItem *item, bool bPlayMinimized = false);
114 virtual bool PlayFile(CFileItem *item, bool bPlayMinimized = false);
115 virtual bool StartRecordFile(CFileItem *item);
116 virtual bool StopRecordFile(CFileItem *item);
117 virtual void ShowEPGInfo(CFileItem *item);
118 virtual void ShowRecordingInfo(CFileItem *item);
119 virtual bool UpdateEpgForChannel(CFileItem *item);
120 virtual bool ShowTimerSettings(CFileItem *item);
121 virtual bool ShowNewTimerDialog(void);
122 virtual void ShowBusyItem(void);
124 virtual bool OnContextButtonMenuHooks(CFileItem *item, CONTEXT_BUTTON button);
125 virtual bool OnContextButtonSortAsc(CFileItem *item, CONTEXT_BUTTON button);
126 virtual bool OnContextButtonSortBy(CFileItem *item, CONTEXT_BUTTON button);
127 virtual bool OnContextButtonSortByDate(CFileItem *item, CONTEXT_BUTTON button);
128 virtual bool OnContextButtonSortByName(CFileItem *item, CONTEXT_BUTTON button);
129 virtual bool OnContextButtonSortByChannel(CFileItem *item, CONTEXT_BUTTON button);
130 virtual bool OnContextButtonFind(CFileItem *item, CONTEXT_BUTTON button);
132 virtual void BeforeUpdate(const CStdString &strDirectory) {}
133 virtual void AfterUpdate(CFileItemList& items) {}
135 CGUIWindowPVR * m_parent;
137 unsigned int m_iControlButton;
138 unsigned int m_iControlList;
139 bool m_bUpdateRequired;
141 SortOrder m_iSortOrder;
142 SORT_METHOD m_iSortMethod;
143 CCriticalSection m_critSection;
144 CDirectoryHistory m_history;