[PVR][Estuary] Timer settings dialog: Show client name in timer type selection dialog...
[xbmc.git] / xbmc / filesystem / AddonsDirectory.h
blob0ff0c112e61a30a9a5fe7a0f55ca730b6f488fd0
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "IDirectory.h"
13 #include <memory>
14 #include <vector>
16 class CFileItem;
17 class CFileItemList;
18 class CURL;
19 typedef std::shared_ptr<CFileItem> CFileItemPtr;
21 namespace ADDON
23 class IAddon;
24 using VECADDONS = std::vector<std::shared_ptr<IAddon>>;
25 } // namespace ADDON
27 namespace XFILE
30 /*!
31 \ingroup windows
32 \brief Get access to shares and it's directories.
34 class CAddonsDirectory : public IDirectory
36 public:
37 CAddonsDirectory(void);
38 ~CAddonsDirectory(void) override;
39 bool GetDirectory(const CURL& url, CFileItemList &items) override;
40 bool Create(const CURL& url) override { return true; }
41 bool Exists(const CURL& url) override { return true; }
42 bool AllowAll() const override { return true; }
44 /*! \brief Fetch script and plugin addons of a given content type
45 \param content the content type to fetch
46 \param addons the list of addons to fill with scripts and plugin content
47 \return true if content is valid, false if it's invalid.
49 static bool GetScriptsAndPlugins(const std::string &content, ADDON::VECADDONS &addons);
51 /*! \brief Fetch scripts and plugins of a given content type
52 \param content the content type to fetch
53 \param items the list to fill with scripts and content
54 \return true if more than one item is found, false otherwise.
56 static bool GetScriptsAndPlugins(const std::string &content, CFileItemList &items);
58 static void GenerateAddonListing(const CURL& path,
59 const ADDON::VECADDONS& addons,
60 CFileItemList& items,
61 const std::string& label);
62 static CFileItemPtr FileItemFromAddon(const std::shared_ptr<ADDON::IAddon>& addon,
63 const std::string& path,
64 bool folder = false);
66 /*! \brief Returns true if `path` is a path or subpath of the repository directory, otherwise false */
67 static bool IsRepoDirectory(const CURL& path);
69 private:
70 bool GetSearchResults(const CURL& path, CFileItemList &items);