neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_basic_services.hpp
Go to the documentation of this file.
1// i_basic_services.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
25
26namespace neogfx
27{
28 class i_display;
29 class i_native_clipboard;
30 class i_shared_menu_bar;
31
32 enum class platform
33 {
34 Windows,
35 Mac,
36 Kde,
37 Gnome
38 };
39
41 {
42 public:
43 struct bad_display_index : std::logic_error { bad_display_index() : std::logic_error("neogfx::i_basic_services::bad_display_index") {} };
44 struct no_system_menu_bar : std::logic_error { no_system_menu_bar() : std::logic_error("neogfx::i_basic_services::no_system_menu_bar") {} };
45 public:
46 virtual ~i_basic_services() = default;
47 public:
48 virtual neogfx::platform platform() const = 0;
49 virtual i_async_task& app_task() = 0;
50 virtual void system_beep() = 0;
51 virtual void display_error_dialog(std::string const& aTitle, std::string const& aMessage, void* aParentWindowHandle = 0) const = 0;
52 virtual uint32_t display_count() const = 0;
53 virtual i_display& display(uint32_t aDisplayIndex = 0) const = 0;
54 virtual bool has_system_clipboard() const = 0;
55 virtual i_native_clipboard& system_clipboard() = 0;
56 virtual bool has_system_menu_bar() const = 0;
58 virtual bool open_uri(std::string const& aUri) = 0;
59 public:
60 static uuid const& iid() { static uuid const sIid{ 0x86d1e3fa, 0xbf79, 0x4940, 0xa648, { 0xaf, 0xad, 0xbf, 0xf2, 0x9c, 0xcd } }; return sIid; }
61 };
62}
virtual bool has_system_menu_bar() const =0
virtual ~i_basic_services()=default
virtual i_shared_menu_bar & system_menu_bar()=0
virtual bool open_uri(std::string const &aUri)=0
virtual void display_error_dialog(std::string const &aTitle, std::string const &aMessage, void *aParentWindowHandle=0) const =0
virtual neogfx::platform platform() const =0
virtual void system_beep()=0
virtual uint32_t display_count() const =0
virtual i_native_clipboard & system_clipboard()=0
virtual i_async_task & app_task()=0
virtual i_display & display(uint32_t aDisplayIndex=0) const =0
static uuid const & iid()
virtual bool has_system_clipboard() const =0