DockAreaWidget.h
Go to the documentation of this file.
1 #ifndef DockAreaWidgetH
2 #define DockAreaWidgetH
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 QT_FORWARD_DECLARE_CLASS(QAbstractButton)
40 
41 namespace ads
42 {
43 struct DockAreaWidgetPrivate;
44 class CDockManager;
45 class CDockContainerWidget;
46 class DockContainerWidgetPrivate;
47 class CDockAreaTitleBar;
48 
49 
55 class ADS_EXPORT CDockAreaWidget : public QFrame
56 {
57  Q_OBJECT
58 private:
60  friend struct DockAreaWidgetPrivate;
61  friend class CDockContainerWidget;
63  friend class CDockWidgetTab;
64  friend struct DockWidgetPrivate;
65  friend class CDockWidget;
66  friend struct DockManagerPrivate;
67  friend class CDockManager;
68  void onDockWidgetFeaturesChanged();
69 
70 private slots:
71  void onTabCloseRequested(int Index);
72 
77  void reorderDockWidget(int fromIndex, int toIndex);
78 
79 protected:
87  void insertDockWidget(int index, CDockWidget* DockWidget, bool Activate = true);
88 
93  void addDockWidget(CDockWidget* DockWidget);
94 
98  void removeDockWidget(CDockWidget* DockWidget);
99 
103  void toggleDockWidgetView(CDockWidget* DockWidget, bool Open);
104 
111  CDockWidget* nextOpenDockWidget(CDockWidget* DockWidget) const;
112 
116  int index(CDockWidget* DockWidget);
117 
122  void hideAreaWithNoVisibleContent();
123 
127  void updateTitleBarVisibility();
128 
134  void internalSetCurrentDockWidget(CDockWidget* DockWidget);
135 
139  void markTitleBarMenuOutdated();
140 
141 protected slots:
142  void toggleView(bool Open);
143 
144 public:
145  using Super = QFrame;
146 
151  {
152  HideSingleWidgetTitleBar = 0x0001,
153  DefaultFlags = 0x0000
154  };
155  Q_DECLARE_FLAGS(DockAreaFlags, eDockAreaFlag)
156 
157 
160  CDockAreaWidget(CDockManager* DockManager, CDockContainerWidget* parent);
161 
165  virtual ~CDockAreaWidget();
166 
170  CDockManager* dockManager() const;
171 
176  CDockContainerWidget* dockContainer() const;
177 
183  virtual QSize minimumSizeHint() const override;
184 
188  QRect titleBarGeometry() const;
189 
193  QRect contentAreaGeometry() const;
194 
198  int dockWidgetsCount() const;
199 
204  QList<CDockWidget*> dockWidgets() const;
205 
209  int openDockWidgetsCount() const;
210 
214  QList<CDockWidget*> openedDockWidgets() const;
215 
219  CDockWidget* dockWidget(int Index) const;
220 
225  int currentIndex() const;
226 
236  int indexOfFirstOpenDockWidget() const;
237 
242  CDockWidget* currentDockWidget() const;
243 
247  void setCurrentDockWidget(CDockWidget* DockWidget);
248 
252  void saveState(QXmlStreamWriter& Stream) const;
253 
263  CDockWidget::DockWidgetFeatures features(eBitwiseOperator Mode = BitwiseAnd) const;
264 
269  QAbstractButton* titleBarButton(TitleBarButton which) const;
270 
274  virtual void setVisible(bool Visible) override;
275 
279  void setAllowedAreas(DockWidgetAreas areas);
280 
284  DockWidgetAreas allowedAreas() const;
285 
289  CDockAreaTitleBar* titleBar() const;
290 
296  DockAreaFlags dockAreaFlags() const;
297 
302  void setDockAreaFlags(DockAreaFlags Flags);
303 
308  void setDockAreaFlag(eDockAreaFlag Flag, bool On);
309 
313  bool isCentralWidgetArea() const;
314 
315 public slots:
321  void setCurrentIndex(int index);
322 
326  void closeArea();
327 
331  void closeOtherAreas();
332 
333 signals:
337  void tabBarClicked(int index);
338 
344  void currentChanging(int index);
345 
351  void currentChanged(int index);
352 
357  void viewToggled(bool Open);
358 }; // class DockAreaWidget
359 }
360  // namespace ads
361 //-----------------------------------------------------------------------------
362 #endif // DockAreaWidgetH
TitleBarButton
Definition: ads_globals.h:89
Declaration of.
#define ADS_EXPORT
Definition: ads_globals.h:50
eBitwiseOperator
Definition: ads_globals.h:123
Declaration of CDockWidget class.
DockAreaWidgetPrivate * d
private data (pimpl)
#define override
Definition: backward.hpp:387


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