OpenRCT2/src/openrct2-ui/UiContext.h

55 lines
2.0 KiB
C
Raw Normal View History

/*****************************************************************************
* Copyright (c) 2014-2023 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include <memory>
#include <openrct2/common.h>
2018-06-22 23:22:29 +02:00
#include <string>
2020-10-21 19:53:22 +02:00
#include <vector>
struct SDL_Window;
namespace OpenRCT2
{
struct IContext;
struct IPlatformEnvironment;
namespace Ui
{
2018-06-22 23:22:29 +02:00
struct FileDialogDesc;
class InGameConsole;
struct IUiContext;
struct IPlatformUiContext
{
virtual ~IPlatformUiContext() = default;
virtual void SetWindowIcon(SDL_Window* window) abstract;
virtual bool IsSteamOverlayAttached() abstract;
virtual void ShowMessageBox(SDL_Window* window, const std::string& message) abstract;
2020-10-21 19:53:22 +02:00
virtual bool HasMenuSupport() abstract;
virtual int32_t ShowMenuDialog(
2020-10-21 19:53:22 +02:00
const std::vector<std::string>& options, const std::string& title, const std::string& text) abstract;
virtual void OpenFolder(const std::string& path) abstract;
virtual void OpenURL(const std::string& url) abstract;
virtual std::string ShowFileDialog(SDL_Window* window, const FileDialogDesc& desc) abstract;
virtual std::string ShowDirectoryDialog(SDL_Window* window, const std::string& title) abstract;
2020-11-08 13:29:44 +01:00
virtual bool HasFilePicker() const abstract;
};
[[nodiscard]] std::unique_ptr<IUiContext> CreateUiContext(const std::shared_ptr<IPlatformEnvironment>& env);
[[nodiscard]] std::unique_ptr<IPlatformUiContext> CreatePlatformUiContext();
2018-03-11 23:25:34 +01:00
[[nodiscard]] InGameConsole& GetInGameConsole();
2018-05-04 22:40:09 +02:00
} // namespace Ui
} // namespace OpenRCT2