Debian Codegraph @

xbmc/games/ports/guicontrols/GUIActivePortList.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2021-2023 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 "IActivePortList.h"
12 #include "addons/AddonEvents.h"
13 #include "games/GameTypes.h"
14 #include "games/controllers/ControllerTypes.h"
15 #include "games/ports/types/PortNode.h"
16 #include "utils/Observer.h"
17
18 #include <memory>
19
20 class CFileItemList;
21 class CGUIWindow;
22
23 namespace KODI
24 {
25 namespace GAME
26 {
27 class CController;
28 class IActivePortList;
29
30 /*!
31 * \ingroup games
32 */
33 class CGUIActivePortList : public IActivePortList, public Observer
34 {
35 public:
36 CGUIActivePortList(CGUIWindow& window, int controlId, bool showInputDisabled);
37 ~CGUIActivePortList() override;
38
39 // Implementation of IActivePortList
40 bool Initialize(GameClientPtr gameClient) override;
41 void Deinitialize() override;
42 void Refresh() override;
43
44 // Implementation of Observer
45 void Notify(const Observable& obs, const ObservableMessage msg) override;
46
47 private:
48 // Add-on API
49 void OnEvent(const ADDON::AddonEvent& event);
50
51 // GUI helpers
52 void InitializeGUI();
53 void DeinitializeGUI();
54 void AddInputDisabled();
55 void AddItems(const PortVec& ports);
56 void AddItem(const ControllerPtr& controller, const std::string& controllerAddress);
57 void AddPadding();
58 void CleanupItems();
59
60 // Construction parameters
61 CGUIWindow& m_guiWindow;
62 const int m_controlId;
63 const bool m_showInputDisabled;
64
65 // GUI parameters
66 std::unique_ptr<CFileItemList> m_vecItems;
67 uint32_t m_alignment{0};
68
69 // Game parameters
70 GameClientPtr m_gameClient;
71 };
72 } // namespace GAME
73 } // namespace KODI