xbmc
GUIControllerWindow.h
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 
26 {
27 public:
29  ~CGUIControllerWindow() override;
30 
31  // implementation of CGUIControl via CGUIDialog
32  void DoProcess(unsigned int currentTime, CDirtyRegionList& dirtyregions) override;
33  bool OnMessage(CGUIMessage& message) override;
34 
35 protected:
36  // implementation of CGUIWindow via CGUIDialog
37  void OnInitWindow() override;
38  void OnDeinitWindow(int nextWindowID) override;
39 
40 private:
41  void OnControllerFocused(unsigned int controllerIndex);
42  void OnControllerSelected(unsigned int controllerIndex);
43  void OnFeatureFocused(unsigned int featureIndex);
44  void OnFeatureSelected(unsigned int featureIndex);
45  void UpdateButtons(void);
46 
47  // Callbacks for events
48  void OnEvent(const ADDON::CRepositoryUpdater::RepositoryUpdated& event);
49  void OnEvent(const ADDON::AddonEvent& event);
50 
51  // Action for the available button
52  void GetMoreControllers(void);
53  void GetAllControllers();
54  void ResetController(void);
55  void ShowHelp(void);
56  void ShowButtonCaptureDialog(void);
57 
58  IControllerList* m_controllerList = nullptr;
59  IFeatureList* m_featureList = nullptr;
60 
61  // Game parameters
62  GameClientPtr m_gameClient;
63 
64  // Controller parameters
65  std::unique_ptr<CControllerInstaller> m_installer;
66 };
67 } // namespace GAME
68 } // namespace KODI
Definition: RepositoryUpdater.h:72
A list populated by the controller&#39;s features.
Definition: IConfigurationWindow.h:99
A list populated by installed controllers.
Definition: IConfigurationWindow.h:48
Definition: GUIDialog.h:35
Controller configuration window.
Definition: AudioDecoder.h:18
Definition: AddonEvents.h:18
Definition: GUIMessage.h:365
Definition: GUIControllerWindow.h:25
void OnInitWindow() override
Called on window open.
Definition: GUIControllerWindow.cpp:217