Elaztek Developer Hub
Blamite Game Engine - Keystone  00338.10.02.21.0533.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 #include <Strings/components/settings/config/config.h>
6 
8 
9 #ifndef KEYSTONE
10 #define KEYSTONE
11 #endif
12 
13 class BlamEditorWindow;
15 
23 {
24  Tag,
26 };
27 
35 {
36 private:
41 
42 public:
43 
45 
46  std::string document_title = "document";
48  bool loaded = true;
49  bool modified = false;
50 
58 
65 
71  virtual void OnThemeChange(BlamEditorTheme* new_theme) {};
72 
76  void Show();
77 
81  virtual void Close() {};
82 
86  virtual void Save() {};
87 
91  virtual void SaveAs() {};
92 };
93 
99 class BlamEditorDocumentWidget : public QWidget
100 {
101 public:
103 
104  BlamEditorDocumentWidget(QWidget* parent = nullptr) : QWidget(parent) {}
105 };
106 
108 {
113 
118 
126  KEYSTONE BlamConfigurationFile* GetDocumentTypeConfiguration(BlamEditorDocumentType type);
127 
133  KEYSTONE std::map<BlamEditorDocumentType, BlamConfigurationFile*> GetDocumentTypeConfigurations();
134 }
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:44
BlamEditorDocumentWidget::document
BlamEditorDocument * document
The document associated with this widget.
Definition: BlamEditorDocument.h:102
BlamEditorDocumentType
BlamEditorDocumentType
Enumerator containing all possible editor document types.
Definition: BlamEditorDocument.h:22
BlamEditorDocument::document_title
std::string document_title
The title of this document.
Definition: BlamEditorDocument.h:46
BlamEditorDocument::Close
virtual void Close()
Closes the document and releases any resources being used by it.
Definition: BlamEditorDocument.h:81
themes.h
BlamKeystone::EditorData::UnloadDocumentConfigurations
KEYSTONE void UnloadDocumentConfigurations()
Unloads all document type configurations.
Definition: document_config.cpp:90
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:104
BlamEditorDocument::modified
bool modified
Whether or not the document has been modified.
Definition: BlamEditorDocument.h:49
BlamEditorDocumentType::Tag
@ Tag
Indicates the document represents a tag file.
BlamKeystone::EditorData::LoadDocumentConfigurations
KEYSTONE void LoadDocumentConfigurations()
Loads all document type configurations.
Definition: document_config.cpp:83
BlamEditorDocument::SaveAs
virtual void SaveAs()
Attempts to save the document, prompting the user to save as a new file.
Definition: BlamEditorDocument.h:91
BlamEditorDocumentWidget
Class acting as a simple interface to allow for easy retrieval of the active document.
Definition: BlamEditorDocument.h:99
BlamEditorDocument::Save
virtual void Save()
Attempts to save the document, replacing the original file.
Definition: BlamEditorDocument.h:86
BlamEditorDocument
Interface class that any types of editor documents inherit from.
Definition: BlamEditorDocument.h:34
BlamKeystone::EditorData::GetDocumentTypeConfigurations
KEYSTONE std::map< BlamEditorDocumentType, BlamConfigurationFile * > GetDocumentTypeConfigurations()
Retrieves the list of loaded document type configuration files.
Definition: document_config.cpp:116
BlamEditorDocument::OnThemeChange
virtual void OnThemeChange(BlamEditorTheme *new_theme)
Called when the active theme is changed.
Definition: BlamEditorDocument.h:71
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:48
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.
KEYSTONE
#define KEYSTONE
Definition: BlamEditorDocument.h:10
BlamKeystone::EditorData
Namespace contianing functions for accessing common editor data.
Definition: BlamEditorDocument.h:107
BlamEditorDocument::ui
BlamEditorDocumentWidget * ui
The GUI widget associated with this document.
Definition: BlamEditorDocument.h:47
BlamKeystone::EditorData::GetDocumentTypeConfiguration
KEYSTONE BlamConfigurationFile * GetDocumentTypeConfiguration(BlamEditorDocumentType type)
Attempts to locate the configuration file for the specified document type.
Definition: document_config.cpp:106