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/>.
23 #include "GUIWindowPVRCommon.h"
24 #include "epg/GUIEPGGridContainer.h"
25 #include "threads/CriticalSection.h"
26 #include "utils/Observer.h"
27 #include "../channels/PVRChannelGroup.h"
35 GUIDE_VIEW_CHANNEL = 0,
43 class CGUIWindowPVRGuide : public CGUIWindowPVRCommon, public Observer
45 friend class CGUIWindowPVR;
48 CGUIWindowPVRGuide(CGUIWindowPVR *parent);
49 virtual ~CGUIWindowPVRGuide(void);
51 void GetContextButtons(int itemNumber, CContextButtons &buttons) const;
52 bool OnContextButton(int itemNumber, CONTEXT_BUTTON button);
53 void UpdateData(bool bUpdateSelectedFile = true);
54 void Notify(const Observable &obs, const ObservableMessage msg);
55 void SetInvalid(void) { UpdateData(); }
56 void UnregisterObservers(void);
57 void ResetObservers(void);
59 static void SettingOptionsEpgGuideViewFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int ¤t);
62 bool SelectPlayingFile(void);
63 bool IsSelectedButton(CGUIMessage &message) const;
64 bool IsSelectedList(CGUIMessage &message) const;
65 bool OnClickButton(CGUIMessage &message);
66 bool OnClickList(CGUIMessage &message);
67 bool PlayEpgItem(CFileItem *item);
69 bool OnContextButtonBegin(CFileItem *item, CONTEXT_BUTTON button);
70 bool OnContextButtonEnd(CFileItem *item, CONTEXT_BUTTON button);
71 bool OnContextButtonNow(CFileItem *item, CONTEXT_BUTTON button);
72 bool OnContextButtonInfo(CFileItem *item, CONTEXT_BUTTON button);
73 bool OnContextButtonPlay(CFileItem *item, CONTEXT_BUTTON button);
74 bool OnContextButtonStartRecord(CFileItem *item, CONTEXT_BUTTON button);
75 bool OnContextButtonStopRecord(CFileItem *item, CONTEXT_BUTTON button);
77 void UpdateButtons(void);
78 void UpdateViewChannel(bool bUpdateSelectedFile);
79 void UpdateViewNow(bool bUpdateSelectedFile);
80 void UpdateViewNext(bool bUpdateSelectedFile);
81 void UpdateViewTimeline(bool bUpdateSelectedFile);
84 CFileItemList *m_cachedTimeline;
85 CPVRChannelGroupPtr m_cachedChannelGroup;