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

#include <DirectoryProvider.h>

Inheritance diagram for CDirectoryProvider:
IListProvider IJobCallback ANNOUNCEMENT::IAnnouncer

Public Types

enum  UpdateState { OK , INVALIDATED , DONE }
 
enum class  BrowseMode { NEVER , AUTO , ALWAYS }
 

Public Member Functions

 CDirectoryProvider (const TiXmlElement *element, int parentID)
 
 CDirectoryProvider (const CDirectoryProvider &other)
 
 ~CDirectoryProvider () 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 Announce (ANNOUNCEMENT::AnnouncementFlag flag, const std::string &sender, const std::string &message, const CVariant &data) override
 
void Fetch (std::vector< std::shared_ptr< CGUIListItem > > &items) override
 Fetch the current list of items.
 
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 OnPlay (const std::shared_ptr< CGUIListItem > &item) override
 Play event on an item.
 
bool OnInfo (const std::shared_ptr< CFileItem > &item)
 
bool OnContextMenu (const std::shared_ptr< CFileItem > &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.
 
bool IsUpdating () const override
 Check whether the list provider is updating content.
 
void FreeResources (bool immediately) override
 Free all GUI resources allocated by the items.
 
void OnJobComplete (unsigned int jobID, bool success, CJob *job) override
 The callback used when a job completes.
 
- Public Member Functions inherited from IListProvider
 IListProvider (int parentID)
 
 IListProvider (const IListProvider &other)=default
 
virtual ~IListProvider ()=default
 
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.
 
- Public Member Functions inherited from IJobCallback
virtual ~IJobCallback ()=default
 Destructor for job call back objects.
 
virtual void OnJobAbort (unsigned int jobID, CJob *job)
 An optional callback function used when a job will be aborted.
 
virtual void OnJobProgress (unsigned int jobID, unsigned int progress, unsigned int total, const CJob *job)
 An optional callback function that a job may call while processing.
 
- Public Member Functions inherited from ANNOUNCEMENT::IAnnouncer
 IAnnouncer ()=default
 
virtual ~IAnnouncer ()=default
 

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
 

Member Enumeration Documentation

◆ BrowseMode

enum class CDirectoryProvider::BrowseMode
strong
Enumerator
NEVER 
AUTO 
ALWAYS 

◆ UpdateState

Enumerator
OK 
INVALIDATED 
DONE 

Constructor & Destructor Documentation

◆ CDirectoryProvider() [1/2]

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

◆ CDirectoryProvider() [2/2]

CDirectoryProvider::CDirectoryProvider ( const CDirectoryProvider & other)
explicit

◆ ~CDirectoryProvider()

CDirectoryProvider::~CDirectoryProvider ( )
override

Member Function Documentation

◆ Announce()

void CDirectoryProvider::Announce ( ANNOUNCEMENT::AnnouncementFlag flag,
const std::string & sender,
const std::string & message,
const CVariant & data )
overridevirtual

◆ Clone()

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

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

Implements IListProvider.

◆ Fetch()

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

◆ FreeResources()

void CDirectoryProvider::FreeResources ( bool immediately)
overridevirtual

Free all GUI resources allocated by the items.

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

Reimplemented from IListProvider.

◆ IsUpdating()

bool CDirectoryProvider::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 CDirectoryProvider::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() [1/2]

bool CDirectoryProvider::OnContextMenu ( const std::shared_ptr< CFileItem > & item)

◆ OnContextMenu() [2/2]

bool CDirectoryProvider::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() [1/2]

bool CDirectoryProvider::OnInfo ( const std::shared_ptr< CFileItem > & item)

◆ OnInfo() [2/2]

bool CDirectoryProvider::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.

◆ OnJobComplete()

void CDirectoryProvider::OnJobComplete ( unsigned int jobID,
bool success,
CJob * job )
overridevirtual

The callback used when a job completes.

OnJobComplete is called at the completion of the job's DoWork() function, and is used to return information to the caller on the result of the job. On returning form this function the CJobManager will destroy this job.

Parameters
jobIDthe unique id of the job (as retrieved from CJobManager::AddJob)
successthe result from the DoWork call
jobthe job that has been processed. The job will be destroyed after this function returns
See also
CJobManager and CJob

Implements IJobCallback.

◆ OnPlay()

bool CDirectoryProvider::OnPlay ( const std::shared_ptr< CGUIListItem > & item)
overridevirtual

Play event on an item.

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

Reimplemented from IListProvider.

◆ Reset()

void CDirectoryProvider::Reset ( )
overridevirtual

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

Reimplemented from IListProvider.

◆ Update()

bool CDirectoryProvider::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: