xbmc
ControllerLayout.h
1 /*
2  * Copyright (C) 2015-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 <memory>
12 #include <string>
13 #include <vector>
14 
15 class TiXmlElement;
16 
17 namespace KODI
18 {
19 namespace GAME
20 {
21 class CController;
22 class CPhysicalFeature;
23 class CPhysicalTopology;
24 
26 {
27 public:
31 
32  void Reset(void);
33 
34  int LabelID(void) const { return m_labelId; }
35  const std::string& Icon(void) const { return m_icon; }
36  const std::string& Image(void) const { return m_strImage; }
37 
45  bool IsValid(bool bLog) const;
46 
52  std::string Label(void) const;
53 
59  std::string ImagePath(void) const;
60 
70  const CPhysicalTopology& Topology(void) const { return *m_topology; }
71 
79  void Deserialize(const TiXmlElement* pLayoutElement,
80  const CController* controller,
81  std::vector<CPhysicalFeature>& features);
82 
83 private:
84  const CController* m_controller = nullptr;
85  int m_labelId = -1;
86  std::string m_icon;
87  std::string m_strImage;
88  std::unique_ptr<CPhysicalTopology> m_topology;
89 };
90 
91 } // namespace GAME
92 } // namespace KODI
Represents the physical topology of controller add-ons.
Definition: PhysicalTopology.h:29
Definition: ControllerLayout.h:25
Controller configuration window.
Definition: AudioDecoder.h:18
std::string ImagePath(void) const
Get the image path of the primary layout used when mapping the controller.
Definition: ControllerLayout.cpp:80
Definition: Controller.h:30
void Deserialize(const TiXmlElement *pLayoutElement, const CController *controller, std::vector< CPhysicalFeature > &features)
Deserialize the specified XML element.
Definition: ControllerLayout.cpp:90
std::string Label(void) const
Get the label of the primary layout used when mapping the controller.
Definition: ControllerLayout.cpp:70
const CPhysicalTopology & Topology(void) const
Get the physical topology of this controller.
Definition: ControllerLayout.h:70
bool IsValid(bool bLog) const
Ensures the layout was deserialized correctly, and optionally logs if not.
Definition: ControllerLayout.cpp:49