kodi
GUIControlsGUIInfo.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 "guilib/WindowIDs.h"
12 #include "guilib/guiinfo/GUIInfoProvider.h"
13 
14 #include <map>
15 
16 namespace KODI
17 {
18 namespace GUILIB
19 {
20 namespace GUIINFO
21 {
22 
23 class CGUIInfo;
24 
26 {
27 public:
28  ~CGUIControlsGUIInfo() override = default;
29 
30  // KODI::GUILIB::GUIINFO::IGUIInfoProvider implementation
31  bool InitCurrentItem(CFileItem *item) override;
32  bool GetLabel(std::string& value, const CFileItem *item, int contextWindow, const CGUIInfo &info, std::string *fallback) const override;
33  bool GetInt(int& value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override;
34  bool GetBool(bool& value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override;
35 
36  void SetNextWindow(int windowID) { m_nextWindowID = windowID; }
37  void SetPreviousWindow(int windowID) { m_prevWindowID = windowID; }
38 
44  void SetContainerMoving(int id, bool next, bool scrolling);
45  void ResetContainerMovingCache();
46 
47 private:
48  int m_nextWindowID = WINDOW_INVALID;
49  int m_prevWindowID = WINDOW_INVALID;
50 
51  std::map<int, int> m_containerMoves; // direction of list moving
52 };
53 
54 } // namespace GUIINFO
55 } // namespace GUILIB
56 } // namespace KODI
Definition: GUIListItem.h:29
Definition: GUIInfoProvider.h:23
Definition: GUIControlsGUIInfo.h:25
bool GetInt(int &value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override
Get a GUIInfoManager integer value.
Definition: GUIControlsGUIInfo.cpp:396
bool GetBool(bool &value, const CGUIListItem *item, int contextWindow, const CGUIInfo &info) const override
Get a GUIInfoManager bool value.
Definition: GUIControlsGUIInfo.cpp:415
Definition: AudioDecoder.h:18
bool GetLabel(std::string &value, const CFileItem *item, int contextWindow, const CGUIInfo &info, std::string *fallback) const override
Get a GUIInfoManager label string.
Definition: GUIControlsGUIInfo.cpp:57
void SetContainerMoving(int id, bool next, bool scrolling)
containers call this to specify that the focus is changing
Definition: GUIControlsGUIInfo.cpp:41
bool InitCurrentItem(CFileItem *item) override
Init a new current guiinfo manager item. Gets called whenever the active guiinfo manager item changes...
Definition: GUIControlsGUIInfo.cpp:52
Definition: GUIInfo.h:23
Represents a file on a share.
Definition: FileItem.h:102