1 /*****************************************************************************
2  * Copyright (c) 2014-2020 OpenRCT2 developers
3  *
4  * For a complete list of all authors, please refer to contributors.md
5  * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
6  *
7  * OpenRCT2 is licensed under the GNU General Public License version 3.
8  *****************************************************************************/
9 
10 #pragma once
11 
12 #include <memory>
13 #include <openrct2/common.h>
14 #include <string>
15 #include <vector>
16 
17 struct SDL_Window;
18 
19 namespace OpenRCT2
20 {
21     struct IContext;
22     struct IPlatformEnvironment;
23 
24     namespace Ui
25     {
26         struct FileDialogDesc;
27         class InGameConsole;
28         struct IUiContext;
29 
30         struct IPlatformUiContext
31         {
32             virtual ~IPlatformUiContext() = default;
33             virtual void SetWindowIcon(SDL_Window* window) abstract;
34             virtual bool IsSteamOverlayAttached() abstract;
35 
36             virtual void ShowMessageBox(SDL_Window* window, const std::string& message) abstract;
37             virtual bool HasMenuSupport() abstract;
38             virtual int32_t ShowMenuDialog(
39                 const std::vector<std::string>& options, const std::string& title, const std::string& text) abstract;
40             virtual void OpenFolder(const std::string& path) abstract;
41 
42             virtual void OpenURL(const std::string& url) abstract;
43             virtual std::string ShowFileDialog(SDL_Window* window, const FileDialogDesc& desc) abstract;
44             virtual std::string ShowDirectoryDialog(SDL_Window* window, const std::string& title) abstract;
45 
46             virtual bool HasFilePicker() const abstract;
47         };
48 
49         [[nodiscard]] std::unique_ptr<IUiContext> CreateUiContext(const std::shared_ptr<IPlatformEnvironment>& env);
50         [[nodiscard]] IPlatformUiContext* CreatePlatformUiContext();
51 
52         [[nodiscard]] InGameConsole& GetInGameConsole();
53     } // namespace Ui
54 } // namespace OpenRCT2
55