neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_tab_container.hpp
Go to the documentation of this file.
1// i_tab_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>
26
27namespace neogfx
28{
29 enum class tab_container_style : uint32_t
30 {
31 TabAlignmentTop = 0x0000,
32 TabAlignmentBottom = 0x0001,
33 TabAlignmentLeft = 0x0002,
34 TabAlignmentRight = 0x0003,
35 TabAlignmentMask = 0x0003,
37 TabOrientationVertical = 0x0004, // todo
38 TabOrientationMask = 0x0004,
39 ResizeToTabs = 0x1000
40 };
42 {
43 return static_cast<tab_container_style>(static_cast<uint32_t>(aLhs) | static_cast<uint32_t>(aRhs));
44 }
46 {
47 return static_cast<tab_container_style>(static_cast<uint32_t>(aLhs) & static_cast<uint32_t>(aRhs));
48 }
50 {
51 return static_cast<tab_container_style>(~static_cast<uint32_t>(aLhs));
52 }
53
55 {
56 public:
57 declare_event(style_changed)
58 public:
59 typedef uint32_t tab_index;
60 typedef std::optional<tab_index> optional_tab_index;
61 public:
62 struct tab_not_found : std::logic_error { tab_not_found() : std::logic_error("neogfx::i_tab_container::tab_not_found") {} };
63 struct no_parent_container : std::logic_error { no_parent_container() : std::logic_error("neogfx::i_tab_container::no_parent_container") {} };
64 struct no_tab_page : std::logic_error { no_tab_page() : std::logic_error("neogfx::i_tab_container::no_tab_page") {} };
65 public:
66 virtual bool closable_tabs() const noexcept = 0;
67 virtual void set_closable_tabs(bool aClosableTabs) = 0;
68 virtual neogfx::tab_container_style tab_container_style() const noexcept = 0;
70 virtual void set_tab_icon_size(const size& aIconSize) = 0;
71 public:
72 virtual bool has_tabs() const noexcept = 0;
73 virtual uint32_t tab_count() const noexcept = 0;
74 virtual tab_index index_of(const i_tab& aTab) const = 0;
75 virtual const i_tab& tab(tab_index aTabIndex) const = 0;
76 virtual i_tab& tab(tab_index aTabIndex) = 0;
77 virtual bool is_tab_selected() const noexcept = 0;
78 virtual const i_tab& selected_tab() const = 0;
79 virtual i_tab& selected_tab() = 0;
80 virtual i_tab& add_tab(i_string const& aTabText) = 0;
81 virtual i_tab& insert_tab(tab_index aTabIndex, i_string const& aTabText) = 0;
82 virtual void remove_tab(tab_index aTabIndex) = 0;
83 virtual void show_tab(tab_index aTabIndex) = 0;
84 virtual void hide_tab(tab_index aTabIndex) = 0;
85 virtual optional_tab_index next_visible_tab(tab_index aStartFrom) const = 0;
86 virtual optional_tab_index previous_visible_tab(tab_index aStartFrom) const = 0;
87 virtual void select_next_tab() = 0;
88 virtual void select_previous_tab() = 0;
89 public:
90 virtual void adding_tab(i_tab& aTab) = 0;
91 virtual void selecting_tab(i_tab& aTab) = 0;
92 virtual void removing_tab(i_tab& aTab) = 0;
93 public:
94 virtual bool has_tab_page(tab_index aTabIndex) const = 0;
95 virtual const i_tab_page& tab_page(tab_index aTabIndex) const = 0;
96 virtual i_tab_page& tab_page(tab_index aTabIndex) = 0;
97 public:
98 virtual bool has_parent_container() const = 0;
99 virtual const i_tab_container& parent_container() const = 0;
101 virtual const i_widget& as_widget() const = 0;
102 virtual i_widget& as_widget() = 0;
103 };
104}
virtual bool has_tab_page(tab_index aTabIndex) const =0
virtual const i_tab_container & parent_container() const =0
virtual bool has_tabs() const noexcept=0
virtual optional_tab_index next_visible_tab(tab_index aStartFrom) const =0
virtual void adding_tab(i_tab &aTab)=0
virtual void set_tab_icon_size(const size &aIconSize)=0
virtual void select_next_tab()=0
virtual void removing_tab(i_tab &aTab)=0
virtual const i_tab & tab(tab_index aTabIndex) const =0
virtual tab_index index_of(const i_tab &aTab) const =0
virtual uint32_t tab_count() const noexcept=0
virtual i_tab & add_tab(i_string const &aTabText)=0
virtual void selecting_tab(i_tab &aTab)=0
declare_event(style_changed) public typedef std::optional< tab_index > optional_tab_index
virtual i_tab & insert_tab(tab_index aTabIndex, i_string const &aTabText)=0
virtual void show_tab(tab_index aTabIndex)=0
virtual bool is_tab_selected() const noexcept=0
virtual const i_widget & as_widget() const =0
virtual const i_tab & selected_tab() const =0
virtual void hide_tab(tab_index aTabIndex)=0
virtual void set_closable_tabs(bool aClosableTabs)=0
virtual bool has_parent_container() const =0
virtual void select_previous_tab()=0
virtual void set_tab_container_style(neogfx::tab_container_style aStyle)=0
virtual optional_tab_index previous_visible_tab(tab_index aStartFrom) const =0
virtual void remove_tab(tab_index aTabIndex)=0
virtual bool closable_tabs() const noexcept=0
constexpr style_aspect operator&(style_aspect aLhs, style_aspect aRhs)
Definition i_style.hpp:60
audio_channel operator~(audio_channel lhs)
constexpr style_aspect operator|(style_aspect aLhs, style_aspect aRhs)
Definition i_style.hpp:55
#define declare_event(declName,...)
Definition i_event.hpp:305