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

#include <RepositoryUpdater.h>

Inheritance diagram for ADDON::CRepositoryUpdater:
ITimerCallback IJobCallback ISettingCallback

Classes

struct  RepositoryUpdated
 

Public Types

enum class  UpdateScheduleType { First , Regular }
 

Public Member Functions

 CRepositoryUpdater (CAddonMgr &addonMgr)
 
 ~CRepositoryUpdater () override
 
void Start ()
 
void CheckForUpdates (const ADDON::RepositoryPtr &repo, bool showProgress=false)
 
bool CheckForUpdates (bool showProgress=false)
 
void Await ()
 
void ScheduleUpdate (UpdateScheduleType scheduleType)
 
CDateTime LastUpdated () const
 
void OnSettingChanged (const std::shared_ptr< const CSetting > &setting) override
 The value of the given setting has changed.
 
CEventStream< RepositoryUpdated > & Events ()
 
- Public Member Functions inherited from ISettingCallback
virtual ~ISettingCallback ()=default
 
virtual bool OnSettingChanging (const std::shared_ptr< const CSetting > &setting)
 The value of the given setting is being changed.
 
virtual void OnSettingAction (const std::shared_ptr< const CSetting > &setting)
 The given setting has been activated.
 
virtual bool OnSettingUpdate (const std::shared_ptr< CSetting > &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode)
 The given setting needs to be updated.
 
virtual void OnSettingPropertyChanged (const std::shared_ptr< const CSetting > &setting, const char *propertyName)
 The given property of the given setting has changed.
 

Member Enumeration Documentation

◆ UpdateScheduleType

Enumerator
First 

Update should be scheduled as the first update after application start or setting change.

Regular 

Update should be scheduled as a regular update during application runtime.

Constructor & Destructor Documentation

◆ CRepositoryUpdater()

ADDON::CRepositoryUpdater::CRepositoryUpdater ( CAddonMgr & addonMgr)
explicit

◆ ~CRepositoryUpdater()

ADDON::CRepositoryUpdater::~CRepositoryUpdater ( )
override

Member Function Documentation

◆ Await()

void ADDON::CRepositoryUpdater::Await ( )

Wait for any pending/in-progress updates to complete.

◆ CheckForUpdates() [1/2]

bool ADDON::CRepositoryUpdater::CheckForUpdates ( bool showProgress = false)

Check all repositories for updates.

◆ CheckForUpdates() [2/2]

void ADDON::CRepositoryUpdater::CheckForUpdates ( const ADDON::RepositoryPtr & repo,
bool showProgress = false )

Check a single repository for updates.

◆ Events()

CEventStream< RepositoryUpdated > & ADDON::CRepositoryUpdater::Events ( )
inline

◆ LastUpdated()

CDateTime ADDON::CRepositoryUpdater::LastUpdated ( ) const

Returns the time of the last check (oldest). Invalid time if never checked.

◆ OnSettingChanged()

void ADDON::CRepositoryUpdater::OnSettingChanged ( const std::shared_ptr< const CSetting > & setting)
overridevirtual

The value of the given setting has changed.

This callback is triggered whenever the value of a setting has been successfully changed (i.e. none of the OnSettingChanging() handlers) has reverted the change.

Parameters
settingThe setting whose value has been changed

Reimplemented from ISettingCallback.

◆ ScheduleUpdate()

void ADDON::CRepositoryUpdater::ScheduleUpdate ( UpdateScheduleType scheduleType)

Schedule an automatic update to run based on settings and previous update times. May be called when there are external changes this updater must know about. Any previously scheduled update will be cancelled.

◆ Start()

void ADDON::CRepositoryUpdater::Start ( )

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