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

A listprovider that handles multiple individual providers. More...

#include <MultiProvider.h>

Inheritance diagram for CMultiProvider:
IListProvider

Public Member Functions

 CMultiProvider (const TiXmlNode *first, int parentID)
 
 CMultiProvider (const CMultiProvider &other)
 
std::unique_ptr< IListProviderClone () override
 Create an instance of the derived class. Allows for polymorphic copies.
 
bool Update (bool forceRefresh) override
 Update the list content.
 
void Fetch (std::vector< std::shared_ptr< CGUIListItem > > &items) override
 Fetch the current list of items.
 
bool IsUpdating () const override
 Check whether the list provider is updating content.
 
void Reset () override
 Reset the current list of items. Derived classes may choose to ignore this.
 
bool OnClick (const std::shared_ptr< CGUIListItem > &item) override
 Click event on an item.
 
bool OnInfo (const std::shared_ptr< CGUIListItem > &item) override
 Open the info dialog for an item provided by this IListProvider.
 
bool OnContextMenu (const std::shared_ptr< CGUIListItem > &item) override
 Open the context menu for an item provided by this IListProvider.
 
- Public Member Functions inherited from IListProvider
 IListProvider (int parentID)
 
 IListProvider (const IListProvider &other)=default
 
virtual ~IListProvider ()=default
 
virtual void FreeResources (bool immediately)
 Free all GUI resources allocated by the items.
 
virtual bool OnPlay (const std::shared_ptr< CGUIListItem > &item)
 Play event on an item.
 
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.
 

Protected Types

typedef size_t item_key_type
 

Static Protected Member Functions

static item_key_type GetItemKey (std::shared_ptr< CGUIListItem > const &item)
 

Protected Attributes

std::vector< IListProviderPtrm_providers
 
std::map< item_key_type, IListProvider * > m_itemMap
 
CCriticalSection m_section
 
- Protected Attributes inherited from IListProvider
int m_parentID
 

Additional Inherited Members

- Static Public Member Functions inherited from IListProvider
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.
 

Detailed Description

A listprovider that handles multiple individual providers.

Member Typedef Documentation

◆ item_key_type

typedef size_t CMultiProvider::item_key_type
protected

Constructor & Destructor Documentation

◆ CMultiProvider() [1/2]

CMultiProvider::CMultiProvider ( const TiXmlNode * first,
int parentID )

◆ CMultiProvider() [2/2]

CMultiProvider::CMultiProvider ( const CMultiProvider & other)
explicit

Member Function Documentation

◆ Clone()

std::unique_ptr< IListProvider > CMultiProvider::Clone ( )
overridevirtual

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

Implements IListProvider.

◆ Fetch()

void CMultiProvider::Fetch ( std::vector< std::shared_ptr< CGUIListItem > > & items)
overridevirtual

Fetch the current list of items.

Parameters
items[out] the list to be filled.

Implements IListProvider.

◆ GetItemKey()

CMultiProvider::item_key_type CMultiProvider::GetItemKey ( std::shared_ptr< CGUIListItem > const & item)
staticprotected

◆ IsUpdating()

bool CMultiProvider::IsUpdating ( ) const
overridevirtual

Check whether the list provider is updating content.

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

Reimplemented from IListProvider.

◆ OnClick()

bool CMultiProvider::OnClick ( const std::shared_ptr< CGUIListItem > & item)
overridevirtual

Click event on an item.

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

Implements IListProvider.

◆ OnContextMenu()

bool CMultiProvider::OnContextMenu ( const std::shared_ptr< CGUIListItem > & item)
overridevirtual

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.

Implements IListProvider.

◆ OnInfo()

bool CMultiProvider::OnInfo ( const std::shared_ptr< CGUIListItem > & item)
overridevirtual

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.

Implements IListProvider.

◆ Reset()

void CMultiProvider::Reset ( )
overridevirtual

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

Reimplemented from IListProvider.

◆ Update()

bool CMultiProvider::Update ( bool forceRefresh)
overridevirtual

Update the list content.

Returns
true if the content has changed, false otherwise.

Implements IListProvider.

Member Data Documentation

◆ m_itemMap

std::map<item_key_type, IListProvider*> CMultiProvider::m_itemMap
protected

◆ m_providers

std::vector<IListProviderPtr> CMultiProvider::m_providers
protected

◆ m_section

CCriticalSection CMultiProvider::m_section
protected

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