xbmc
GUIWindowAddonBrowser.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "ThumbLoader.h"
12 #include "addons/RepositoryUpdater.h"
13 #include "windows/GUIMediaWindow.h"
14 
15 #include <string>
16 #include <vector>
17 
18 class CFileItemList;
19 
20 namespace ADDON
21 {
22 enum class AddonType;
23 struct AddonEvent;
24 }
25 
27 {
28 public:
30  ~CGUIWindowAddonBrowser(void) override;
31  bool OnMessage(CGUIMessage& message) override;
32 
48  static int SelectAddonID(ADDON::AddonType type,
49  std::string& addonID,
50  bool showNone = false,
51  bool showDetails = true,
52  bool showInstalled = true,
53  bool showInstallable = false,
54  bool showMore = true);
55  static int SelectAddonID(const std::vector<ADDON::AddonType>& types,
56  std::string& addonID,
57  bool showNone = false,
58  bool showDetails = true,
59  bool showInstalled = true,
60  bool showInstallable = false,
61  bool showMore = true);
79  static int SelectAddonID(ADDON::AddonType type,
80  std::vector<std::string>& addonIDs,
81  bool showNone = false,
82  bool showDetails = true,
83  bool multipleSelection = true,
84  bool showInstalled = true,
85  bool showInstallable = false,
86  bool showMore = true);
87  static int SelectAddonID(const std::vector<ADDON::AddonType>& types,
88  std::vector<std::string>& addonIDs,
89  bool showNone = false,
90  bool showDetails = true,
91  bool multipleSelection = true,
92  bool showInstalled = true,
93  bool showInstallable = false,
94  bool showMore = true);
95 
96  bool UseFileDirectories() override { return false; }
97 
98  static void InstallFromZip();
99 
100 protected:
101  bool OnClick(int iItem, const std::string& player = "") override;
102  void UpdateButtons() override;
103  bool GetDirectory(const std::string& strDirectory, CFileItemList& items) override;
104  bool Update(const std::string& strDirectory, bool updateFilterPath = true) override;
105  std::string GetStartFolder(const std::string& dir) override;
106 
107  std::string GetRootPath() const override { return "addons://"; }
108 
109 private:
110  void SetProperties();
111  void UpdateStatus(const CFileItemPtr& item);
112  void OnEvent(const ADDON::CRepositoryUpdater::RepositoryUpdated& event);
113  void OnEvent(const ADDON::AddonEvent& event);
114  CProgramThumbLoader m_thumbLoader;
115 };
Represents a list of files.
Definition: FileItem.h:713
Definition: RepositoryUpdater.h:72
Definition: ThumbLoader.h:50
Definition: AddonEvents.h:18
Definition: GUIMessage.h:365
Definition: GUIWindowAddonBrowser.h:26
Definition: GUIMediaWindow.h:28
Definition: Addon.cpp:39