16 typedef std::shared_ptr<CGUIListItem> CGUIListItemPtr;
25 explicit IListProvider(
int parentID) : m_parentID(parentID) {}
34 static std::unique_ptr<IListProvider>
Create(
const TiXmlNode* parent,
int parentID);
41 static std::unique_ptr<IListProvider>
CreateSingle(
const TiXmlNode* content,
int parentID);
45 virtual std::unique_ptr<IListProvider>
Clone() = 0;
50 virtual bool Update(
bool forceRefresh)=0;
55 virtual void Fetch(std::vector<CGUIListItemPtr> &items)=0;
76 virtual bool OnClick(
const CGUIListItemPtr &item)=0;
82 virtual bool OnPlay(
const CGUIListItemPtr& item) {
return false; }
88 virtual bool OnInfo(
const CGUIListItemPtr &item)=0;
An interface for providing lists to UI containers.
Definition: IListProvider.h:22
Definition: GUIListItem.h:30
virtual bool IsUpdating() const
Check whether the list provider is updating content.
Definition: IListProvider.h:60
virtual bool AlwaysFocusDefaultItem() const
Whether to always focus the default item.
Definition: IListProvider.h:113
virtual bool OnPlay(const CGUIListItemPtr &item)
Play event on an item.
Definition: IListProvider.h:82
static std::unique_ptr< IListProvider > Create(const TiXmlNode *parent, int parentID)
Factory to create list providers.
Definition: IListProvider.cpp:16
virtual void Fetch(std::vector< CGUIListItemPtr > &items)=0
Fetch the current list of items.
virtual void Reset()
Reset the current list of items. Derived classes may choose to ignore this.
Definition: IListProvider.h:65
virtual bool OnContextMenu(const CGUIListItemPtr &item)=0
Open the context menu for an item provided by this IListProvider.
virtual std::unique_ptr< IListProvider > Clone()=0
Create an instance of the derived class. Allows for polymorphic copies.
virtual int GetDefaultItem() const
The default item to focus.
Definition: IListProvider.h:107
static std::unique_ptr< IListProvider > CreateSingle(const TiXmlNode *content, int parentID)
Factory to create list providers. Cannot create a multi-provider.
Definition: IListProvider.cpp:30
virtual bool OnInfo(const CGUIListItemPtr &item)=0
Open the info dialog for an item provided by this IListProvider.
virtual bool OnClick(const CGUIListItemPtr &item)=0
Click event on an item.
virtual bool Update(bool forceRefresh)=0
Update the list content.
virtual void FreeResources(bool immediately)
Free all GUI resources allocated by the items.
Definition: IListProvider.h:70
virtual void SetDefaultItem(int item, bool always)
Set the default item to focus. For backwards compatibility.
Definition: IListProvider.h:101