neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_status_bar.hpp
Go to the documentation of this file.
1// i_status_bar.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 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#pragma once
20
21#include <neogfx/neogfx.hpp>
23
24namespace neogfx
25{
26 class i_status_bar : public i_widget
27 {
28 public:
30 typedef uint32_t widget_index;
31 public:
32 virtual ~i_status_bar() = default;
33 public:
34 virtual const i_widget& as_widget() const = 0;
35 virtual i_widget& as_widget() = 0;
36 public:
37 virtual const i_widget& size_grip() const = 0;
38 public:
39 virtual bool have_message() const = 0;
40 virtual i_string const& message() const = 0;
41 virtual void set_message(i_string const& aMessage) = 0;
42 virtual void clear_message() = 0;
43 virtual void add_normal_widget(i_widget& aWidget) = 0;
44 virtual void add_normal_widget_at(widget_index aPosition, i_widget& aWidget) = 0;
45 virtual void add_normal_widget(i_ref_ptr<i_widget> const& aWidget) = 0;
46 virtual void add_normal_widget_at(widget_index aPosition, i_ref_ptr<i_widget> const& aWidget) = 0;
47 virtual void add_permanent_widget(i_widget& aWidget) = 0;
48 virtual void add_permanent_widget_at(widget_index aPosition, i_widget& aWidget) = 0;
49 virtual void add_permanent_widget(i_ref_ptr<i_widget> const& aWidget) = 0;
50 virtual void add_permanent_widget_at(widget_index aPosition, i_ref_ptr<i_widget> const& aWidget) = 0;
51 public:
52 virtual i_layout& normal_layout() = 0;
53 virtual i_layout& permanent_layout() = 0;
54 public:
55 virtual i_widget& message_widget() = 0;
56 virtual i_widget& idle_widget() = 0;
57 public:
58 template<typename WidgetType>
59 WidgetType& add_normal_widget()
60 {
61 auto w = make_ref<WidgetType>();
63 return *w;
64 }
65 template<typename WidgetType>
66 WidgetType& add_normal_widget_at(widget_index aPosition)
67 {
68 auto w = make_ref<WidgetType>();
69 add_normal_widget_at(aPosition, w);
70 return *w;
71 }
72 template<typename WidgetType>
74 {
75 auto w = make_ref<WidgetType>();
77 return *w;
78 }
79 template<typename WidgetType>
81 {
82 auto w = make_ref<WidgetType>();
83 add_permanent_widget_at(aPosition, w);
84 return *w;
85 }
86 };
87}
virtual void add_permanent_widget(i_widget &aWidget)=0
WidgetType & add_permanent_widget()
virtual i_string const & message() const =0
WidgetType & add_normal_widget()
virtual i_widget & message_widget()=0
virtual void add_permanent_widget_at(widget_index aPosition, i_widget &aWidget)=0
virtual void add_permanent_widget(i_ref_ptr< i_widget > const &aWidget)=0
virtual void add_normal_widget(i_ref_ptr< i_widget > const &aWidget)=0
virtual i_layout & permanent_layout()=0
virtual void add_normal_widget_at(widget_index aPosition, i_ref_ptr< i_widget > const &aWidget)=0
virtual void add_normal_widget(i_widget &aWidget)=0
virtual i_layout & normal_layout()=0
virtual void add_permanent_widget_at(widget_index aPosition, i_ref_ptr< i_widget > const &aWidget)=0
WidgetType & add_permanent_widget_at(widget_index aPosition)
virtual void set_message(i_string const &aMessage)=0
virtual const i_widget & as_widget() const =0
virtual void add_normal_widget_at(widget_index aPosition, i_widget &aWidget)=0
virtual ~i_status_bar()=default
i_status_bar abstract_type
virtual i_widget & idle_widget()=0
virtual i_widget & as_widget()=0
virtual const i_widget & size_grip() const =0
virtual void clear_message()=0
WidgetType & add_normal_widget_at(widget_index aPosition)
virtual bool have_message() const =0