2 * Copyright (C) 2005-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"
12 #include "addons/kodi-dev-kit/include/kodi/c-api/addon_base.h"
13 #include "threads/CriticalSection.h"
14 #include "threads/Thread.h"
19 * Class - CAddonStatusHandler
20 * Used to inform the user about occurred errors and
21 * changes inside Add-on's, and ask him what to do.
22 * It can executed in the same thread as the calling
23 * function or in a separate thread.
25 class CAddonStatusHandler
: private CThread
28 CAddonStatusHandler(const std::string
& addonID
,
29 AddonInstanceId instanceId
,
31 bool sameThread
= true);
32 ~CAddonStatusHandler() override
;
35 void Process() override
;
36 void OnStartup() override
;
37 void OnExit() override
;
40 static CCriticalSection m_critSection
;
41 const uint32_t m_instanceId
;
43 ADDON_STATUS m_status
= ADDON_STATUS_UNKNOWN
;