Debian Codegraph @

xbmc/games/controllers/windows/GUIControllerWindow.h

raw
1 /*
2 * Copyright (C) 2014-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 "addons/RepositoryUpdater.h"
12 #include "games/GameTypes.h"
13 #include "guilib/GUIDialog.h"
14
15 #include <memory>
16
17 namespace KODI
18 {
19 namespace GAME
20 {
21 class CControllerInstaller;
22 class IControllerList;
23 class IFeatureList;
24
25 /*!
26 * \ingroup games
27 */
28 class CGUIControllerWindow : public CGUIDialog
29 {
30 public:
31 CGUIControllerWindow(void);
32 ~CGUIControllerWindow() override;
33
34 // implementation of CGUIControl via CGUIDialog
35 void DoProcess(unsigned int currentTime, CDirtyRegionList& dirtyregions) override;
36 bool OnMessage(CGUIMessage& message) override;
37
38 protected:
39 // implementation of CGUIWindow via CGUIDialog
40 void OnInitWindow() override;
41 void OnDeinitWindow(int nextWindowID) override;
42
43 private:
44 void OnControllerFocused(unsigned int controllerIndex);
45 void OnControllerSelected(unsigned int controllerIndex);
46 void OnFeatureFocused(unsigned int featureIndex);
47 void OnFeatureSelected(unsigned int featureIndex);
48 void UpdateButtons(void);
49
50 // Callbacks for events
51 void OnEvent(const ADDON::CRepositoryUpdater::RepositoryUpdated& event);
52 void OnEvent(const ADDON::AddonEvent& event);
53
54 // Action for the available button
55 void GetMoreControllers(void);
56 void GetAllControllers();
57 void ResetController(void);
58 void ShowHelp(void);
59 void ShowButtonCaptureDialog(void);
60
61 IControllerList* m_controllerList = nullptr;
62 IFeatureList* m_featureList = nullptr;
63
64 // Game parameters
65 GameClientPtr m_gameClient;
66 std::string m_controllerId;
67
68 // Controller parameters
69 std::unique_ptr<CControllerInstaller> m_installer;
70 };
71 } // namespace GAME
72 } // namespace KODI