Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
IListProvider Class Referenceabstract

An interface for providing lists to UI containers. More...

#include <IListProvider.h>

Inheritance diagram for IListProvider:
CDirectoryProvider CMultiProvider CStaticListProvider

Public Member Functions

 IListProvider (int parentID)
 
virtual ~IListProvider ()=default
 
virtual bool Update (bool forceRefresh)=0
 Update the list content. More...
 
virtual void Fetch (std::vector< CGUIListItemPtr > &items)=0
 Fetch the current list of items. More...
 
virtual bool IsUpdating () const
 Check whether the list provider is updating content. More...
 
virtual void Reset ()
 Reset the current list of items. Derived classes may choose to ignore this. More...
 
virtual bool OnClick (const CGUIListItemPtr &item)=0
 Click event on an item. More...
 
virtual bool OnInfo (const CGUIListItemPtr &item)=0
 Open the info dialog for an item provided by this IListProvider. More...
 
virtual bool OnContextMenu (const CGUIListItemPtr &item)=0
 Open the context menu for an item provided by this IListProvider. More...
 
virtual void SetDefaultItem (int item, bool always)
 Set the default item to focus. For backwards compatibility. More...
 
virtual int GetDefaultItem () const
 The default item to focus. More...
 
virtual bool AlwaysFocusDefaultItem () const
 Whether to always focus the default item. More...
 

Static Public Member Functions

static IListProviderCreate (const TiXmlNode *parent, int parentID)
 Factory to create list providers. More...
 
static IListProviderCreateSingle (const TiXmlNode *content, int parentID)
 Factory to create list providers. Cannot create a multi-provider. More...
 

Protected Attributes

int m_parentID
 

Detailed Description

An interface for providing lists to UI containers.

Constructor & Destructor Documentation

◆ IListProvider()

IListProvider::IListProvider ( int  parentID)
inlineexplicit

◆ ~IListProvider()

virtual IListProvider::~IListProvider ( )
virtualdefault

Member Function Documentation

◆ AlwaysFocusDefaultItem()

virtual bool IListProvider::AlwaysFocusDefaultItem ( ) const
inlinevirtual

Whether to always focus the default item.

Returns
true if the default item should always be the one to receive focus.
See also
GetDefaultItem, SetDefaultItem

Reimplemented in CStaticListProvider.

◆ Create()

IListProvider * IListProvider::Create ( const TiXmlNode *  parent,
int  parentID 
)
static

Factory to create list providers.

Parameters
parenta parent TiXmlNode for the container.
parentIDid of parent window for context.
Returns
the list provider, NULL if none.

◆ CreateSingle()

IListProvider * IListProvider::CreateSingle ( const TiXmlNode *  content,
int  parentID 
)
static

Factory to create list providers. Cannot create a multi-provider.

Parameters
contentthe TiXmlNode for the content to create.
parentIDid of parent window for context.
Returns
the list provider, NULL if none.

◆ Fetch()

virtual void IListProvider::Fetch ( std::vector< CGUIListItemPtr > &  items)
pure virtual

Fetch the current list of items.

Parameters
items[out] the list to be filled.

Implemented in CDirectoryProvider, CMultiProvider, and CStaticListProvider.

◆ GetDefaultItem()

virtual int IListProvider::GetDefaultItem ( ) const
inlinevirtual

The default item to focus.

Returns
the item to focus by default. -1 for none.
See also
SetDefaultItem, AlwaysFocusDefaultItem

Reimplemented in CStaticListProvider.

◆ IsUpdating()

virtual bool IListProvider::IsUpdating ( ) const
inlinevirtual

Check whether the list provider is updating content.

Returns
true if in the processing of updating, false otherwise.

Reimplemented in CDirectoryProvider, and CMultiProvider.

◆ OnClick()

virtual bool IListProvider::OnClick ( const CGUIListItemPtr item)
pure virtual

Click event on an item.

Parameters
itemthe item that was clicked.
Returns
true if the click was handled, false otherwise.

Implemented in CDirectoryProvider, CMultiProvider, and CStaticListProvider.

◆ OnContextMenu()

virtual bool IListProvider::OnContextMenu ( const CGUIListItemPtr item)
pure virtual

Open the context menu for an item provided by this IListProvider.

Parameters
itemthe item that was clicked.
Returns
true if the click was handled, false otherwise.

Implemented in CDirectoryProvider, CMultiProvider, and CStaticListProvider.

◆ OnInfo()

virtual bool IListProvider::OnInfo ( const CGUIListItemPtr item)
pure virtual

Open the info dialog for an item provided by this IListProvider.

Parameters
itemthe item that was clicked.
Returns
true if the dialog was shown, false otherwise.

Implemented in CDirectoryProvider, CMultiProvider, and CStaticListProvider.

◆ Reset()

virtual void IListProvider::Reset ( void  )
inlinevirtual

Reset the current list of items. Derived classes may choose to ignore this.

Reimplemented in CDirectoryProvider, and CMultiProvider.

◆ SetDefaultItem()

virtual void IListProvider::SetDefaultItem ( int  item,
bool  always 
)
inlinevirtual

Set the default item to focus. For backwards compatibility.

Parameters
itemthe item to focus.
alwayswhether this item should always be used on first focus.
See also
GetDefaultItem, AlwaysFocusDefaultItem

Reimplemented in CStaticListProvider.

◆ Update()

virtual bool IListProvider::Update ( bool  forceRefresh)
pure virtual

Update the list content.

Returns
true if the content has changed, false otherwise.

Implemented in CDirectoryProvider, CMultiProvider, and CStaticListProvider.

Member Data Documentation

◆ m_parentID

int IListProvider::m_parentID
protected

The documentation for this class was generated from the following files: