Plasma Engine  2.0
Loading...
Searching...
No Matches
ContainerWindow.moc.h
1#pragma once
2
3#include <Foundation/Containers/DynamicArray.h>
4#include <Foundation/Containers/Map.h>
5#include <Foundation/Strings/String.h>
6#include <GuiFoundation/DocumentWindow/DocumentWindow.moc.h>
7#include <GuiFoundation/GuiFoundationDLL.h>
8#include <GuiFoundation/UIServices/UIServices.moc.h>
9#include <QMainWindow>
10#include <QSet>
11#include <ToolsFoundation/Project/ToolsProject.h>
12
14class plDocument;
17class QLabel;
18
19namespace ads
20{
21 class CDockManager;
22 class CFloatingDockContainer;
23 class CDockWidget;
24} // namespace ads
25
27class PL_GUIFOUNDATION_DLL plQtContainerWindow : public QMainWindow
28{
29 Q_OBJECT
30
31public:
35
36 static plQtContainerWindow* GetContainerWindow() { return s_pContainerWindow; }
37
38 void AddDocumentWindow(plQtDocumentWindow* pDocWindow);
39 void DocumentWindowRenamed(plQtDocumentWindow* pDocWindow);
40 void AddApplicationPanel(plQtApplicationPanel* pPanel);
41
42 ads::CDockManager* GetDockManager() { return m_pDockManager; }
43
44 static plResult EnsureVisibleAnyContainer(plDocument* pDocument);
45
46 void GetDocumentWindows(plHybridArray<plQtDocumentWindow*, 16>& ref_windows);
47
48 void SaveWindowLayout();
49 void SaveDocumentLayouts();
50 void RestoreWindowLayout();
51
52 void ScheduleRestoreWindowLayout();
53
54protected:
55 virtual bool eventFilter(QObject* obj, QEvent* e) override;
56
57private:
58 friend class plQtDocumentWindow;
59 friend class plQtApplicationPanel;
60
61 plResult EnsureVisible(plQtDocumentWindow* pDocWindow);
62 plResult EnsureVisible(plDocument* pDocument);
63 plResult EnsureVisible(plQtApplicationPanel* pPanel);
64
65 bool m_bWindowLayoutRestored;
66 plInt32 m_iWindowLayoutRestoreScheduled;
67
68private Q_SLOTS:
69 void SlotDocumentTabCloseRequested();
70 void SlotRestoreLayout();
71 void SlotTabsContextMenuRequested(const QPoint& pos);
72 void SlotUpdateWindowDecoration(void* pDocWindow);
73 void SlotFloatingWidgetOpened(ads::CFloatingDockContainer* FloatingWidget);
74 void SlotDockWidgetFloatingChanged(bool bFloating);
75
76private:
77 void UpdateWindowTitle();
78
79 void RemoveDocumentWindow(plQtDocumentWindow* pDocWindow);
80 void RemoveApplicationPanel(plQtApplicationPanel* pPanel);
81
82 void UpdateWindowDecoration(plQtDocumentWindow* pDocWindow);
83
84 void DocumentWindowEventHandler(const plQtDocumentWindowEvent& e);
85 void ProjectEventHandler(const plToolsProjectEvent& e);
86 void UIServicesEventHandler(const plQtUiServices::Event& e);
87
88 virtual void closeEvent(QCloseEvent* e) override;
89
90private:
91 ads::CDockManager* m_pDockManager = nullptr;
92 QLabel* m_pStatusBarLabel;
95
96 plDynamicArray<plQtApplicationPanel*> m_ApplicationPanels;
97 QSet<QString> m_DockNames;
98
99 static plQtContainerWindow* s_pContainerWindow;
100 static bool s_bForceClose;
101};
102
Definition Document.h:57
Definition DocumentManager.h:8
Definition DynamicArray.h:81
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Base class for all panels that are supposed to be application wide (not tied to some document).
Definition ApplicationPanel.moc.h:13
Container window that hosts documents and applications panels.
Definition ContainerWindow.moc.h:28
Base class for all document windows. Handles the most basic document window management.
Definition DocumentWindow.moc.h:34
Definition Declarations.h:35
Definition DocumentWindow.moc.h:19
Definition UIServices.moc.h:23
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
Definition ToolsProject.h:13