neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_dock.hpp
Go to the documentation of this file.
1// i_dock.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
20#pragma once
21
22#include <neogfx/neogfx.hpp>
25
26namespace neogfx
27{
28 class i_dockable;
29
30 enum class dock_area : uint32_t
31 {
32 None = 0x00000000,
33 Top = 0x00000001,
34 Bottom = 0x00000002,
35 Left = 0x00000004,
36 Right = 0x00000008,
37 North = Top,
38 South = Bottom,
39 East = Right,
40 West = Left,
44 };
45
46 inline constexpr dock_area operator|(dock_area aLhs, dock_area aRhs)
47 {
48 return static_cast<dock_area>(static_cast<uint32_t>(aLhs) | static_cast<uint32_t>(aRhs));
49 }
50
51 inline constexpr dock_area operator&(dock_area aLhs, dock_area aRhs)
52 {
53 return static_cast<dock_area>(static_cast<uint32_t>(aLhs) & static_cast<uint32_t>(aRhs));
54 }
55}
56
70
71namespace neogfx
72{
73 class i_dock : public virtual i_skinnable_item
74 {
75 friend class dockable;
76 public:
77 struct item_not_found : std::logic_error { item_not_found() : std::logic_error{ "neogfx::i_dock::item_not_found" } {} };
78 public:
79 using item = i_ref_ptr<i_dockable>;
80 using item_list = neolib::i_vector<item>;
81 public:
82 virtual dock_area area() const = 0;
83 virtual void set_area(dock_area aArea) = 0;
84 public:
85 virtual ~i_dock() = default;
86 public:
87 virtual const item_list& items() const = 0;
88 private:
89 virtual void add(const item& aItem) = 0;
90 virtual void remove(const item& aItem) = 0;
91 };
92}
#define end_declare_enum(enumName)
Definition i_enum.hpp:62
#define declare_enum_string(enumName, enumEnumerator)
Definition i_enum.hpp:59
#define begin_declare_enum(enumName)
Definition i_enum.hpp:52
constexpr style_aspect operator&(style_aspect aLhs, style_aspect aRhs)
Definition i_style.hpp:60
dock_area
Definition i_dock.hpp:31
constexpr style_aspect operator|(style_aspect aLhs, style_aspect aRhs)
Definition i_style.hpp:55
Definition plf_hive.h:79