diff options
Diffstat (limited to 'xbmc/addons/ContextItemAddon.h')
| -rw-r--r-- | xbmc/addons/ContextItemAddon.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/xbmc/addons/ContextItemAddon.h b/xbmc/addons/ContextItemAddon.h new file mode 100644 index 0000000..628fdcd --- /dev/null +++ b/xbmc/addons/ContextItemAddon.h | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2013-2015 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 <list> | ||
| 23 | #include <memory> | ||
| 24 | #include "Addon.h" | ||
| 25 | |||
| 26 | class CFileItem; | ||
| 27 | typedef std::shared_ptr<CFileItem> CFileItemPtr; | ||
| 28 | |||
| 29 | namespace INFO | ||
| 30 | { | ||
| 31 | class InfoBool; | ||
| 32 | typedef std::shared_ptr<InfoBool> InfoPtr; | ||
| 33 | } | ||
| 34 | |||
| 35 | namespace ADDON | ||
| 36 | { | ||
| 37 | class CContextItemAddon : public CAddon | ||
| 38 | { | ||
| 39 | public: | ||
| 40 | CContextItemAddon(const cp_extension_t *ext); | ||
| 41 | CContextItemAddon(const AddonProps &props); | ||
| 42 | virtual ~CContextItemAddon(); | ||
| 43 | |||
| 44 | const std::string& GetLabel() const { return m_label; } | ||
| 45 | |||
| 46 | /*! | ||
| 47 | * \brief Get the parent category of this context item. | ||
| 48 | * | ||
| 49 | * \details Returns empty string if at root level or | ||
| 50 | * CONTEXT_MENU_GROUP_MANAGE when it should be in the 'manage' submenu. | ||
| 51 | */ | ||
| 52 | const std::string& GetParent() const { return m_parent; } | ||
| 53 | |||
| 54 | /*! | ||
| 55 | * \brief Returns true if this contex menu should be visible for given item. | ||
| 56 | */ | ||
| 57 | bool IsVisible(const CFileItemPtr& item) const; | ||
| 58 | |||
| 59 | virtual bool OnPreInstall(); | ||
| 60 | virtual void OnPostInstall(bool restart, bool update); | ||
| 61 | virtual void OnPreUnInstall(); | ||
| 62 | virtual void OnDisabled(); | ||
| 63 | virtual void OnEnabled(); | ||
| 64 | |||
| 65 | private: | ||
| 66 | std::string m_label; | ||
| 67 | std::string m_parent; | ||
| 68 | INFO::InfoPtr m_visCondition; | ||
| 69 | }; | ||
| 70 | |||
| 71 | typedef std::shared_ptr<CContextItemAddon> ContextItemAddonPtr; | ||
| 72 | } | ||
