3#include <Foundation/Communication/Event.h>
4#include <Foundation/Logging/Log.h>
5#include <Foundation/Strings/String.h>
6#include <Foundation/Threading/Implementation/TaskSystemDeclarations.h>
7#include <Foundation/Types/Status.h>
8#include <Foundation/Types/UniquePtr.h>
9#include <ToolsFoundation/CommandHistory/CommandHistory.h>
10#include <ToolsFoundation/Document/Implementation/Declarations.h>
11#include <ToolsFoundation/Object/ObjectMetaData.h>
12#include <ToolsFoundation/Selection/SelectionManager.h>
13#include <ToolsFoundation/ToolsFoundationDLL.h>
32 enum ModifiedFlags :
unsigned int
34 HiddenFlag = PL_BIT(0),
35 PrefabFlag = PL_BIT(1),
49enum class plManipulatorSearchStrategy
53 ChildrenOfSelectedObject
67 bool IsModified()
const {
return m_bModified; }
68 bool IsReadOnly()
const {
return m_bReadOnly; }
69 const plUuid GetGuid()
const {
return m_pDocumentInfo ? m_pDocumentInfo->m_DocumentID :
plUuid(); }
73 plSelectionManager* GetSelectionManager()
const {
return m_pSelectionManager.Borrow(); }
74 plCommandHistory* GetCommandHistory()
const {
return m_pCommandHistory.Borrow(); }
89 plDocument* GetMainDocument() {
return m_pHostDocument; }
90 plDocument* GetActiveSubDocument() {
return m_pActiveSubDocument; }
106 plStatus SaveDocument(
bool bForce =
false);
108 plTaskGroupID SaveDocumentAsync(AfterSaveCallback callback,
bool bForce =
false);
115 plStatus LoadDocument() {
return InternalLoadDocument(); }
118 void EnsureVisible();
122 bool HasWindowBeenRequested()
const {
return m_bWindowRequested; }
129 if (m_pTypeDescriptor ==
nullptr)
132 return GetDynamicRTTI()->GetTypeName();
135 return m_pTypeDescriptor->m_sDocumentTypeName;
138 const plDocumentInfo* GetDocumentInfo()
const {
return m_pDocumentInfo; }
153 PL_DECLARE_POD_TYPE();
157 plInt32 m_Index = -1;
194 virtual void DeleteSelectedObjects()
const;
196 const plSet<plString>& GetUnknownObjectTypes()
const {
return m_UnknownObjectTypes; }
197 plUInt32 GetUnknownObjectTypeInstances()
const {
return m_uiUnknownObjectTypeInstances; }
225 virtual void UpdatePrefabs();
252 void SetModified(
bool b);
253 void SetReadOnly(
bool b);
254 virtual plTaskGroupID InternalSaveDocument(AfterSaveCallback callback);
255 virtual plStatus InternalLoadDocument();
264 virtual void InitializeAfterLoading(
bool bFirstTimeCreation) {}
265 virtual void InitializeAfterLoadingAndSaving() {}
267 virtual void BeforeClosing();
269 void SetUnknownObjectTypes(
const plSet<plString>& Types, plUInt32 uiInstances);
300 bool m_bWindowRequested;
301 bool m_bAddToRecentFilesList;
304 plUInt32 m_uiUnknownObjectTypeInstances;
Definition AbstractObjectGraph.h:115
Definition AbstractObjectGraph.h:17
Definition DocumentTasks.h:25
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Stores the undo / redo stacks of transactions done on a document.
Definition CommandHistory.h:52
bool GetAddToRecentFilesList() const
Whether this document shall be put into the recent files list.
Definition Document.h:203
virtual void OnInterDocumentMessage(plReflectedClass *pMessage, plDocument *pSender)
Called on all documents when BroadcastInterDocumentMessage() is called.
Definition Document.h:179
virtual plManipulatorSearchStrategy GetManipulatorSearchStrategy() const
Needed by plManipulatorManager to know where to look for the manipulator attributes.
Definition Document.h:215
virtual void InternalAfterSaveDocument()
A hook to execute additional code after SUCCESSFULLY saving a document. E.g. manual asset transform c...
Definition Document.h:259
const plDocument * GetActiveSubDocument() const
At any given time, only the active sub-document can be edited. This returns the active sub-document w...
Definition Document.h:88
bool IsMainDocument() const
Returns whether this document is a main document, i.e. self contained.
Definition Document.h:82
virtual plEditorInputContext * GetEditorInputContextOverride()
Allows to return a single input context that currently overrides all others (in priority).
Definition Document.h:188
virtual bool CopySelectedObjects(plAbstractObjectGraph &out_objectGraph, plStringBuilder &out_sMimeType) const
Creates the abstract graph of data to be copied and returns the mime type for the clipboard to identi...
Definition Document.h:163
virtual void GetSupportedMimeTypesForPasting(plHybridArray< plString, 4 > &out_mimeTypes) const
Whether this document supports pasting the given mime format into it.
Definition Document.h:161
bool IsSubDocument() const
Returns whether this document is a sub-document, i.e. is part of another document.
Definition Document.h:84
const plDocument * GetMainDocument() const
In case this is a sub-document, returns the main document this belongs to. Otherwise 'this' is return...
Definition Document.h:86
virtual bool ArePrefabsAllowed() const
Whether the document allows to create prefabs in it. This may note be allowed for prefab documents th...
Definition Document.h:222
plStringView GetDocumentTypeName() const
Returns the document's type name. Same as GetDocumentTypeDescriptor()->m_sDocumentTypeName.
Definition Document.h:127
void SetAddToResetFilesList(bool b)
If disabled, this document will not be put into the recent files list.
Definition Document.h:200
plStringView GetDocumentPath() const
Returns the absolute path to the document.
Definition Document.h:102
virtual bool CanEngineProcessBeRestarted() const
Asks the document whether a restart of the engine process is allowed at this time.
Definition Document.h:145
plUniquePtr< plObjectCommandAccessor > m_pObjectAccessor
Default object accessor used by every doc.
Definition Document.h:282
Definition Declarations.h:72
Definition DocumentManager.h:8
Definition DocumentObjectBase.h:11
Represents to content of a document. Every document has exactly one root object under which all objec...
Definition DocumentObjectManager.h:116
Definition DynamicArray.h:81
Definition EditorInputContext.h:22
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Definition ObjectAccessorBase.h:8
Definition ObjectCommandAccessor.h:9
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
Definition DocumentTasks.h:10
Selection Manager stores a set of selected document objects.
Definition SelectionManager.h:26
plStringBuilder is a class that is meant for creating and modifying strings.
Definition StringBuilder.h:35
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
Given out by plTaskSystem::CreateTaskGroup to identify a task group.
Definition TaskSystemDeclarations.h:103
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
This data type is the abstraction for 128-bit Uuid (also known as GUID) instances.
Definition Uuid.h:11
A generic delegate class which supports static functions and member functions.
Definition Delegate.h:76
Definition Document.h:152
Definition Declarations.h:35
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
An plResult with an additional message for the reason of failure.
Definition Status.h:12