3 * Copyright (C) 2005-2013 Team XBMC
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)
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.
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/>.
21 #include "boost/shared_ptr.hpp"
22 #include "utils/StdString.h"
24 #include <boost/enable_shared_from_this.hpp>
41 ADDON_SUBTITLE_MODULE,
44 ADDON_SCRAPER_ARTISTS,
46 ADDON_SCRAPER_MUSICVIDEOS,
47 ADDON_SCRAPER_TVSHOWS,
53 ADDON_VIDEO, // virtual addon types
57 ADDON_VIZ_LIBRARY, // add noninstallable after this and installable before
58 ADDON_SCRAPER_LIBRARY,
64 typedef boost::shared_ptr<IAddon> AddonPtr;
66 typedef boost::shared_ptr<CVisualisation> VizPtr;
68 typedef boost::shared_ptr<CSkinInfo> SkinPtr;
70 typedef boost::shared_ptr<CPluginSource> PluginPtr;
74 typedef std::map<CStdString, std::pair<const AddonVersion, bool> > ADDONDEPS;
75 typedef std::map<CStdString, CStdString> InfoMap;
78 class IAddon : public boost::enable_shared_from_this<IAddon>
82 virtual AddonPtr Clone() const =0;
83 virtual TYPE Type() const =0;
84 virtual bool IsType(TYPE type) const =0;
85 virtual AddonProps Props() const =0;
86 virtual AddonProps& Props() =0;
87 virtual const CStdString ID() const =0;
88 virtual const CStdString Name() const =0;
89 virtual bool Enabled() const =0;
90 virtual bool IsInUse() const =0;
91 virtual const AddonVersion Version() const =0;
92 virtual const AddonVersion MinVersion() const =0;
93 virtual const CStdString Summary() const =0;
94 virtual const CStdString Description() const =0;
95 virtual const CStdString Path() const =0;
96 virtual const CStdString Profile() const =0;
97 virtual const CStdString LibPath() const =0;
98 virtual const CStdString ChangeLog() const =0;
99 virtual const CStdString FanArt() const =0;
100 virtual const CStdString Author() const =0;
101 virtual const CStdString Icon() const =0;
102 virtual int Stars() const =0;
103 virtual const CStdString Disclaimer() const =0;
104 virtual const InfoMap &ExtraInfo() const =0;
105 virtual bool HasSettings() =0;
106 virtual void SaveSettings() =0;
107 virtual void UpdateSetting(const CStdString& key, const CStdString& value) =0;
108 virtual CStdString GetSetting(const CStdString& key) =0;
109 virtual TiXmlElement* GetSettingsXML() =0;
110 virtual CStdString GetString(uint32_t id) =0;
111 virtual const ADDONDEPS &GetDeps() const =0;
112 virtual bool MeetsVersion(const AddonVersion &version) const =0;
113 virtual bool ReloadSettings() =0;
116 virtual bool LoadSettings(bool bForce = false) =0;
119 friend class CAddonMgr;
120 virtual bool IsAddonLibrary() =0;
121 virtual void Enable() =0;
122 virtual void Disable() =0;
123 virtual bool LoadStrings() =0;
124 virtual void ClearStrings() =0;
127 // some utilitiy methods
130 * This function will extract the Addon's currently assigned xbmc.python
131 * API version. If addon is NULL, or there is no xbmc.python dependency defined,
132 * then the version is assumed to be "1.0"
134 CStdString GetXbmcApiVersionDependency(ADDON::AddonPtr addon);