Merge pull request #4775 from jmarshallnz/empty_episode_playcount
[vuplus_xbmc] / xbmc / dialogs / GUIDialogSmartPlaylistEditor.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2005-2013 Team XBMC
5  *      http://xbmc.org
6  *
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)
10  *  any later version.
11  *
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.
16  *
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/>.
20  *
21  */
22
23 #include "guilib/GUIDialog.h"
24 #include "playlists/SmartPlayList.h"
25
26 class CFileItemList;
27
28 class CGUIDialogSmartPlaylistEditor :
29       public CGUIDialog
30 {
31 public:
32   enum PLAYLIST_TYPE { TYPE_SONGS = 1, TYPE_ALBUMS, TYPE_ARTISTS, TYPE_MIXED, TYPE_MUSICVIDEOS, TYPE_MOVIES, TYPE_TVSHOWS, TYPE_EPISODES };
33
34   CGUIDialogSmartPlaylistEditor(void);
35   virtual ~CGUIDialogSmartPlaylistEditor(void);
36   virtual bool OnMessage(CGUIMessage& message);
37   virtual bool OnBack(int actionID);
38   virtual void OnWindowLoaded();
39   virtual void OnInitWindow();
40   virtual void OnDeinitWindow(int nextWindowID);
41
42   static bool EditPlaylist(const CStdString &path, const CStdString &type = "");
43   static bool NewPlaylist(const CStdString &type);
44
45 protected:
46   void OnRuleList(int item);
47   void OnRuleAdd();
48   void OnRuleRemove(int item);
49   void OnMatch();
50   void OnLimit();
51   void OnType();
52   void OnOrder();
53   void OnOrderDirection();
54   void OnGroupBy();
55   void OnGroupMixed();
56   void OnOK();
57   void OnCancel();
58   void UpdateButtons();
59   void UpdateRuleControlButtons();
60   int GetSelectedItem();
61   void HighlightItem(int item);
62   PLAYLIST_TYPE ConvertType(const CStdString &type);
63   CStdString ConvertType(PLAYLIST_TYPE type);
64   int GetLocalizedType(PLAYLIST_TYPE type);
65
66   CSmartPlaylist m_playlist;
67
68   // our list of rules for display purposes
69   CFileItemList* m_ruleLabels;
70
71   CStdString m_path;
72   bool m_cancelled;
73   CStdString m_mode;  // mode we're in (partymode etc.)
74 };