diff options
Diffstat (limited to 'xbmc/addons/PluginSource.h')
| -rw-r--r-- | xbmc/addons/PluginSource.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/xbmc/addons/PluginSource.h b/xbmc/addons/PluginSource.h new file mode 100644 index 0000000..87e1f34 --- /dev/null +++ b/xbmc/addons/PluginSource.h | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2013 Team XBMC | ||
| 3 | * http://xbmc.org | ||
| 4 | * | ||
| 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) | ||
| 8 | * any later version. | ||
| 9 | * | ||
| 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. | ||
| 14 | * | ||
| 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/>. | ||
| 18 | * | ||
| 19 | */ | ||
| 20 | #pragma once | ||
| 21 | |||
| 22 | #include "Addon.h" | ||
| 23 | |||
| 24 | namespace ADDON | ||
| 25 | { | ||
| 26 | |||
| 27 | class CPluginSource : public CAddon | ||
| 28 | { | ||
| 29 | public: | ||
| 30 | |||
| 31 | enum Content { UNKNOWN, AUDIO, IMAGE, EXECUTABLE, VIDEO }; | ||
| 32 | |||
| 33 | CPluginSource(const cp_extension_t *ext); | ||
| 34 | CPluginSource(const AddonProps &props); | ||
| 35 | virtual ~CPluginSource() {} | ||
| 36 | virtual AddonPtr Clone() const; | ||
| 37 | virtual bool IsType(TYPE type) const; | ||
| 38 | bool Provides(const Content& content) const | ||
| 39 | { | ||
| 40 | return content == UNKNOWN ? false : m_providedContent.count(content) > 0; | ||
| 41 | } | ||
| 42 | |||
| 43 | bool ProvidesSeveral() const | ||
| 44 | { | ||
| 45 | return m_providedContent.size() > 1; | ||
| 46 | } | ||
| 47 | |||
| 48 | static Content Translate(const std::string &content); | ||
| 49 | private: | ||
| 50 | /*! \brief Set the provided content for this plugin | ||
| 51 | If no valid content types are passed in, we set the EXECUTABLE type | ||
| 52 | \param content a space-separated list of content types | ||
| 53 | */ | ||
| 54 | void SetProvides(const std::string &content); | ||
| 55 | std::set<Content> m_providedContent; | ||
| 56 | }; | ||
| 57 | |||
| 58 | } /*namespace ADDON*/ | ||
