API Documentation
Loading...
Searching...
No Matches
SectionTab.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: SectionTab
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/RibbonArea.h>
35#include <QWidget>
36#include <QIcon>
37namespace NDEVR
38{
39 class TranslatedString;
40 class SectionContent;
41 class String;
42 class FloatingWidget;
43 /**--------------------------------------------------------------------------------------------------
44 \brief Provides a tab that is used for either a tab if the section content is attached to a
45 Container, or as the drag bar if the content is floating.
46 **/
47 class NDEVR_WIDGETS_API SectionTab : public QWidget
48 {
49 Q_OBJECT
50 public:
51 SectionTab(SectionContent* content, QWidget* parent);
52 virtual ~SectionTab();
53 bool isActiveTab() const;
54 void setActiveTab(bool active);
55 virtual void setFloatingWidget(FloatingWidget* widget);
56 virtual void setFullscreen(bool fullscreen);
58 protected:
59 virtual void mousePressEvent(QMouseEvent* event) override;
60 virtual void mouseReleaseEvent(QMouseEvent* ev) override;
61 virtual void mouseMoveEvent(QMouseEvent* ev) override;
62 virtual void leaveEvent(QEvent* event) override;
65 signals:
66 void moveableUpdated(bool is_moveable);
67 void closableUpdated(bool is_moveable);
68 void fullscreenUpdated(bool is_moveable);
69 void isShownUpdated(bool is_shown);
72 void fullscreenSignal(bool fullscreen);
76 public:
78 void setRoundedCorners(int radius_tl, int radius_tr, int radius_bl, int radius_br);
79 void setIsShown(bool shown);
80 bool event(QEvent* event) override;
81 virtual bool isMovable() const;
82 virtual bool isShown() const;
83 virtual QIcon getIcon() const { return QIcon(); };
84 virtual TranslatedString getTitle() const;
85 virtual void setLocation(RibbonArea area, bool is_docked) = 0;
86 virtual void setDocked(bool is_docked) = 0;
87 virtual void setSelected(bool is_selected) = 0;
88 protected:
96 private:
97 bool m_is_shown;
98 int m_radius_tl = 0;
99 int m_radius_tr = 0;
100 int m_radius_bl = 0;
101 int m_radius_br = 0;
102 };
103}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
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
Provides a tab that is used for either a tab if the section content is attached to a Container,...
Definition SectionTab.h:48
void setRoundedCorners(int radius_tl, int radius_tr, int radius_bl, int radius_br)
void updateClosableSignal()
QPointF m_drag_start_pos
Definition SectionTab.h:91
void recieveFullScreenButtonClicked()
void updateRoundedCorners()
virtual void mousePressEvent(QMouseEvent *event) override
void recieveCloseButtonClicked()
virtual QIcon getIcon() const
Definition SectionTab.h:83
bool isActiveTab() const
void clickedSignal(SectionContent *content)
void fullscreenUpdated(bool is_moveable)
void setIsShown(bool shown)
void closableUpdated(bool is_moveable)
virtual ~SectionTab()
virtual void setFloatingWidget(FloatingWidget *widget)
bool event(QEvent *event) override
virtual bool isMovable() const
void setActiveTab(bool active)
void isShownUpdated(bool is_shown)
void moveableUpdated(bool is_moveable)
virtual void setSelected(bool is_selected)=0
virtual void setLocation(RibbonArea area, bool is_docked)=0
bool m_tab_moving
Definition SectionTab.h:93
SectionTab(SectionContent *content, QWidget *parent)
QPointF m_local_drag_pos
Definition SectionTab.h:92
virtual bool isShown() const
virtual void leaveEvent(QEvent *event) override
bool m_is_fullscreen
Definition SectionTab.h:95
FloatingWidget * m_floating_widget
Definition SectionTab.h:90
virtual void mouseReleaseEvent(QMouseEvent *ev) override
virtual void setFullscreen(bool fullscreen)
void setSectionContent(SectionContent *content)
virtual TranslatedString getTitle() const
SectionContent * m_content
Definition SectionTab.h:89
bool m_active_tab
Definition SectionTab.h:94
virtual void mouseMoveEvent(QMouseEvent *ev) override
void updateMoveableSignal()
virtual void setDocked(bool is_docked)=0
void closedSignal(SectionContent *content)
void fullscreenSignal(bool fullscreen)
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
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