neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_controller.hpp
Go to the documentation of this file.
1// i_controller.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>
24
25namespace neogfx::mvc
26{
27 class i_model;
28 class i_view;
29
30 class i_view_container;
31
33 {
34 public:
35 declare_event(view_added, i_view&)
36 declare_event(view_removed, i_view&)
37 public:
38 struct view_not_found : std::logic_error { view_not_found() : std::logic_error("neogfx::mvc::i_controller::view_not_found") {} };
39 public:
40 virtual const i_model& model() const = 0;
41 virtual i_model& model() = 0;
42 public:
43 virtual void add_view(i_view& aView) = 0;
44 virtual void add_view(std::shared_ptr<i_view> aView) = 0;
45 virtual void remove_view(i_view& aView) = 0;
46 virtual bool only_weak_views() const = 0;
47 public:
48 virtual const i_view_container& container() const = 0;
50 };
51}
virtual void remove_view(i_view &aView)=0
virtual i_model & model()=0
virtual void add_view(i_view &aView)=0
virtual const i_view_container & container() const =0
virtual const i_model & model() const =0
virtual bool only_weak_views() const =0
virtual i_view_container & container()=0
declare_event(view_added, i_view &) declare_event(view_removed
virtual void add_view(std::shared_ptr< i_view > aView)=0
#define declare_event(declName,...)
Definition i_event.hpp:305