API Documentation
Loading...
Searching...
No Matches
SectionContent.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: SectionContent
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/ButtonDialog.h>
35#include <NDEVR/RibbonArea.h>
36#include <NDEVR/UUID.h>
37#include <NDEVR/TranslatedString.h>
38#include <functional>
39class QWidget;
40
41namespace NDEVR
42{
43 class SectionTab;
44 class ContainerWidgetBase;
45 class FloatingWidget;
46 /**--------------------------------------------------------------------------------------------------
47 \brief The core container for objects using the NDEVR API Widget Docking system. Contains information
48 used to correctly display the content.
49 **/
51 {
52 friend class ContainerWidgetBase;
53 private:
54 SectionContent(const SectionContent&) = delete;
56 SectionContent& operator=(const SectionContent&) = delete;
57 public:
58 SectionContent(ContainerWidgetBase* container, SectionTab* title, QWidget* content, RibbonArea prefered_ribbon_area);
59 SectionContent(ContainerWidgetBase* container, SectionTab* title, const std::function<void(SectionContent*)>& function, RibbonArea prefered_ribbon_area);
60 virtual ~SectionContent();
61 void onCheckedClick() override;
62 void setContainer(ContainerWidgetBase* container);
63 void setSectionWidget(SectionWidget* widget);
64 void setFloatingWidget(FloatingWidget* widget);
65 const TranslatedString& title() const { return m_title; }
66 void setTitle(const TranslatedString& title) { m_title = title; }
67 SectionWidget* sectionWidget() const { return m_section_widget; }
68 FloatingWidget* floatingWidget() const { return m_floating_widget; }
69 UUID uid() const;
72 QWidget* contentWidget() const;
73 void setContentWidget(QWidget* widget);
74 RibbonArea preferredRibbonArea() const { return m_prefered_ribbon_area; }
76 const std::function<void(SectionContent*)>& specialCallback() { return m_special_callback; }
77 bool hasSpecialCallback() const { return m_special_callback != nullptr; }
78 void setSpecialCallback(const std::function<void(SectionContent*)>& callback) { m_special_callback = callback; }
79 void runSpecialCallback() { m_special_callback(this); }
80 void setAllowHide(bool allow_hide) { m_allow_hide = allow_hide; }
81 bool allowHide() const { return m_allow_hide; }
82 void setAllowAutoHideTitle(bool allow_hide) { m_allow_auto_hide_title = allow_hide; }
83 bool allowAutoHideTitle() const { return m_allow_auto_hide_title; }
85 private:
86 const UUID m_uid;
87 ContainerWidgetBase* m_container_widget;
88 SectionTab* m_title_widget;
89 SectionWidget* m_section_widget;
90 FloatingWidget* m_floating_widget;
91 std::function<void(SectionContent*)> m_special_callback;
92 QWidget* m_widget;
93 // Optional attributes
94 TranslatedString m_title;
95 RibbonArea m_prefered_ribbon_area;
96 bool m_allow_hide;
97 bool m_allow_auto_hide_title = false;
98 };
99}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
Typically used for dialogs which have any number of buttons associated with it that are toggled on wh...
Definition ButtonDialog.h:46
The root class that manages a series of SectionContent that can share the same space or lay out in va...
Definition ContainerWidget.h:66
Used with the NDEVR API Widget Docking system for widgets that are floating. These widgets appear as ...
Definition FloatingWidget.h:49
The core container for objects using the NDEVR API Widget Docking system. Contains information used t...
Definition SectionContent.h:51
bool allowHide() const
Definition SectionContent.h:81
void runSpecialCallback()
Definition SectionContent.h:79
SectionTab * sectionTab() const
bool hasSpecialCallback() const
Definition SectionContent.h:77
RibbonArea preferredRibbonArea() const
Definition SectionContent.h:74
void setTitle(const TranslatedString &title)
Definition SectionContent.h:66
void setAllowHide(bool allow_hide)
Definition SectionContent.h:80
bool allowAutoHideTitle() const
Definition SectionContent.h:83
ContainerWidgetBase * containerWidget() const
void setSpecialCallback(const std::function< void(SectionContent *)> &callback)
Definition SectionContent.h:78
SectionWidget * sectionWidget() const
Definition SectionContent.h:67
void setPreferredRibbonArea(RibbonArea area)
void setAllowAutoHideTitle(bool allow_hide)
Definition SectionContent.h:82
QWidget * contentWidget() const
FloatingWidget * floatingWidget() const
Definition SectionContent.h:68
void setContentWidget(QWidget *widget)
const std::function< void(SectionContent *)> & specialCallback()
Definition SectionContent.h:76
Provides a tab that is used for either a tab if the section content is attached to a Container,...
Definition SectionTab.h:48
SectionWidget manages multiple instances of SectionContent. It displays a title TAB,...
Definition SectionWidget.h:55
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Definition ACIColor.h:37
RibbonArea
Requests a ribbon or tab area to be in a certain location and orientation relative to another widget.
Definition RibbonArea.h:71
Definition File.h:211