summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/AddonStatusHandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/AddonStatusHandler.h')
-rw-r--r--xbmc/addons/AddonStatusHandler.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/xbmc/addons/AddonStatusHandler.h b/xbmc/addons/AddonStatusHandler.h
new file mode 100644
index 0000000..c9b65bd
--- /dev/null
+++ b/xbmc/addons/AddonStatusHandler.h
@@ -0,0 +1,56 @@
1#pragma once
2/*
3 * Copyright (C) 2005-2013 Team XBMC
4 * http://xbmc.org
5 *
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#include "threads/Thread.h"
23#include "IAddon.h"
24#include "include/xbmc_addon_types.h"
25#include "threads/CriticalSection.h"
26#include <string>
27
28namespace ADDON
29{
30 /**
31 * Class - CAddonStatusHandler
32 * Used to informate the user about occurred errors and
33 * changes inside Add-on's, and ask him what to do.
34 * It can executed in the same thread as the calling
35 * function or in a seperate thread.
36 */
37 class CAddonStatusHandler : private CThread
38 {
39 public:
40 CAddonStatusHandler(const std::string &addonID, ADDON_STATUS status, std::string message, bool sameThread = true);
41 ~CAddonStatusHandler();
42
43 /* Thread handling */
44 virtual void Process();
45 virtual void OnStartup();
46 virtual void OnExit();
47
48 private:
49 static CCriticalSection m_critSection;
50 AddonPtr m_addon;
51 ADDON_STATUS m_status;
52 std::string m_message;
53 };
54
55
56}