| 1 |
/* |
| 2 |
* Copyright (C) 2021-2024 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 "games/GameTypes.h" |
| 12 |
|
| 13 |
namespace KODI |
| 14 |
{ |
| 15 |
namespace GAME |
| 16 |
{ |
| 17 |
/*! |
| 18 |
* \ingroup games |
| 19 |
* |
| 20 |
* \brief A list populated by the controllers of game-playing agents (\ref CGameAgent) |
| 21 |
* |
| 22 |
* This class manages the behavior of the controller list (with control ID 7) in |
| 23 |
* the player dialog (<b>`GameAgents`</b> window). |
| 24 |
* |
| 25 |
* The active ports are determined by \ref IActivePortList. |
| 26 |
* |
| 27 |
* The list is populated by the \ref CGUIGameControllerProvider. |
| 28 |
*/ |
| 29 |
class IAgentControllerList |
| 30 |
{ |
| 31 |
public: |
| 32 |
virtual ~IAgentControllerList() = default; |
| 33 |
|
| 34 |
/*! |
| 35 |
* \brief Callback when the GUI window is loaded |
| 36 |
*/ |
| 37 |
virtual void OnWindowLoaded() = 0; |
| 38 |
|
| 39 |
/*! |
| 40 |
* \brief Callback when the GUI window is unloaded |
| 41 |
*/ |
| 42 |
virtual void OnWindowUnload() = 0; |
| 43 |
|
| 44 |
/*! |
| 45 |
* \brief Initialize resources |
| 46 |
* |
| 47 |
* \param gameClient The active game client, an empty pointer if no game |
| 48 |
* client is active |
| 49 |
* |
| 50 |
* \return True if the resource is initialized and can be used, false if the |
| 51 |
* resource failed to initialize and must not be used |
| 52 |
*/ |
| 53 |
virtual bool Initialize(GameClientPtr gameClient) = 0; |
| 54 |
|
| 55 |
/*! |
| 56 |
* \brief Deinitialize resources |
| 57 |
*/ |
| 58 |
virtual void Deinitialize() = 0; |
| 59 |
|
| 60 |
/*! |
| 61 |
* \brief Query if a control with the given ID belongs to this list |
| 62 |
*/ |
| 63 |
virtual bool HasControl(int controlId) const = 0; |
| 64 |
|
| 65 |
/*! |
| 66 |
* \brief Query the ID of the current control in this list |
| 67 |
*/ |
| 68 |
virtual int GetCurrentControl() const = 0; |
| 69 |
|
| 70 |
/*! |
| 71 |
* \brief Called once per frame |
| 72 |
* |
| 73 |
* This allows the list to update its currently focused item. |
| 74 |
*/ |
| 75 |
virtual void FrameMove() = 0; |
| 76 |
|
| 77 |
/*! |
| 78 |
* \brief Refresh the contents of the list |
| 79 |
*/ |
| 80 |
virtual void Refresh() = 0; |
| 81 |
|
| 82 |
/*! |
| 83 |
* \brief The agent list has been focused in the GUI |
| 84 |
*/ |
| 85 |
virtual void SetFocused() = 0; |
| 86 |
|
| 87 |
/*! |
| 88 |
* \brief The agent list has been selected in the GUI |
| 89 |
*/ |
| 90 |
virtual void OnSelect() = 0; |
| 91 |
}; |
| 92 |
} // namespace GAME |
| 93 |
} // namespace KODI |