Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
IListProvider Class Referenceabstract

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

#include <IListProvider.h>

Inheritance diagram for IListProvider:
CDirectoryProvider CMultiProvider CStaticListProvider KODI::GAME::CGUIGameControllerProvider

Public Member Functions

 IListProvider (int parentID)
 
 IListProvider (const IListProvider &other)=default
 
virtual ~IListProvider ()=default
 
virtual std::unique_ptr< IListProviderClone ()=0
 Create an instance of the derived class. Allows for polymorphic copies.
 
virtual bool Update (bool forceRefresh)=0
 Update the list content.
 
virtual void Fetch (std::vector< std::shared_ptr< CGUIListItem > > &items)=0
 Fetch the current list of items.
 
virtual bool IsUpdating () const
 Check whether the list provider is updating content.
 
virtual void Reset ()
 Reset the current list of items. Derived classes may choose to ignore this.
 
virtual void FreeResources (bool immediately)
 Free all GUI resources allocated by the items.
 
virtual bool OnClick (const std::shared_ptr< CGUIListItem > &item)=0
 Click event on an item.
 
virtual bool OnPlay (const std::shared_ptr< CGUIListItem > &item)
 Play event on an item.
 
virtual bool OnInfo (const std::shared_ptr< CGUIListItem > &item)=0
 Open the info dialog for an item provided by this IListProvider.
 
virtual bool OnContextMenu (const std::shared_ptr< CGUIListItem > &item)=0
 Open the context menu for an item provided by this IListProvider.
 
virtual void SetDefaultItem (int item, bool always)
 Set the default item to focus. For backwards compatibility.
 
virtual int GetDefaultItem () const
 The default item to focus.
 
virtual bool AlwaysFocusDefaultItem () const
 Whether to always focus the default item.
 

Static Public Member Functions

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

Protected Attributes

int m_parentID
 

Detailed Description

An interface for providing lists to UI containers.

Constructor & Destructor Documentation

◆ IListProvider() [1/2]

IListProvider::IListProvider ( int parentID)
inlineexplicit

◆ IListProvider() [2/2]

IListProvider::IListProvider ( const IListProvider & other)
explicitdefault

◆ ~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, and KODI::GAME::CGUIGameControllerProvider.

◆ Clone()

virtual std::unique_ptr< IListProvider > IListProvider::Clone ( )
pure virtual

Create an instance of the derived class. Allows for polymorphic copies.

Implemented in CDirectoryProvider, CMultiProvider, CStaticListProvider, and KODI::GAME::CGUIGameControllerProvider.

◆ Create()

std::unique_ptr< 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, empty pointer if none.

◆ CreateSingle()

std::unique_ptr< 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, empty pointer if none.

◆ Fetch()

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

Fetch the current list of items.

Parameters
items[out] the list to be filled.

Implemented in CDirectoryProvider, CMultiProvider, CStaticListProvider, and KODI::GAME::CGUIGameControllerProvider.

◆ FreeResources()

virtual void IListProvider::FreeResources ( bool immediately)
inlinevirtual

Free all GUI resources allocated by the items.

Parameters
immediatelytrue to free resources immediately, free resources async later otherwise.

Reimplemented in CDirectoryProvider.

◆ 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, and KODI::GAME::CGUIGameControllerProvider.

◆ 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 std::shared_ptr< CGUIListItem > & 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, CStaticListProvider, and KODI::GAME::CGUIGameControllerProvider.

◆ OnContextMenu()

virtual bool IListProvider::OnContextMenu ( const std::shared_ptr< CGUIListItem > & 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, CStaticListProvider, and KODI::GAME::CGUIGameControllerProvider.

◆ OnInfo()

virtual bool IListProvider::OnInfo ( const std::shared_ptr< CGUIListItem > & 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, CStaticListProvider, and KODI::GAME::CGUIGameControllerProvider.

◆ OnPlay()

virtual bool IListProvider::OnPlay ( const std::shared_ptr< CGUIListItem > & item)
inlinevirtual

Play event on an item.

Parameters
itemthe item to play.
Returns
true if the event was handled, false otherwise.

Reimplemented in CDirectoryProvider.

◆ Reset()

virtual void IListProvider::Reset ( )
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, and KODI::GAME::CGUIGameControllerProvider.

◆ 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, CStaticListProvider, and KODI::GAME::CGUIGameControllerProvider.

Member Data Documentation

◆ m_parentID

int IListProvider::m_parentID
protected

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