![]() |
Kodi Documentation 22.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, InstallModalPrompt promptForInstall) |
Installs the addon while showing a modal progress dialog. | |
bool | InstallOrUpdate (const std::string &addonID, BackgroundJob background, ModalJob modal) |
Install an addon if it is available in a repository. | |
bool | InstallOrUpdateDependency (const ADDON::AddonPtr &dependsId, const ADDON::RepositoryPtr &repo) |
Install a dependency from a specific repository. | |
bool | RemoveDependency (const std::shared_ptr< IAddon > &dependsId) const |
Remove a single dependency from the system. | |
std::vector< std::string > | RemoveOrphanedDepsRecursively () const |
Removes all orphaned add-ons recursively. Removal may orphan further add-ons/dependencies, so loop until no orphaned is left on the system. | |
void | InstallAddons (const ADDON::VECADDONS &addons, bool wait, AllowCheckForUpdates allowCheckForUpdates) |
Installs a vector of addons. | |
bool | InstallFromZip (const std::string &path) |
Install an addon from the given zip path. | |
bool | Install (const std::string &addonId, const ADDON::CAddonVersion &version, const std::string &repoId) |
bool | UnInstall (const ADDON::AddonPtr &addon, bool removeData) |
bool | CheckDependencies (const ADDON::AddonPtr &addon, CAddonDatabase *database=nullptr) |
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. | |
bool | CheckDependencies (const ADDON::AddonPtr &addon, std::pair< std::string, std::string > &failedDep, CAddonDatabase *database=nullptr) |
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. | |
bool | HasJob (const std::string &ID) const |
Check if an installation job for a given add-on is already queued up. | |
void | OnJobComplete (unsigned int jobID, bool success, CJob *job) override |
The callback used when a job completes. | |
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. | |
![]() | |
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. | |
Static Public Member Functions | |
static CAddonInstaller & | GetInstance () |
typedef std::map<std::string, CDownloadJob> ADDON::CAddonInstaller::JobMap |
bool CAddonInstaller::Cancel | ( | const std::string & | addonID | ) |
bool CAddonInstaller::CheckDependencies | ( | const ADDON::AddonPtr & | addon, |
CAddonDatabase * | database = nullptr ) |
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 = nullptr ) |
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 |
bool CAddonInstaller::Install | ( | const std::string & | addonId, |
const ADDON::CAddonVersion & | version, | ||
const std::string & | repoId ) |
Install an addon with a specific version and repository
void CAddonInstaller::InstallAddons | ( | const ADDON::VECADDONS & | addons, |
bool | wait, | ||
AllowCheckForUpdates | allowCheckForUpdates ) |
Installs a vector of addons.
addons | the list of addons to install |
wait | if the method should wait for all the DoInstall jobs to finish or if it should return right away |
allowCheckForUpdates | indicates if content update checks are allowed after installation of a repository addon from the vector |
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, | ||
InstallModalPrompt | promptForInstall ) |
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, |
BackgroundJob | background, | ||
ModalJob | modal ) |
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. |
modal | whether to show a modal dialog when not installing in background |
bool CAddonInstaller::InstallOrUpdateDependency | ( | const ADDON::AddonPtr & | dependsId, |
const ADDON::RepositoryPtr & | repo ) |
Install a dependency from a specific repository.
dependsId | the dependency to install |
repo | the repository to install the addon from |
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.
Remove a single dependency from the system.
dependsId | the dependency to remove |
std::vector< std::string > CAddonInstaller::RemoveOrphanedDepsRecursively | ( | ) | const |
Removes all orphaned add-ons recursively. Removal may orphan further add-ons/dependencies, so loop until no orphaned is left on the system.
bool CAddonInstaller::UnInstall | ( | const ADDON::AddonPtr & | addon, |
bool | removeData ) |
Uninstall an addon, remove addon data if requested