kodi
GUIStaticItem.h
Go to the documentation of this file.
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 
16 #include "FileItem.h"
17 #include "GUIAction.h"
19 #include "interfaces/info/InfoBool.h"
20 
21 #include <utility>
22 #include <vector>
23 
24 class TiXmlElement;
25 
36 class CGUIStaticItem : public CFileItem
37 {
38 public:
52  CGUIStaticItem(const TiXmlElement *element, int contextWindow);
53  explicit CGUIStaticItem(const CFileItem &item); // for python
54  explicit CGUIStaticItem(const CGUIStaticItem& other);
55  ~CGUIStaticItem() override = default;
56  CGUIListItem* Clone() const override { return new CGUIStaticItem(*this); }
57 
63  void UpdateProperties(int contextWindow);
64 
69  bool UpdateVisibility(int contextWindow);
70 
73  bool IsVisible() const;
74 
79  void SetVisibleCondition(const std::string &condition, int context);
80 
81  const CGUIAction& GetClickActions() const { return m_clickActions; }
82 
83 private:
84  typedef std::vector< std::pair<KODI::GUILIB::GUIINFO::CGUIInfoLabel, std::string> > InfoVector;
85  InfoVector m_info;
86  INFO::InfoPtr m_visCondition;
87  bool m_visState;
88  CGUIAction m_clickActions;
89 };
90 
91 typedef std::shared_ptr<CGUIStaticItem> CGUIStaticItemPtr;
Definition: GUIListItem.h:29
bool UpdateVisibility(int contextWindow)
update visibility of this item
Definition: GUIStaticItem.cpp:101
void SetVisibleCondition(const std::string &condition, int context)
set a visible condition for this item.
Definition: GUIStaticItem.cpp:121
CGUIStaticItem(const TiXmlElement *element, int contextWindow)
constructor Construct an item based on an XML description: <label>$INFO[MusicPlayer.Artist]</label> <label2>$INFO[MusicPlayer.Album]</label2> <thumb>bar.png</thumb> <icon>foo.jpg</icon> <onclick>ActivateWindow(Home)</onclick>
Definition: GUIStaticItem.cpp:20
wrapper class for a static item in a list container
Definition: GUIStaticItem.h:36
bool IsVisible() const
whether this item is visible or not
Definition: GUIStaticItem.cpp:114
Represents a file on a share.
Definition: FileItem.h:102
void UpdateProperties(int contextWindow)
update any infolabels in the items properties Runs through all the items properties, updating any that should be periodically recomputed
Definition: GUIStaticItem.cpp:80
Class containing vector of condition->(action/navigation route) and handling its execution.
Definition: GUIAction.h:21