2 * Copyright (C) 2005-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
23 #include "swighelper.h"
24 #include "addons/IAddon.h"
26 #include "AddonString.h"
27 #include "AddonClass.h"
28 #include "Exception.h"
34 XBMCCOMMONS_STANDARD_EXCEPTION(AddonException);
39 * Addon([id]) -- Creates a new Addon class.
41 * id : [opt] string - id of the addon as specified in addon.xml
43 * *Note, specifying the addon id is not needed.\n
44 * Important however is that the addon folder has the same name as the addon id provided in addon.xml.\n
45 * You can optionally specify the addon id from another installed addon to retrieve settings from it.
48 * - self.Addon = xbmcaddon.Addon()
49 * - self.Addon = xbmcaddon.Addon('script.foo.bar')
51 class Addon : public AddonClass
53 ADDON::AddonPtr pAddon;
55 String getDefaultId();
57 String getAddonVersion();
63 * Addon([id]) -- Creates a new Addon class.
65 * id : [opt] string - id of the addon as specified in addon.xml\n
67 * *Note, specifying the addon id is not needed.\n
68 * Important however is that the addon folder has the same name as the addon id provided in addon.xml.\n
69 * You can optionally specify the addon id from another installed addon to retrieve settings from it.
72 * - self.Addon = xbmcaddon.Addon()
73 * - self.Addon = xbmcaddon.Addon('script.foo.bar')
75 Addon(const char* id = NULL) throw (AddonException);
80 * getLocalizedString(id) -- Returns an addon's localized 'unicode string'.
82 * id : integer - id# for string you want to localize.
85 * - locstr = self.Addon.getLocalizedString(32000)
87 String getLocalizedString(int id);
90 * getSetting(id) -- Returns the value of a setting as a unicode string.
92 * id : string - id of the setting that the module needs to access.
95 * - apikey = self.Addon.getSetting('apikey')
97 String getSetting(const char* id);
100 * setSetting(id, value) -- Sets a script setting.
102 * id : string - id of the setting that the module needs to access.
103 * value : string or unicode - value of the setting.
105 * *Note, You can use the above as keywords for arguments.
108 * - self.Settings.setSetting(id='username', value='teamxbmc')\n
110 void setSetting(const char* id, const String& value);
113 * openSettings() -- Opens this scripts settings dialog.
116 * - self.Settings.openSettings()
121 * getAddonInfo(id) -- Returns the value of an addon property as a string.
123 * id : string - id of the property that the module needs to access.
125 * *Note, choices are (author, changelog, description, disclaimer, fanart. icon, id, name, path
126 * profile, stars, summary, type, version)
129 * - version = self.Addon.getAddonInfo('version')
131 String getAddonInfo(const char* id) throw (AddonException);