2022-09-05 17:29:42 +08:00
|
|
|
#ifndef OverlayDockContainerH
|
|
|
|
#define OverlayDockContainerH
|
|
|
|
/*******************************************************************************
|
|
|
|
** Qt Advanced Docking System
|
|
|
|
** Copyright (C) 2017 Uwe Kindler
|
|
|
|
**
|
|
|
|
** This library is free software; you can redistribute it and/or
|
|
|
|
** modify it under the terms of the GNU Lesser General Public
|
|
|
|
** License as published by the Free Software Foundation; either
|
|
|
|
** version 2.1 of the License, or (at your option) any later version.
|
|
|
|
**
|
|
|
|
** This library is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
** Lesser General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU Lesser General Public
|
|
|
|
** License along with this library; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
/// \file DockWidgetTab.h
|
|
|
|
/// \author Syarif Fakhri
|
|
|
|
/// \date 05.09.2022
|
|
|
|
/// \brief Declaration of COverlayDockContainer class
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
// INCLUDES
|
|
|
|
//============================================================================
|
|
|
|
#include "ads_globals.h"
|
|
|
|
|
2022-09-08 11:30:56 +08:00
|
|
|
#include "DockWidgetSideTab.h"
|
|
|
|
|
2022-09-05 17:29:42 +08:00
|
|
|
#include <QFrame>
|
|
|
|
|
|
|
|
class QXmlStreamWriter;
|
|
|
|
|
|
|
|
namespace ads
|
|
|
|
{
|
|
|
|
struct OverlayDockContainerPrivate;
|
|
|
|
class CDockManager;
|
|
|
|
class CDockWidget;
|
|
|
|
class CDockContainerWidget;
|
|
|
|
class CSideTabBar;
|
|
|
|
class CDockAreaWidget;
|
|
|
|
class CDockingStateReader;
|
|
|
|
|
|
|
|
class ADS_EXPORT COverlayDockContainer : public QFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2022-09-08 11:30:56 +08:00
|
|
|
|
2022-09-05 17:29:42 +08:00
|
|
|
private:
|
|
|
|
OverlayDockContainerPrivate* d; ///< private data (pimpl)
|
|
|
|
friend struct OverlayDockContainerPrivate;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool eventFilter(QObject* watched, QEvent* event) override;
|
|
|
|
void mousePressEvent(QMouseEvent* event) override;
|
|
|
|
void resizeEvent(QResizeEvent* event) override;
|
|
|
|
void updateMask();
|
|
|
|
void updateSize();
|
|
|
|
|
2022-09-08 11:30:56 +08:00
|
|
|
CDockContainerWidget* parentContainer() const;
|
|
|
|
|
2022-09-05 17:29:42 +08:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Create overlay widget with a dock manager
|
|
|
|
*/
|
2022-09-08 11:30:56 +08:00
|
|
|
COverlayDockContainer(CDockManager* DockManager, CDockWidgetSideTab::SideTabBarArea area, CDockContainerWidget* parent);
|
2022-09-05 17:29:42 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create overlay widget with the given dock widget
|
|
|
|
*/
|
2022-09-08 11:30:56 +08:00
|
|
|
COverlayDockContainer(CDockWidget* DockWidget, CDockWidgetSideTab::SideTabBarArea area, CDockContainerWidget* parent);
|
2022-09-05 17:29:42 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Virtual Destructor
|
|
|
|
*/
|
|
|
|
virtual ~COverlayDockContainer();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get's the side tab bar
|
|
|
|
*/
|
|
|
|
CSideTabBar* sideTabBar() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get's the dock widget in this dock container
|
|
|
|
*/
|
|
|
|
CDockWidget* dockWidget() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a dock widget and removes the previous dock widget
|
|
|
|
*/
|
|
|
|
void addDockWidget(CDockWidget* DockWidget);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the side tab bar area of this overlay dock container
|
|
|
|
*/
|
2022-09-08 11:30:56 +08:00
|
|
|
CDockWidgetSideTab::SideTabBarArea sideTabBarArea() const;
|
2022-09-05 17:29:42 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the dock area widget of this overlay dock container
|
|
|
|
*/
|
|
|
|
CDockAreaWidget* dockAreaWidget() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Moves the contents to the parent container widget
|
|
|
|
* Used before removing this overlay dock container
|
|
|
|
*/
|
|
|
|
void moveContentsToParent();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cleanups up the side tab widget and then deletes itself
|
|
|
|
*/
|
|
|
|
void cleanupAndDelete();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Saves the state and size
|
|
|
|
*/
|
|
|
|
void saveState(QXmlStreamWriter& Stream);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Restores the size of the splitter
|
|
|
|
*/
|
|
|
|
bool restoreState(CDockingStateReader& Stream, bool Testing);
|
2022-09-06 15:35:18 +08:00
|
|
|
|
2022-09-09 12:18:41 +08:00
|
|
|
/*
|
|
|
|
* Toggles the overlay dock container widget
|
|
|
|
* This will also hide the side tab widget
|
|
|
|
*/
|
|
|
|
void toggleView(bool Enable);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Collapses the overlay dock container widget
|
|
|
|
* Does not hide the side tab widget
|
|
|
|
*/
|
|
|
|
void collapseView(bool Enable);
|
|
|
|
|
2022-09-06 15:35:18 +08:00
|
|
|
/*
|
|
|
|
* Convenience function fr determining if area exists in config
|
|
|
|
*/
|
2022-09-08 11:30:56 +08:00
|
|
|
static bool areaExistsInConfig(CDockWidgetSideTab::SideTabBarArea area);
|
2022-09-05 17:29:42 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|