[Windows] Fix driver version detection of AMD RDNA+ GPU on Windows 10
[xbmc.git] / xbmc / guilib / GUIStaticItem.h
bloba68f7394e503d38e06aaa4a01306f294a1814509
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 /*!
12 \file GUIStaticItem.h
13 \brief
16 #include "FileItem.h"
17 #include "GUIAction.h"
18 #include "guilib/guiinfo/GUIInfoLabel.h"
19 #include "interfaces/info/InfoBool.h"
21 #include <utility>
22 #include <vector>
24 class TiXmlElement;
26 /*!
27 \ingroup lists,items
28 \brief wrapper class for a static item in a list container
30 A wrapper class for the items in a container specified via the <content>
31 flag. Handles constructing items from XML and updating item labels, icons
32 and properties.
34 \sa CFileItem, CGUIBaseContainer
36 class CGUIStaticItem : public CFileItem
38 public:
39 /*! \brief constructor
40 Construct an item based on an XML description:
41 <item>
42 <label>$INFO[MusicPlayer.Artist]</label>
43 <label2>$INFO[MusicPlayer.Album]</label2>
44 <thumb>bar.png</thumb>
45 <icon>foo.jpg</icon>
46 <onclick>ActivateWindow(Home)</onclick>
47 </item>
49 \param element XML element to construct from
50 \param contextWindow window context to use for any info labels
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); }
58 /*! \brief update any infolabels in the items properties
59 Runs through all the items properties, updating any that should be
60 periodically recomputed
61 \param contextWindow window context to use for any info labels
63 void UpdateProperties(int contextWindow);
65 /*! \brief update visibility of this item
66 \param contextWindow window context to use for any info labels
67 \return true if visible state has changed, false otherwise
69 bool UpdateVisibility(int contextWindow);
71 /*! \brief whether this item is visible or not
73 bool IsVisible() const;
75 /*! \brief set a visible condition for this item.
76 \param condition the condition to use.
77 \param context the context for the condition (typically a window id).
79 void SetVisibleCondition(const std::string &condition, int context);
81 const CGUIAction& GetClickActions() const { return m_clickActions; }
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;
91 typedef std::shared_ptr<CGUIStaticItem> CGUIStaticItemPtr;