DockContainerWidget.h
Go to the documentation of this file.
1 #ifndef DockContainerWidgetH
2 #define DockContainerWidgetH
3 /*******************************************************************************
4 ** Qt Advanced Docking System
5 ** Copyright (C) 2017 Uwe Kindler
6 **
7 ** This library is free software; you can redistribute it and/or
8 ** modify it under the terms of the GNU Lesser General Public
9 ** License as published by the Free Software Foundation; either
10 ** version 2.1 of the License, or (at your option) any later version.
11 **
12 ** This library is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ** Lesser General Public License for more details.
16 **
17 ** You should have received a copy of the GNU Lesser General Public
18 ** License along with this library; If not, see <http://www.gnu.org/licenses/>.
19 ******************************************************************************/
20 
21 
22 //============================================================================
27 //============================================================================
28 
29 
30 //============================================================================
31 // INCLUDES
32 //============================================================================
33 #include <QFrame>
34 
35 #include "ads_globals.h"
36 #include "DockWidget.h"
37 
38 QT_FORWARD_DECLARE_CLASS(QXmlStreamWriter)
39 
40 
41 namespace ads
42 {
43 class DockContainerWidgetPrivate;
44 class CDockAreaWidget;
45 class CDockWidget;
46 class CDockManager;
47 struct DockManagerPrivate;
48 class CFloatingDockContainer;
49 struct FloatingDockContainerPrivate;
50 class CFloatingDragPreview;
51 struct FloatingDragPreviewPrivate;
52 class CDockingStateReader;
53 
61 class ADS_EXPORT CDockContainerWidget : public QFrame
62 {
63  Q_OBJECT
64 private:
67  friend class CDockManager;
68  friend struct DockManagerPrivate;
69  friend class CDockAreaWidget;
70  friend struct DockAreaWidgetPrivate;
71  friend class CFloatingDockContainer;
73  friend class CDockWidget;
74  friend class CFloatingDragPreview;
76 
77 public:
81  QSplitter* rootSplitter() const;
82 
83 protected:
87  virtual bool event(QEvent *e) override;
88 
89 
93  void createRootSplitter();
94 
98  void dropFloatingWidget(CFloatingDockContainer* FloatingWidget, const QPoint& TargetPos);
99 
107  void dropWidget(QWidget* Widget, DockWidgetArea DropArea, CDockAreaWidget* TargetAreaWidget);
108 
112  void addDockArea(CDockAreaWidget* DockAreaWidget, DockWidgetArea area = CenterDockWidgetArea);
113 
117  void removeDockArea(CDockAreaWidget* area);
118 
122  void saveState(QXmlStreamWriter& Stream) const;
123 
130  bool restoreState(CDockingStateReader& Stream, bool Testing);
131 
137  CDockAreaWidget* lastAddedDockAreaWidget(DockWidgetArea area) const;
138 
143  CDockWidget* topLevelDockWidget() const;
144 
148  CDockAreaWidget* topLevelDockArea() const;
149 
158  QList<CDockWidget*> dockWidgets() const;
159 
164  void updateSplitterHandles(QSplitter* splitter);
165 
166 public:
170  CDockContainerWidget(CDockManager* DockManager, QWidget* parent = 0);
171 
175  virtual ~CDockContainerWidget();
176 
184  CDockAreaWidget* addDockWidget(DockWidgetArea area, CDockWidget* Dockwidget,
185  CDockAreaWidget* DockAreaWidget = nullptr);
186 
190  void removeDockWidget(CDockWidget* Dockwidget);
191 
195  virtual unsigned int zOrderIndex() const;
196 
201  bool isInFrontOf(CDockContainerWidget* Other) const;
202 
207  CDockAreaWidget* dockAreaAt(const QPoint& GlobalPos) const;
208 
213  CDockAreaWidget* dockArea(int Index) const;
214 
219  QList<CDockAreaWidget*> openedDockAreas() const;
220 
227  bool hasTopLevelDockWidget() const;
228 
232  int dockAreaCount() const;
233 
237  int visibleDockAreaCount() const;
238 
242  bool isFloating() const;
243 
247  void dumpLayout();
248 
256  CDockWidget::DockWidgetFeatures features() const;
257 
263  CFloatingDockContainer* floatingWidget() const;
264 
268  void closeOtherAreas(CDockAreaWidget* KeepOpenArea);
269 
270 signals:
276  void dockAreasAdded();
277 
281  void dockAreasRemoved();
282 
287  void dockAreaViewToggled(ads::CDockAreaWidget* DockArea, bool Open);
288 }; // class DockContainerWidget
289 } // namespace ads
290 //-----------------------------------------------------------------------------
291 #endif // DockContainerWidgetH
DockWidgetArea
Definition: ads_globals.h:73
Declaration of.
#define ADS_EXPORT
Definition: ads_globals.h:50
Declaration of CDockWidget class.
DockContainerWidgetPrivate * d
private data (pimpl)


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:47:34