34#include <NDEVR/ButtonDialog.h>
35#include <NDEVR/RibbonArea.h>
36#include <NDEVR/UUID.h>
37#include <NDEVR/TranslatedString.h>
52 class NDEVR_WIDGETS_API SectionContent :
public QObject,
public ButtonDialog
55 friend class ContainerWidgetBase;
57 SectionContent(
const SectionContent&) =
delete;
58 SectionContent(SectionContent&&)
noexcept;
59 SectionContent& operator=(
const SectionContent&) =
delete;
77 virtual ~SectionContent();
156 const std::function<void(SectionContent*)>&
specialCallback() {
return m_special_callback; }
166 void setSpecialCallback(
const std::function<
void(SectionContent*)>& callback) { m_special_callback = callback; }
203 ContainerWidgetBase* m_container_widget;
207 std::function<void(SectionContent*)> m_special_callback;
213 bool m_allow_auto_hide_title =
false;
SectionContent(ContainerWidgetBase *container, SectionTab *title, QWidget *content, RibbonArea preferred_ribbon_area)
Constructs a SectionContent with the given container, title tab, content widget, and ribbon area.
SectionTab * sectionTab() const
Returns the section tab associated with this content.
RibbonArea preferredRibbonArea() const
Returns the preferred ribbon area for docking this content.
void onCheckedClick() override
Called when the associated button dialog is checked or clicked.
void setAllowAutoHideTitle(bool allow_hide)
Sets whether the title bar can be automatically hidden when not needed.
FloatingWidget * floatingWidget() const
Returns the floating widget currently hosting this content, if any.
void setContentWidget(QWidget *widget)
Sets the widget displaying the actual content.
const std::function< void(SectionContent *)> & specialCallback()
Returns the special callback function, if one has been set.
void setSpecialCallback(const std::function< void(SectionContent *)> &callback)
Sets a special callback function to be invoked for deferred content creation.
void setContainer(ContainerWidgetBase *container)
Sets the parent container widget for this content.
void autoHideTitleChangedSignal(bool allow_hide)
Emitted when the auto-hide title setting changes.
void setAllowHide(bool allow_hide)
Sets whether this section content is allowed to be hidden by the user.
const TranslatedString & title() const
Returns the display title of this section content.
QWidget * contentWidget() const
Returns the widget displaying the actual content.
UUID uid() const
Returns the unique identifier for this section content.
void setPreferredRibbonArea(RibbonArea area)
Sets the preferred ribbon area for docking this content.
void runSpecialCallback()
Executes the special callback function, passing this content as the argument.
ContainerWidgetBase * containerWidget() const
Returns the container widget that owns this section content.
void setTitle(const TranslatedString &title)
Sets the display title of this section content.
bool allowHide() const
Returns whether this section content is allowed to be hidden by the user.
SectionWidget * sectionWidget() const
Returns the section widget currently hosting this content, if any.
bool hasSpecialCallback() const
Checks whether a special callback has been set for this content.
SectionContent(ContainerWidgetBase *container, SectionTab *title, const std::function< void(SectionContent *)> &function, RibbonArea preferred_ribbon_area)
Constructs a SectionContent with a deferred creation callback instead of an immediate widget.
void setFloatingWidget(FloatingWidget *widget)
Sets the floating widget that currently hosts this content.
bool allowAutoHideTitle() const
Returns whether the title bar can be automatically hidden when not needed.
void setSectionWidget(SectionWidget *widget)
Sets the section widget that currently hosts this content.
void retranslate()
Retranslates all user-facing strings for this section content.
Provides a tab that is used for either a tab if the section content is attached to a Container,...
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
The primary namespace for the NDEVR SDK.
RibbonArea
Requests a ribbon or tab area to be in a certain location and orientation relative to another widget.