2 * Copyright (C) 2005-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
28 #include "GUIInfoTypes.h"
29 #include "xbmc/FileItem.h"
30 #include "GUIAction.h"
36 \brief wrapper class for a static item in a list container
38 A wrapper class for the items in a container specified via the <content>
39 flag. Handles constructing items from XML and updating item labels, icons
42 \sa CFileItem, CGUIBaseContainer
44 class CGUIStaticItem : public CFileItem
47 /*! \brief constructor
48 Construct an item based on an XML description:
50 <label>$INFO[MusicPlayer.Artist]</label>
51 <label2>$INFO[MusicPlayer.Album]</label2>
52 <thumb>bar.png</thumb>
54 <onclick>ActivateWindow(Home)</onclick>
57 \param element XML element to construct from
58 \param contextWindow window context to use for any info labels
60 CGUIStaticItem(const TiXmlElement *element, int contextWindow);
61 CGUIStaticItem(const CFileItem &item); // for python
62 virtual ~CGUIStaticItem() {};
63 virtual CGUIListItem *Clone() const { return new CGUIStaticItem(*this); };
65 /*! \brief update any infolabels in the items properties
66 Runs through all the items properties, updating any that should be
67 periodically recomputed
68 \param contextWindow window context to use for any info labels
70 void UpdateProperties(int contextWindow);
72 /*! \brief update visibility of this item
73 \param contextWindow window context to use for any info labels
74 \return true if visible state has changed, false otherwise
76 bool UpdateVisibility(int contextWindow);
78 /*! \brief whether this item is visible or not
80 bool IsVisible() const;
82 /*! \brief set a visible condition for this item.
83 \param condition the condition to use.
84 \param context the context for the condition (typically a window id).
86 void SetVisibleCondition(const std::string &condition, int context);
88 const CGUIAction &GetClickActions() const { return m_clickActions; };
90 typedef std::vector< std::pair<CGUIInfoLabel, CStdString> > InfoVector;
92 INFO::InfoPtr m_visCondition;
94 CGUIAction m_clickActions;
97 typedef boost::shared_ptr<CGUIStaticItem> CGUIStaticItemPtr;