neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_help.hpp
Go to the documentation of this file.
1// i_help.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>
23#include <neogfx/core/event.hpp>
24
25namespace neogfx
26{
27 enum class help_type
28 {
29 Action
30 };
31
33 {
34 public:
35 virtual ~i_help_source() = default;
36 public:
37 virtual bool help_active() const = 0;
38 virtual neogfx::help_type help_type() const = 0;
39 virtual i_string const& help_text() const = 0;
40 };
41
42 class i_help
43 {
44 public:
45 struct help_not_active : std::logic_error { help_not_active() : std::logic_error("neogfx::i_help::help_not_active") {} };
46 struct invalid_help_source : std::logic_error { invalid_help_source() : std::logic_error("neogfx::i_help::invalid_help_source") {} };
47 public:
48 declare_event(help_activated, const i_help_source&)
49 declare_event(help_deactivated, const i_help_source&)
50 public:
51 virtual ~i_help() = default;
52 public:
53 virtual bool help_active() const = 0;
54 virtual const i_help_source& active_help() const = 0;
55 public:
56 virtual void activate(const i_help_source& aSource) = 0;
57 virtual void deactivate(const i_help_source& aSource) = 0;
58 };
59}
virtual i_string const & help_text() const =0
virtual ~i_help_source()=default
virtual bool help_active() const =0
virtual neogfx::help_type help_type() const =0
virtual void deactivate(const i_help_source &aSource)=0
virtual void activate(const i_help_source &aSource)=0
virtual const i_help_source & active_help() const =0
virtual ~i_help()=default
virtual bool help_active() const =0
declare_event(help_activated, const i_help_source &) declare_event(help_deactivated
help_type
Definition i_help.hpp:28
#define declare_event(declName,...)
Definition i_event.hpp:305