Elaztek Developer Hub
Blamite Game Engine - Keystone  00386.06.16.23.0646.blamite
A library that enables the use of Qt in Blamite's editing tools.
BlamEditorDocument Class Reference

Interface class that any types of editor documents inherit from. More...

#include <BlamEditorDocument.h>

+ Inheritance diagram for BlamEditorDocument:
+ Collaboration diagram for BlamEditorDocument:

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 ()
 Called immediately before closing a document. More...
 
virtual void FlagAsModified ()
 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 ()
 
virtual void OnUnfocused ()
 

Public Attributes

BlamEditorWindowparent_window = nullptr
 The parent window that owns this document. More...
 
std::string document_title = "document"
 The title of this document. More...
 
BlamEditorDocumentWidgetui = 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ BlamEditorDocument()

BlamEditorDocument::BlamEditorDocument ( BlamEditorWindow _window,
BlamEditorDocumentType  doctype 
)

Constructs a new BlamEditorDocument.

Parameters
_window- The parent window that owns this document.
doctype- The document type.

Member Function Documentation

◆ Close() [1/2]

bool BlamEditorDocument::Close ( )
virtual

Closes the document and releases any resources being used by it.

Returns
true if the document was closed, false if the close was cancelled.

Reimplemented in BlamEditorDocument_Tag, BlamEditorDocument_GameWindow, and BlamEditorDocument_TagDesigner.

+ Here is the caller graph for this function:

◆ Close() [2/2]

bool BlamEditorDocument::Close ( bool  force_close)
virtual

Closes the document and releases any resources being used by it.

Parameters
force_close- If set to true, then all close confirmations are skipped.
Returns
true if the document was closed, false if the close was cancelled.
+ Here is the call graph for this function:

◆ ConfirmClose()

virtual bool BlamEditorDocument::ConfirmClose ( )
inlinevirtual

Called immediately before closing a document.

This should be used to show a confirmation dialog where needed.

Returns
true if the document should continue closing. If closing should be aborted, this should return false.

Reimplemented in BlamEditorDocument_Tag.

+ Here is the caller graph for this function:

◆ FlagAsModified()

virtual void BlamEditorDocument::FlagAsModified ( )
inlinevirtual

Flags the document as being modified.

+ Here is the caller graph for this function:

◆ GetDocumentType()

BlamEditorDocumentType BlamEditorDocument::GetDocumentType ( )

Retrieves the type of this document.

Returns
The document type for the document.
+ Here is the caller graph for this function:

◆ OnFocused()

virtual void BlamEditorDocument::OnFocused ( )
inlinevirtual

◆ OnThemeChange()

virtual void BlamEditorDocument::OnThemeChange ( BlamEditorTheme new_theme)
inlinevirtual

Called when the active theme is changed.

Parameters
new_theme- The newly applied theme.

◆ OnUnfocused()

virtual void BlamEditorDocument::OnUnfocused ( )
inlinevirtual

◆ Save()

virtual void BlamEditorDocument::Save ( )
inlinevirtual

Attempts to save the document, replacing the original file.

Reimplemented in BlamEditorDocument_Tag.

◆ SaveAs()

virtual void BlamEditorDocument::SaveAs ( )
inlinevirtual

Attempts to save the document, prompting the user to save as a new file.

Reimplemented in BlamEditorDocument_Tag.

◆ Show()

void BlamEditorDocument::Show ( )

Shows the document within the parent window.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateDefaultIcon()

void BlamEditorDocument::UpdateDefaultIcon ( )

Updates the document's icon.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ custom_icon_group

std::string BlamEditorDocument::custom_icon_group = ""

The resource group containing the custom icon name. Only used when override_icon is true.

◆ custom_icon_id

std::string BlamEditorDocument::custom_icon_id = ""

The resource ID of the custom icon. Only used when override_icon is true.

◆ document_context

std::string BlamEditorDocument::document_context = ""

The context of this document. Will generally be a project or tag folder.

◆ document_title

std::string BlamEditorDocument::document_title = "document"

The title of this document.

◆ file_path

std::string BlamEditorDocument::file_path = ""

The path to the file associated with this document.

◆ loaded

bool BlamEditorDocument::loaded = true

Whether or not the document was able to be successfully loaded.

◆ modified

bool BlamEditorDocument::modified = false

Whether or not the document has been modified.

◆ override_icon

bool BlamEditorDocument::override_icon = false

Whether or not this document uses a custom icon other than the application default.

◆ parent_window

BlamEditorWindow* BlamEditorDocument::parent_window = nullptr

The parent window that owns this document.

◆ ui

BlamEditorDocumentWidget* BlamEditorDocument::ui = nullptr

The GUI widget associated with this document.


The documentation for this class was generated from the following files: