![]() |
Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
|
#include <AddonInstaller.h>
Classes | |
class | CDownloadJob |
Public Types | |
typedef std::map< std::string, CDownloadJob > | JobMap |
Public Member Functions | |
bool | IsDownloading () const |
void | GetInstallList (ADDON::VECADDONS &addons) const |
bool | GetProgress (const std::string &addonID, unsigned int &percent, bool &downloadFinshed) const |
bool | Cancel (const std::string &addonID) |
bool | InstallModal (const std::string &addonID, ADDON::AddonPtr &addon, bool promptForInstall=true) |
Installs the addon while showing a modal progress dialog. More... | |
bool | InstallOrUpdate (const std::string &addonID, bool background=true, bool modal=false) |
Install an addon if it is available in a repository. More... | |
bool | InstallFromZip (const std::string &path) |
Install an addon from the given zip path. More... | |
void | Install (const std::string &addonId, const ADDON::AddonVersion &version, const std::string &repoId) |
bool | CheckDependencies (const ADDON::AddonPtr &addon, CAddonDatabase *database=NULL) |
Check whether dependencies of an addon exist or are installable. Iterates through the addon's dependencies, checking they're installed or installable. Each dependency must also satisfies CheckDependencies in turn. More... | |
bool | CheckDependencies (const ADDON::AddonPtr &addon, std::pair< std::string, std::string > &failedDep, CAddonDatabase *database=NULL) |
Check whether dependencies of an addon exist or are installable. Iterates through the addon's dependencies, checking they're installed or installable. Each dependency must also satisfies CheckDependencies in turn. More... | |
bool | HasJob (const std::string &ID) const |
Check if an installation job for a given add-on is already queued up. More... | |
void | InstallUpdatesAndWait () |
void | InstallUpdates () |
void | OnJobComplete (unsigned int jobID, bool success, CJob *job) override |
The callback used when a job completes. More... | |
void | OnJobProgress (unsigned int jobID, unsigned int progress, unsigned int total, const CJob *job) override |
An optional callback function that a job may call while processing. More... | |
![]() | |
virtual | ~IJobCallback ()=default |
Destructor for job call back objects. More... | |
Static Public Member Functions | |
static CAddonInstaller & | GetInstance () |
typedef std::map<std::string, CDownloadJob> CAddonInstaller::JobMap |
bool CAddonInstaller::Cancel | ( | const std::string & | addonID | ) |
bool CAddonInstaller::CheckDependencies | ( | const ADDON::AddonPtr & | addon, |
CAddonDatabase * | database = NULL |
||
) |
Check whether dependencies of an addon exist or are installable. Iterates through the addon's dependencies, checking they're installed or installable. Each dependency must also satisfies CheckDependencies in turn.
addon | the addon to check |
database | the database instance to update. Defaults to NULL. |
bool CAddonInstaller::CheckDependencies | ( | const ADDON::AddonPtr & | addon, |
std::pair< std::string, std::string > & | failedDep, | ||
CAddonDatabase * | database = NULL |
||
) |
Check whether dependencies of an addon exist or are installable. Iterates through the addon's dependencies, checking they're installed or installable. Each dependency must also satisfies CheckDependencies in turn.
addon | the addon to check |
failedDep | Dependency addon that isn't available |
database | the database instance to update. Defaults to NULL. |
void CAddonInstaller::GetInstallList | ( | ADDON::VECADDONS & | addons | ) | const |
|
static |
bool CAddonInstaller::GetProgress | ( | const std::string & | addonID, |
unsigned int & | percent, | ||
bool & | downloadFinshed | ||
) | const |
bool CAddonInstaller::HasJob | ( | const std::string & | ID | ) | const |
Check if an installation job for a given add-on is already queued up.
ID | The ID of the add-on |
void CAddonInstaller::Install | ( | const std::string & | addonId, |
const ADDON::AddonVersion & | version, | ||
const std::string & | repoId | ||
) |
Install an addon with a specific version and repository
bool CAddonInstaller::InstallFromZip | ( | const std::string & | path | ) |
Install an addon from the given zip path.
path | the zip file to install from |
bool CAddonInstaller::InstallModal | ( | const std::string & | addonID, |
ADDON::AddonPtr & | addon, | ||
bool | promptForInstall = true |
||
) |
Installs the addon while showing a modal progress dialog.
addonID | the addon ID of the item to install. |
addon | [out] the installed addon for later use. |
promptForInstall | Whether or not to prompt the user before installing the addon. |
bool CAddonInstaller::InstallOrUpdate | ( | const std::string & | addonID, |
bool | background = true , |
||
bool | modal = false |
||
) |
Install an addon if it is available in a repository.
addonID | the addon ID of the item to install |
background | whether to install in the background or not. Defaults to true. |
modal | whether to show a modal dialog when not installing in background |
void CAddonInstaller::InstallUpdates | ( | ) |
void CAddonInstaller::InstallUpdatesAndWait | ( | ) |
Install update and block until all updates have installed.
bool CAddonInstaller::IsDownloading | ( | ) | const |
|
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.
jobID | the unique id of the job (as retrieved from CJobManager::AddJob) |
success | the result from the DoWork call |
job | the job that has been processed. The job will be destroyed after this function returns |
Implements IJobCallback.
|
overridevirtual |
An optional callback function that a job may call while processing.
OnJobProgress may be called periodically by a job during it's DoWork() function. It is used by the job to report on progress.
jobID | the unique id of the job (as retrieved from CJobManager::AddJob) |
progress | the current progress of the job, out of total. |
total | the total amount of work to be processed. |
job | the job that has been processed. |
Reimplemented from IJobCallback.