![]() |
Blamite Game Engine - Keystone
00402.09.29.23.0627.blamite
A library that enables the use of Qt in Blamite's editing tools.
|
Interface class that any types of editor documents inherit from. More...
#include <BlamEditorDocument.h>
Public Member Functions | |
BlamEditorDocument (BlamEditorWindow *_window, BlamEditorDocumentType doctype) | |
Constructs a new BlamEditorDocument. More... | |
BlamEditorDocumentType | GetDocumentType () |
Retrieves the type of this document. More... | |
virtual void | OnThemeChange (BlamEditorTheme *new_theme) |
Called when the active theme is changed. More... | |
void | Show () |
Shows the document within the parent window. More... | |
void | UpdateDefaultIcon () |
Updates the document's icon. More... | |
virtual bool | ConfirmClose (std::string confirmation_message="") |
Called immediately before closing a document. More... | |
virtual void | FlagAsModified (bool new_modified_state=true) |
Flags the document as being modified. More... | |
virtual bool | Close () |
Closes the document and releases any resources being used by it. More... | |
virtual bool | Close (bool force_close) |
Closes the document and releases any resources being used by it. More... | |
virtual void | Save () |
Attempts to save the document, replacing the original file. More... | |
virtual void | SaveAs () |
Attempts to save the document, prompting the user to save as a new file. More... | |
virtual void | OnFocused () |
Called when the document is focused. More... | |
virtual void | OnUnfocused () |
Called when the document is unfocused. More... | |
Public Attributes | |
BlamEditorWindow * | parent_window = nullptr |
The parent window that owns this document. More... | |
std::string | document_title = "document" |
The title of this document. More... | |
BlamEditorDocumentWidget * | ui = nullptr |
The GUI widget associated with this document. More... | |
bool | loaded = true |
Whether or not the document was able to be successfully loaded. More... | |
bool | modified = false |
Whether or not the document has been modified. More... | |
bool | override_icon = false |
Whether or not this document uses a custom icon other than the application default. More... | |
std::string | custom_icon_group = "" |
The resource group containing the custom icon name. Only used when override_icon is true . More... | |
std::string | custom_icon_id = "" |
The resource ID of the custom icon. Only used when override_icon is true . More... | |
std::string | file_path = "" |
The path to the file associated with this document. More... | |
std::string | document_context = "" |
The context of this document. Will generally be a project or tag folder. More... | |
int | mdi_default_width = 700 |
The default starting width of the document's MDI window. More... | |
int | mdi_default_height = 700 |
The default starting height of the document's MDI window. More... | |
Interface class that any types of editor documents inherit from.
Currently, the primary purpose of this is to store a persistent list of all open tags, while allowing the functionality to be expanded later on as needed.
BlamEditorDocument::BlamEditorDocument | ( | BlamEditorWindow * | _window, |
BlamEditorDocumentType | doctype | ||
) |
Constructs a new BlamEditorDocument.
_window | - The parent window that owns this document. |
doctype | - The document type. |
|
virtual |
Closes the document and releases any resources being used by it.
true
if the document was closed, false
if the close was cancelled. Reimplemented in BlamEditorDocument_TagDesigner, BlamEditorDocument_Tag, and BlamEditorDocument_GameWindow.
|
virtual |
Closes the document and releases any resources being used by it.
force_close | - If set to true , then all close confirmations are skipped. |
true
if the document was closed, false
if the close was cancelled.
|
virtual |
Called immediately before closing a document.
This should be used to show a confirmation dialog where needed.
confirmation_message | - A custom confirmation message. If left blank, then a generic confirmation message is used instead. Usually not required for documents which use their own close confirmation method. |
true
if the document should continue closing. If closing should be aborted, this should return false
. Reimplemented in BlamEditorDocument_TagDesigner, and BlamEditorDocument_Tag.
|
virtual |
Flags the document as being modified.
new_modified_state | - The new document modification state. If set to false , the document will behave as though it has not been modified. Defaults to true . |
Reimplemented in BlamEditorDocument_Tag.
BlamEditorDocumentType BlamEditorDocument::GetDocumentType | ( | ) |
Retrieves the type of this document.
|
inlinevirtual |
Called when the document is focused.
|
inlinevirtual |
Called when the active theme is changed.
new_theme | - The newly applied theme. |
|
inlinevirtual |
Called when the document is unfocused.
|
inlinevirtual |
Attempts to save the document, replacing the original file.
Reimplemented in BlamEditorDocument_TagDesigner, and BlamEditorDocument_Tag.
|
inlinevirtual |
Attempts to save the document, prompting the user to save as a new file.
Reimplemented in BlamEditorDocument_TagDesigner, and BlamEditorDocument_Tag.
void BlamEditorDocument::Show | ( | ) |
Shows the document within the parent window.
void BlamEditorDocument::UpdateDefaultIcon | ( | ) |
Updates the document's icon.
std::string BlamEditorDocument::custom_icon_group = "" |
The resource group containing the custom icon name. Only used when override_icon is true
.
std::string BlamEditorDocument::custom_icon_id = "" |
The resource ID of the custom icon. Only used when override_icon is true
.
std::string BlamEditorDocument::document_context = "" |
The context of this document. Will generally be a project or tag folder.
std::string BlamEditorDocument::document_title = "document" |
The title of this document.
std::string BlamEditorDocument::file_path = "" |
The path to the file associated with this document.
bool BlamEditorDocument::loaded = true |
Whether or not the document was able to be successfully loaded.
int BlamEditorDocument::mdi_default_height = 700 |
The default starting height of the document's MDI window.
int BlamEditorDocument::mdi_default_width = 700 |
The default starting width of the document's MDI window.
bool BlamEditorDocument::modified = false |
Whether or not the document has been modified.
bool BlamEditorDocument::override_icon = false |
Whether or not this document uses a custom icon other than the application default.
BlamEditorWindow* BlamEditorDocument::parent_window = nullptr |
The parent window that owns this document.
BlamEditorDocumentWidget* BlamEditorDocument::ui = nullptr |
The GUI widget associated with this document.