[ExecString] combine SplitParameters with identical function of CUtil
[xbmc.git] / xbmc / ServiceBroker.h
blob659b07d61d8866f79e543e3141ff01c8a569468c
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 "utils/GlobalsHandling.h"
13 #include <memory>
15 namespace ADDON
17 class CAddonMgr;
18 class CBinaryAddonManager;
19 class CBinaryAddonCache;
20 class CVFSAddonCache;
21 class CServiceAddonManager;
22 class CRepositoryUpdater;
23 } // namespace ADDON
25 namespace ANNOUNCEMENT
27 class CAnnouncementManager;
30 namespace MEDIA_DETECT
32 class CDetectDVDMedia;
35 namespace PVR
37 class CPVRManager;
40 namespace PLAYLIST
42 class CPlayListPlayer;
45 namespace KODI
47 namespace MESSAGING
49 class CApplicationMessenger;
51 } // namespace KODI
53 class CAppParams;
54 template<class T>
55 class CComponentContainer;
56 class CContextMenuManager;
57 class XBPython;
58 class CDataCacheCore;
59 class IAE;
60 class IApplicationComponent;
61 class CFavouritesService;
62 class CInputManager;
63 class CFileExtensionProvider;
64 class CNetworkBase;
65 class CWinSystemBase;
66 class CRenderSystemBase;
67 class CPowerManager;
68 class CWeatherManager;
69 class CPlayerCoreFactory;
70 class CDatabaseManager;
71 class CEventLog;
72 class CGUIComponent;
73 class CAppInboundProtocol;
74 class CSettingsComponent;
75 class CDecoderFilterManager;
76 class CMediaManager;
77 class CCPUInfo;
78 class CLog;
79 class CPlatform;
80 class CTextureCache;
81 class CJobManager;
82 class CSlideShowDelegator;
84 namespace WSDiscovery
86 class IWSDiscovery;
89 namespace KODI
91 namespace ADDONS
93 class CExtsMimeSupportList;
96 namespace GAME
98 class CControllerManager;
99 class CGameServices;
100 } // namespace GAME
102 namespace KEYBOARD
104 class CKeyboardLayoutManager;
105 } // namespace KEYBOARD
107 namespace RETRO
109 class CGUIGameRenderManager;
111 } // namespace KODI
113 namespace PERIPHERALS
115 class CPeripherals;
118 namespace speech
120 class ISpeechRecognition;
123 class CServiceBroker
125 public:
126 CServiceBroker();
127 ~CServiceBroker();
129 static std::shared_ptr<CAppParams> GetAppParams();
130 static void RegisterAppParams(const std::shared_ptr<CAppParams>& appParams);
131 static void UnregisterAppParams();
133 static CLog& GetLogging();
134 static void CreateLogging();
135 static bool IsLoggingUp();
136 static void DestroyLogging();
138 static std::shared_ptr<ANNOUNCEMENT::CAnnouncementManager> GetAnnouncementManager();
139 static void RegisterAnnouncementManager(
140 std::shared_ptr<ANNOUNCEMENT::CAnnouncementManager> announcementManager);
141 static void UnregisterAnnouncementManager();
143 static ADDON::CAddonMgr& GetAddonMgr();
144 static ADDON::CBinaryAddonManager& GetBinaryAddonManager();
145 static ADDON::CBinaryAddonCache& GetBinaryAddonCache();
146 static KODI::ADDONS::CExtsMimeSupportList& GetExtsMimeSupportList();
147 static ADDON::CVFSAddonCache& GetVFSAddonCache();
148 static XBPython& GetXBPython();
149 static WSDiscovery::IWSDiscovery& GetWSDiscovery();
150 static MEDIA_DETECT::CDetectDVDMedia& GetDetectDVDMedia();
151 static PVR::CPVRManager& GetPVRManager();
152 static CContextMenuManager& GetContextMenuManager();
153 static CDataCacheCore& GetDataCacheCore();
154 static CPlatform& GetPlatform();
155 static PLAYLIST::CPlayListPlayer& GetPlaylistPlayer();
156 static CSlideShowDelegator& GetSlideShowDelegator();
157 static KODI::GAME::CControllerManager& GetGameControllerManager();
158 static KODI::GAME::CGameServices& GetGameServices();
159 static KODI::RETRO::CGUIGameRenderManager& GetGameRenderManager();
160 static PERIPHERALS::CPeripherals& GetPeripherals();
161 static CFavouritesService& GetFavouritesService();
162 static ADDON::CServiceAddonManager& GetServiceAddons();
163 static ADDON::CRepositoryUpdater& GetRepositoryUpdater();
164 static CInputManager& GetInputManager();
165 static CFileExtensionProvider& GetFileExtensionProvider();
166 static bool IsAddonInterfaceUp();
167 static bool IsServiceManagerUp();
168 static CNetworkBase& GetNetwork();
169 static CPowerManager& GetPowerManager();
170 static CWeatherManager& GetWeatherManager();
171 static CPlayerCoreFactory& GetPlayerCoreFactory();
172 static CDatabaseManager& GetDatabaseManager();
173 static CEventLog* GetEventLog();
174 static CMediaManager& GetMediaManager();
175 static CComponentContainer<IApplicationComponent>& GetAppComponents();
177 static CGUIComponent* GetGUI();
178 static void RegisterGUI(CGUIComponent* gui);
179 static void UnregisterGUI();
181 static void RegisterSettingsComponent(const std::shared_ptr<CSettingsComponent>& settings);
182 static void UnregisterSettingsComponent();
183 static std::shared_ptr<CSettingsComponent> GetSettingsComponent();
185 static void RegisterWinSystem(CWinSystemBase* winsystem);
186 static void UnregisterWinSystem();
187 static CWinSystemBase* GetWinSystem();
188 static CRenderSystemBase* GetRenderSystem();
190 static IAE* GetActiveAE();
191 static void RegisterAE(IAE* ae);
192 static void UnregisterAE();
194 static std::shared_ptr<CAppInboundProtocol> GetAppPort();
195 static void RegisterAppPort(std::shared_ptr<CAppInboundProtocol> port);
196 static void UnregisterAppPort();
198 static void RegisterDecoderFilterManager(CDecoderFilterManager* manager);
199 static CDecoderFilterManager* GetDecoderFilterManager();
201 static std::shared_ptr<CCPUInfo> GetCPUInfo();
202 static void RegisterCPUInfo(std::shared_ptr<CCPUInfo> cpuInfo);
203 static void UnregisterCPUInfo();
205 static void RegisterTextureCache(const std::shared_ptr<CTextureCache>& cache);
206 static void UnregisterTextureCache();
207 static std::shared_ptr<CTextureCache> GetTextureCache();
209 static void RegisterJobManager(const std::shared_ptr<CJobManager>& jobManager);
210 static void UnregisterJobManager();
211 static std::shared_ptr<CJobManager> GetJobManager();
213 static void RegisterAppMessenger(
214 const std::shared_ptr<KODI::MESSAGING::CApplicationMessenger>& appMessenger);
215 static void UnregisterAppMessenger();
216 static std::shared_ptr<KODI::MESSAGING::CApplicationMessenger> GetAppMessenger();
218 static void RegisterKeyboardLayoutManager(
219 const std::shared_ptr<KODI::KEYBOARD::CKeyboardLayoutManager>& keyboardLayoutManager);
220 static void UnregisterKeyboardLayoutManager();
221 static std::shared_ptr<KODI::KEYBOARD::CKeyboardLayoutManager> GetKeyboardLayoutManager();
223 static void RegisterSpeechRecognition(
224 const std::shared_ptr<speech::ISpeechRecognition>& speechRecognition);
225 static void UnregisterSpeechRecognition();
226 static std::shared_ptr<speech::ISpeechRecognition> GetSpeechRecognition();
228 private:
229 std::shared_ptr<CAppParams> m_appParams;
230 std::unique_ptr<CLog> m_logging;
231 std::shared_ptr<ANNOUNCEMENT::CAnnouncementManager> m_pAnnouncementManager;
232 CGUIComponent* m_pGUI = nullptr;
233 CWinSystemBase* m_pWinSystem = nullptr;
234 IAE* m_pActiveAE = nullptr;
235 std::shared_ptr<CAppInboundProtocol> m_pAppPort;
236 std::shared_ptr<CSettingsComponent> m_pSettingsComponent;
237 CDecoderFilterManager* m_decoderFilterManager = nullptr;
238 std::shared_ptr<CCPUInfo> m_cpuInfo;
239 std::shared_ptr<CTextureCache> m_textureCache;
240 std::shared_ptr<CJobManager> m_jobManager;
241 std::shared_ptr<KODI::MESSAGING::CApplicationMessenger> m_appMessenger;
242 std::shared_ptr<KODI::KEYBOARD::CKeyboardLayoutManager> m_keyboardLayoutManager;
243 std::shared_ptr<speech::ISpeechRecognition> m_speechRecognition;
244 std::shared_ptr<CSlideShowDelegator> m_slideshowDelegator;
247 XBMC_GLOBAL_REF(CServiceBroker, g_serviceBroker);
248 #define g_serviceBroker XBMC_GLOBAL_USE(CServiceBroker)