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.
BlamEditorDocument.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <qwidget.h>
4 #include <string>
5 
7 
8 #ifndef KEYSTONE
9 #define KEYSTONE
10 #endif
11 
12 class BlamEditorWindow;
14 
22 {
23  Tag,
25 };
26 
34 {
35 private:
40 
41 public:
42 
44 
45  std::string document_title = "document";
47  bool loaded = true;
48 
56 
63 
69  virtual void OnThemeChange(BlamEditorTheme* new_theme) {};
70 
74  void Show();
75 
79  virtual void Close() {};
80 
84  virtual void Save() {};
85 
89  virtual void SaveAs() {};
90 };
91 
97 class BlamEditorDocumentWidget : public QWidget
98 {
99 public:
101 
102  BlamEditorDocumentWidget(QWidget* parent = nullptr) : QWidget(parent) {}
103 };
BlamEditorDocument::GetDocumentType
BlamEditorDocumentType GetDocumentType()
Retrieves the type of this document.
Definition: BlamEditorDocument.cpp:13
BlamEditorDocument::parent_window
BlamEditorWindow * parent_window
The parent window that owns this document.
Definition: BlamEditorDocument.h:43
BlamEditorDocumentWidget::document
BlamEditorDocument * document
The document associated with this widget.
Definition: BlamEditorDocument.h:100
BlamEditorDocumentType
BlamEditorDocumentType
Enumerator containing all possible editor document types.
Definition: BlamEditorDocument.h:21
BlamEditorDocument::document_title
std::string document_title
The title of this document.
Definition: BlamEditorDocument.h:45
BlamEditorDocument::Close
virtual void Close()
Closes the document and releases any resources being used by it.
Definition: BlamEditorDocument.h:79
themes.h
BlamEditorTheme
Class representing a Blamite Editor Theme.
Definition: themes.h:47
BlamEditorDocument::BlamEditorDocument
BlamEditorDocument(BlamEditorWindow *_window, BlamEditorDocumentType doctype)
Constructs a new BlamEditorDocument.
Definition: BlamEditorDocument.cpp:7
BlamEditorDocumentWidget::BlamEditorDocumentWidget
BlamEditorDocumentWidget(QWidget *parent=nullptr)
Definition: BlamEditorDocument.h:102
BlamEditorDocumentType::Tag
@ Tag
Indicates the document represents a tag file.
BlamEditorDocument::SaveAs
virtual void SaveAs()
Attempts to save the document, prompting the user to save as a new file.
Definition: BlamEditorDocument.h:89
BlamEditorDocumentWidget
Class acting as a simple interface to allow for easy retrieval of the active document.
Definition: BlamEditorDocument.h:97
BlamEditorDocument::Save
virtual void Save()
Attempts to save the document, replacing the original file.
Definition: BlamEditorDocument.h:84
BlamEditorDocument
Interface class that any types of editor documents inherit from.
Definition: BlamEditorDocument.h:33
BlamEditorDocument::OnThemeChange
virtual void OnThemeChange(BlamEditorTheme *new_theme)
Called when the active theme is changed.
Definition: BlamEditorDocument.h:69
BlamEditorDocument::Show
void Show()
Shows the document within the parent window.
Definition: BlamEditorDocument.cpp:18
BlamEditorDocument::loaded
bool loaded
Whether or not the document was able to be successfully loaded.
Definition: BlamEditorDocument.h:47
BlamEditorWindow
Interface class that all main editing tool windows inherit from.
Definition: BlamEditorWindow.h:47
BlamEditorDocumentType::Unspecified
@ Unspecified
Indicates the document type is unspecified or invalid.
BlamEditorWindowType::Unspecified
@ Unspecified
Indicates that the editor window type is unknown. This should never happen.
BlamEditorDocument::ui
BlamEditorDocumentWidget * ui
The GUI widget associated with this document.
Definition: BlamEditorDocument.h:46