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

#include <StaticProvider.h>

Inheritance diagram for CStaticListProvider:
IListProvider

Public Member Functions

 CStaticListProvider (const TiXmlElement *element, int parentID)
 
 CStaticListProvider (const std::vector< CGUIStaticItemPtr > &items)
 
 CStaticListProvider (const CStaticListProvider &other)
 
 ~CStaticListProvider () override
 
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 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.
 
void SetDefaultItem (int item, bool always) override
 Set the default item to focus. For backwards compatibility.
 
int GetDefaultItem () const override
 The default item to focus.
 
bool AlwaysFocusDefaultItem () const override
 Whether to always focus the default item.
 
- Public Member Functions inherited from IListProvider
 IListProvider (int parentID)
 
 IListProvider (const IListProvider &other)=default
 
virtual ~IListProvider ()=default
 
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 OnPlay (const std::shared_ptr< CGUIListItem > &item)
 Play event on an item.
 

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.
 
- Protected Attributes inherited from IListProvider
int m_parentID
 

Constructor & Destructor Documentation

◆ CStaticListProvider() [1/3]

CStaticListProvider::CStaticListProvider ( const TiXmlElement * element,
int parentID )

◆ CStaticListProvider() [2/3]

CStaticListProvider::CStaticListProvider ( const std::vector< CGUIStaticItemPtr > & items)
explicit

◆ CStaticListProvider() [3/3]

CStaticListProvider::CStaticListProvider ( const CStaticListProvider & other)
explicit

◆ ~CStaticListProvider()

CStaticListProvider::~CStaticListProvider ( )
overridedefault

Member Function Documentation

◆ AlwaysFocusDefaultItem()

bool CStaticListProvider::AlwaysFocusDefaultItem ( ) const
overridevirtual

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 from IListProvider.

◆ Clone()

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

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

Implements IListProvider.

◆ Fetch()

void CStaticListProvider::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.

◆ GetDefaultItem()

int CStaticListProvider::GetDefaultItem ( ) const
overridevirtual

The default item to focus.

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

Reimplemented from IListProvider.

◆ OnClick()

bool CStaticListProvider::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 CStaticListProvider::OnContextMenu ( const std::shared_ptr< CGUIListItem > & item)
inlineoverridevirtual

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 CStaticListProvider::OnInfo ( const std::shared_ptr< CGUIListItem > & item)
inlineoverridevirtual

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.

◆ SetDefaultItem()

void CStaticListProvider::SetDefaultItem ( int item,
bool always )
overridevirtual

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 from IListProvider.

◆ Update()

bool CStaticListProvider::Update ( bool forceRefresh)
overridevirtual

Update the list content.

Returns
true if the content has changed, false otherwise.
Todo
Also returned changed if properties are changed (if so, need to update scroll to letter).

Implements IListProvider.


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