xbmc
GUIWindowVideoNav.h
1 /*
2  * Copyright (C) 2005-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 "GUIWindowVideoBase.h"
12 
13 class CFileItemList;
14 
15 enum SelectFirstUnwatchedItem
16 {
17  NEVER = 0,
18  ON_FIRST_ENTRY = 1,
19  ALWAYS = 2
20 };
21 
22 enum IncludeAllSeasonsAndSpecials
23 {
24  NEITHER = 0,
25  BOTH = 1,
26  ALL_SEASONS = 2,
27  SPECIALS = 3
28 };
29 
31 {
32 public:
33 
34  CGUIWindowVideoNav(void);
35  ~CGUIWindowVideoNav(void) override;
36 
37  bool OnAction(const CAction &action) override;
38  bool OnMessage(CGUIMessage& message) override;
39 
40 protected:
41  bool ApplyWatchedFilter(CFileItemList &items);
42  bool GetFilteredItems(const std::string &filter, CFileItemList &items) override;
43 
44  void OnItemLoaded(CFileItem* pItem) override {};
45 
46  // override base class methods
47  bool Update(const std::string &strDirectory, bool updateFilterPath = true) override;
48  bool GetDirectory(const std::string &strDirectory, CFileItemList &items) override;
49  void UpdateButtons() override;
50  void DoSearch(const std::string& strSearch, CFileItemList& items) override;
51  virtual void PlayItem(int iItem);
52  void OnDeleteItem(const CFileItemPtr& pItem) override;
53  void GetContextButtons(int itemNumber, CContextButtons &buttons) override;
54  bool OnPopupMenu(int iItem) override;
55  bool OnContextButton(int itemNumber, CONTEXT_BUTTON button) override;
56  bool OnAddMediaSource() override;
57  bool OnClick(int iItem, const std::string &player = "") override;
58  std::string GetStartFolder(const std::string &dir) override;
59 
60  VECSOURCES m_shares;
61 
62 private:
63  virtual SelectFirstUnwatchedItem GetSettingSelectFirstUnwatchedItem();
64  virtual IncludeAllSeasonsAndSpecials GetSettingIncludeAllSeasonsAndSpecials();
65  virtual int GetFirstUnwatchedItemIndex(bool includeAllSeasons, bool includeSpecials);
66  void SelectFirstUnwatched();
67 };
std::string GetStartFolder(const std::string &dir) override
Translate the folder to start in from the given quick path.
Definition: GUIWindowVideoNav.cpp:1052
bool Update(const std::string &strDirectory, bool updateFilterPath=true) override
Retrieves the items from the given path and updates the list.
Definition: GUIWindowVideoNav.cpp:319
Represents a list of files.
Definition: FileItem.h:721
class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition: Action.h:22
bool GetDirectory(const std::string &strDirectory, CFileItemList &items) override
Overwrite to fill fileitems from a source.
Definition: GUIWindowVideoNav.cpp:350
Definition: GUIWindowVideoNav.h:30
void DoSearch(const std::string &strSearch, CFileItemList &items) override
Search for names, genres, artists, directors, and plots with search string strSearch in the...
Definition: GUIWindowVideoNav.cpp:579
Definition: GUIWindowVideoBase.h:23
Definition: GUIMessage.h:365
Definition: GUIDialogContextMenu.h:92
void UpdateButtons() override
Updates the states.
Definition: GUIWindowVideoNav.cpp:507
Represents a file on a share.
Definition: FileItem.h:102
bool OnClick(int iItem, const std::string &player="") override
On click.
Definition: GUIWindowVideoNav.cpp:974