This repository has been archived by the owner on Apr 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
/
IAddon.h
119 lines (111 loc) · 3.59 KB
/
IAddon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#pragma once
/*
* Copyright (C) 2005-2009 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#include "boost/shared_ptr.hpp"
#include "StdString.h"
#include <set>
#include <map>
class TiXmlElement;
typedef enum
{
CONTENT_MOVIES,
CONTENT_TVSHOWS,
CONTENT_MUSICVIDEOS,
CONTENT_EPISODES,
CONTENT_ALBUMS,
CONTENT_ARTISTS,
CONTENT_NONE,
} CONTENT_TYPE;
namespace ADDON
{
typedef enum
{
ADDON_UNKNOWN,
ADDON_VIZ,
ADDON_SKIN,
ADDON_PVRDLL,
ADDON_SCRIPT,
ADDON_SCRIPT_WEATHER,
ADDON_SCRIPT_SUBTITLES,
ADDON_SCRIPT_LYRICS,
ADDON_SCRAPER,
ADDON_SCREENSAVER,
ADDON_PLUGIN,
ADDON_REPOSITORY,
ADDON_VIZ_LIBRARY, // add noninstallable after this and installable before
ADDON_SCRAPER_LIBRARY,
ADDON_SCRIPT_LIBRARY
} TYPE;
class IAddon;
typedef boost::shared_ptr<IAddon> AddonPtr;
class CVisualisation;
typedef boost::shared_ptr<CVisualisation> VizPtr;
class CSkinInfo;
typedef boost::shared_ptr<CSkinInfo> SkinPtr;
class CPluginSource;
typedef boost::shared_ptr<CPluginSource> PluginPtr;
class CAddonMgr;
class AddonVersion;
typedef std::map<CStdString, std::pair<const AddonVersion, const AddonVersion> > ADDONDEPS;
class AddonProps;
class IAddon
{
public:
virtual ~IAddon() {};
virtual AddonPtr Clone(const AddonPtr& self) const =0;
virtual const TYPE Type() const =0;
virtual AddonProps Props() const =0;
virtual AddonProps& Props() =0;
virtual const CStdString ID() const =0;
virtual const AddonPtr Parent() const =0;
virtual const CStdString Name() const =0;
virtual bool Enabled() const =0;
virtual const AddonVersion Version() =0;
virtual const CStdString Summary() const =0;
virtual const CStdString Description() const =0;
virtual const CStdString Path() const =0;
virtual const CStdString Profile() const =0;
virtual const CStdString LibPath() const =0;
virtual const CStdString ChangeLog() const =0;
virtual const CStdString FanArt() const =0;
virtual const CStdString Author() const =0;
virtual const CStdString Icon() const =0;
virtual const int Stars() const =0;
virtual const CStdString Disclaimer() const =0;
virtual bool Supports(const CONTENT_TYPE &content) const =0;
virtual bool HasSettings() =0;
virtual bool LoadSettings() =0;
virtual void SaveSettings() =0;
virtual void SaveFromDefault() =0;
virtual void UpdateSetting(const CStdString& key, const CStdString& value, const CStdString &type = "") =0;
virtual CStdString GetSetting(const CStdString& key) const =0;
virtual TiXmlElement* GetSettingsXML() =0;
virtual CStdString GetString(uint32_t id) =0;
virtual ADDONDEPS GetDeps() =0;
private:
friend class CAddonMgr;
virtual bool IsAddonLibrary() =0;
virtual void Enable() =0;
virtual void Disable() =0;
virtual bool LoadStrings() =0;
virtual void ClearStrings() =0;
};
};