Elaztek Developer Hub
Blamite Game Engine - Keystone  00326.06.27.21.0407.blamite
A library that enables the use of Qt in Blamite's editing tools.
BlamEditorWindow.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 #include <HEKGuerilla/components/tags/tags.h>
6 #include <qmainwindow.h>
7 
12 
13 #ifndef KEYSTONE
14 #define KEYSTONE
15 #endif
16 
21 {
22  MDI,
23  Tabs
24 };
25 
33 {
34  Tool,
35  Sapien,
36  Guerilla,
37  Foundry,
39 };
40 
47 class BlamEditorWindow : public QMainWindow
48 {
49 private:
50 
55 
56 public:
57 
59 
61  QTabWidget* tab_area = nullptr;
62 
63  std::vector<BlamEditorToolWindow*> open_tool_windows = std::vector<BlamEditorToolWindow*>();
64  std::vector<BlamEditorDocument*> open_documents = std::vector<BlamEditorDocument*>();
65 
72 
76  void SetupWindow();
77 
84 
90  virtual void OnThemeChange(BlamEditorTheme* new_theme);
91 
98  bool OpenDocument(std::string file_path, BlamTagTreeNode* tree_node, BlamEditorDocumentType doctype);
99 
105  void OpenDocument(BlamEditorDocument* document);
106 
112  void CloseDocument(int index);
113 
119  void CloseDocument(BlamEditorDocument* document);
120 
124  void SaveAllDocuments();
125 
135  bool OpenToolWindow(BlamEditorToolWindowType tool_type, Qt::DockWidgetArea position);
136 
146 
153 
161 
170 
175 };
BlamEditorWindow::GetActiveDocument
BlamEditorDocument * GetActiveDocument()
Get the current active document.
Definition: BlamEditorWindow.cpp:210
SkinnableMdiArea.h
BlamEditorWindowType::Tool
@ Tool
The editor window is the GUI for Tool (see tool_gui_window).
BlamEditorWindowType
BlamEditorWindowType
Enumerator used to identify the type of the main editor window.
Definition: BlamEditorWindow.h:32
BlamWorkspaceLayoutType::Tabs
@ Tabs
Sub-windows will be organized using tabs, similar to more modern editing tools.
BlamEditorToolWindow.h
BlamEditorWindow::workspace_type
BlamWorkspaceLayoutType workspace_type
The layout type the window is currently using.
Definition: BlamEditorWindow.h:58
BlamEditorWindow::GetEditorWindowType
BlamEditorWindowType GetEditorWindowType()
Retrieves the type of the editor window.
Definition: BlamEditorWindow.cpp:34
BlamEditorWindowType::Sapien
@ Sapien
The editor window is the main window for Sapien (see sapien_main_window).
BlamEditorWindow::open_documents
std::vector< BlamEditorDocument * > open_documents
The list of open documents.
Definition: BlamEditorWindow.h:64
BlamEditorDocumentType
BlamEditorDocumentType
Enumerator containing all possible editor document types.
Definition: BlamEditorDocument.h:21
themes.h
BlamEditorWindow::SetupWindow
void SetupWindow()
Prepares the main window layout.
Definition: BlamEditorWindow.cpp:15
BlamEditorWindow::BlamEditorWindow
BlamEditorWindow(BlamEditorWindowType window_type)
Constructs a new editor window.
Definition: BlamEditorWindow.cpp:10
BlamEditorTheme
Class representing a Blamite Editor Theme.
Definition: themes.h:47
BlamEditorDocument.h
BlamEditorWindowType::Guerilla
@ Guerilla
The editor window is the main window for Guerilla (see guerilla_window).
SkinnableMdiArea
Wrapper class around a QMdiArea, made to simplify skinning.
Definition: SkinnableMdiArea.h:18
BlamWorkspaceLayoutType
BlamWorkspaceLayoutType
Enumerator used to specify the workspace layout method that an application should use.
Definition: BlamEditorWindow.h:20
BlamEditorToolWindowType
BlamEditorToolWindowType
Enumerator containing all possible editor tool window types.
Definition: BlamEditorToolWindow.h:21
BlamEditorWindow::CloseToolWindow
void CloseToolWindow(BlamEditorToolWindowType tool_type)
Closes the specified tool window.
Definition: BlamEditorWindow.cpp:172
BlamWorkspaceLayoutType::MDI
@ MDI
Sub-windows will be organized using MDI (Multiple Document Interface).
BlamEditorWindow::IsToolWindowOpen
bool IsToolWindowOpen(BlamEditorToolWindowType tool_type)
Checks if a given tool window type is open.
Definition: BlamEditorWindow.cpp:197
BlamEditorWindow::OpenToolWindow
bool OpenToolWindow(BlamEditorToolWindowType tool_type, Qt::DockWidgetArea position)
Opens the specified tool window within the main window.
Definition: BlamEditorWindow.cpp:136
BlamEditorWindow::open_tool_windows
std::vector< BlamEditorToolWindow * > open_tool_windows
The list of open tool windows.
Definition: BlamEditorWindow.h:63
BlamEditorWindow::OnThemeChange
virtual void OnThemeChange(BlamEditorTheme *new_theme)
Called when the active theme is changed.
Definition: BlamEditorWindow.cpp:39
BlamEditorDocument
Interface class that any types of editor documents inherit from.
Definition: BlamEditorDocument.h:33
BlamEditorWindow::tab_area
QTabWidget * tab_area
The tab widget used for documents. Only set when using Tab layout.
Definition: BlamEditorWindow.h:61
BlamEditorWindow::mdi_area
SkinnableMdiArea * mdi_area
The MDI area used for documents. Only set when using MDI layout.
Definition: BlamEditorWindow.h:60
BlamEditorWindow
Interface class that all main editing tool windows inherit from.
Definition: BlamEditorWindow.h:47
BlamEditorWindow::ToggleToolWindow
void ToggleToolWindow(BlamEditorToolWindowType tool_type)
Toggles the specified tool window.
Definition: BlamEditorWindow.cpp:185
BlamEditorWindow::SaveAllDocuments
void SaveAllDocuments()
Attempts to save all open documents.
Definition: BlamEditorWindow.cpp:128
BlamEditorWindow::OpenDocument
bool OpenDocument(std::string file_path, BlamTagTreeNode *tree_node, BlamEditorDocumentType doctype)
Attempts to open the specified document in the main window.
Definition: BlamEditorWindow.cpp:79
BlamEditorWindow::CloseDocument
void CloseDocument(int index)
Attempts to close the specified document.
Definition: BlamEditorWindow.cpp:115
BlamEditorWindowType::Foundry
@ Foundry
The editor window is the main window for Foundry (see foundry_main_window).
BlamEditorWindowType::Unspecified
@ Unspecified
Indicates that the editor window type is unknown. This should never happen.