2 * Copyright (C) 2016-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "addons/IAddon.h"
21 AddonInstanceId instanceId
{ADDON_SINGLETON_INSTANCE_ID
};
23 explicit AddonEvent(std::string addonId
) : addonId(std::move(addonId
)) {}
24 AddonEvent(std::string addonId
, AddonInstanceId instanceId
)
25 : addonId(std::move(addonId
)), instanceId(instanceId
)
29 // Note: Do not remove the virtual dtor. There are types derived from AddonEvent (see below)
30 // and there are several places where 'typeid' is used to determine the runtime type of
31 // AddonEvent references. And 'typeid' only works for polymorphic objects.
32 virtual ~AddonEvent() = default;
39 * Emitted after the add-on has been enabled.
41 struct Enabled
: AddonEvent
43 explicit Enabled(std::string addonId
) : AddonEvent(std::move(addonId
)) {}
47 * Emitted after the add-on has been disabled.
49 struct Disabled
: AddonEvent
51 explicit Disabled(std::string addonId
) : AddonEvent(std::move(addonId
)) {}
55 * Emitted after a new usable add-on instance was added.
57 struct InstanceAdded
: AddonEvent
59 InstanceAdded(std::string addonId
, AddonInstanceId instanceId
)
60 : AddonEvent(std::move(addonId
), instanceId
)
66 * Emitted after an add-on instance was removed.
68 struct InstanceRemoved
: AddonEvent
70 InstanceRemoved(std::string addonId
, AddonInstanceId instanceId
)
71 : AddonEvent(std::move(addonId
), instanceId
)
77 * Emitted after the add-on's metadata has been changed.
79 struct MetadataChanged
: AddonEvent
81 explicit MetadataChanged(std::string addonId
) : AddonEvent(std::move(addonId
)) {}
85 * Emitted when a different version of the add-on has been installed
86 * to the file system and should be reloaded.
88 struct ReInstalled
: AddonEvent
90 explicit ReInstalled(std::string addonId
) : AddonEvent(std::move(addonId
)) {}
94 * Emitted after the add-on has been uninstalled.
96 struct UnInstalled
: AddonEvent
98 explicit UnInstalled(std::string addonId
) : AddonEvent(std::move(addonId
)) {}
102 * Emitted after the add-on has been loaded.
104 struct Load
: AddonEvent
106 explicit Load(std::string addonId
) : AddonEvent(std::move(addonId
)) {}
110 * Emitted after the add-on has been unloaded.
112 struct Unload
: AddonEvent
114 explicit Unload(std::string addonId
) : AddonEvent(std::move(addonId
)) {}
118 * Emitted after the auto-update state of the add-on has been changed.
120 struct AutoUpdateStateChanged
: AddonEvent
122 explicit AutoUpdateStateChanged(std::string addonId
) : AddonEvent(std::move(addonId
)) {}
125 } // namespace AddonEvents