[Windows] Fix driver version detection of AMD RDNA+ GPU on Windows 10
[xbmc.git] / xbmc / games / GameUtils.h
blob918f24e8ae9c33a7586d5b9ccbe932954b637c5f
1 /*
2 * Copyright (C) 2012-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "GameTypes.h"
13 #include <set>
14 #include <string>
16 class CFileItem;
17 class CURL;
19 namespace ADDON
21 class IAddon;
22 using AddonPtr = std::shared_ptr<IAddon>;
23 using VECADDONS = std::vector<AddonPtr>;
24 } // namespace ADDON
26 namespace KODI
28 namespace GAME
30 /*!
31 * \ingroup games
33 * \brief Game related utilities.
35 class CGameUtils
37 public:
38 /*!
39 * \brief Set the game client property, prompt the user for a savestate if there are any
40 * (savestates store the information of which game client created it).
41 * If there are no savestates or the user wants a new savestate, prompt the user
42 * for a game client.
44 * \param item The item with or without a game client in its info tag
45 * \param savestatePath Output. The path to the savestate selected. Empty if new savestate was
46 * selected
48 * \return True if the item has a valid game client ID in its info tag
50 static bool FillInGameClient(CFileItem& item, std::string& savestatePath);
52 /*!
53 * \brief Check if the file extension is supported by an add-on in
54 * a local or remote repository
56 * \param path The path of the game file
58 * \return true if the path's extension is supported by a known game client
60 static bool HasGameExtension(const std::string& path);
62 /*!
63 * \brief Get all game extensions
65 static std::set<std::string> GetGameExtensions();
67 /*!
68 * \brief Check if game script or game add-on can be launched directly
70 * \return true if the add-on can be launched, false otherwise
72 static bool IsStandaloneGame(const ADDON::AddonPtr& addon);
74 private:
75 static void GetGameClients(const CFileItem& file,
76 GameClientVector& candidates,
77 GameClientVector& installable,
78 bool& bHasVfsGameClient);
79 static void GetGameClients(const ADDON::VECADDONS& addons,
80 const CURL& translatedUrl,
81 GameClientVector& candidates,
82 bool& bHasVfsGameClient);
84 /*!
85 * \brief Install the specified game client
87 * If the game client is not installed, a model dialog is shown installing
88 * the game client. If the installation fails, an error dialog is shown.
90 * \param gameClient The game client to install
92 * \return True if the game client is installed, false otherwise
94 static bool Install(const std::string& gameClient);
96 /*!
97 * \brief Enable the specified game client
99 * \param gameClient the game client to enable
101 * \return True if the game client is enabled, false otherwise
103 static bool Enable(const std::string& gameClient);
105 } // namespace GAME
106 } // namespace KODI