neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_view_container.hpp
Go to the documentation of this file.
1// i_view_container.hpp
2/*
3neogfx C++ App/Game Engine
4Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6This program is free software: you can redistribute it and / or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along 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 class i_widget;
28 class i_tab_container;
29}
30
31namespace neogfx::mvc
32{
33 class i_view;
34 class i_controller;
35
37 {
38 SDI,
39 MDI,
40 Tabbed,
42 };
43
45 {
46 public:
47 declare_event(view_added, i_view&)
48 declare_event(view_removed, i_view&)
49 public:
50 struct controller_not_found : std::logic_error { controller_not_found() : std::logic_error("neogfx::mvc::i_view_container::controller_not_found") {} };
51 public:
52 virtual const i_widget& as_widget() const = 0;
53 virtual i_widget& as_widget() = 0;
54 virtual const i_tab_container& tab_container() const = 0;
56 virtual const i_widget& view_stack() const = 0;
57 virtual i_widget& view_stack() = 0;
58 public:
59 virtual view_container_style style() const = 0;
60 virtual void change_style(view_container_style aNewStyle) = 0;
61 public:
62 virtual void add_controller(i_controller& aController) = 0;
63 virtual void add_controller(std::shared_ptr<i_controller> aController) = 0;
64 virtual void remove_controller(i_controller& aController) = 0;
65 };
66}
virtual i_widget & view_stack()=0
virtual void remove_controller(i_controller &aController)=0
virtual void add_controller(std::shared_ptr< i_controller > aController)=0
virtual const i_widget & view_stack() const =0
virtual const i_tab_container & tab_container() const =0
virtual i_widget & as_widget()=0
declare_event(view_added, i_view &) declare_event(view_removed
virtual void add_controller(i_controller &aController)=0
virtual void change_style(view_container_style aNewStyle)=0
virtual view_container_style style() const =0
virtual const i_widget & as_widget() const =0
virtual i_tab_container & tab_container()=0
#define declare_event(declName,...)
Definition i_event.hpp:305