Skip to content

Commit

Permalink
add virtual method onExtendedDocumentRestored DocumentObjectExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Oct 25, 2017
1 parent 3360573 commit 7d3af36
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/App/DocumentObject.cpp
Expand Up @@ -563,6 +563,14 @@ void DocumentObject::connectRelabelSignals()
}
}

void DocumentObject::onDocumentRestored()
{
//call all extensions
auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>();
for(auto ext : vector)
ext->onExtendedDocumentRestored();
}

void DocumentObject::onSettingDocument()
{
//call all extensions
Expand Down
2 changes: 1 addition & 1 deletion src/App/DocumentObject.h
Expand Up @@ -265,7 +265,7 @@ class AppExport DocumentObject: public App::TransactionalObject
/// get called by the container when a property was changed
virtual void onChanged(const Property* prop);
/// get called after a document has been fully restored
virtual void onDocumentRestored() {}
virtual void onDocumentRestored();
/// get called after setting the document
virtual void onSettingDocument();
/// get called after a brand new object was created
Expand Down
8 changes: 6 additions & 2 deletions src/App/DocumentObjectExtension.cpp
Expand Up @@ -51,12 +51,16 @@ short int DocumentObjectExtension::extensionMustExecute(void) {
}

App::DocumentObjectExecReturn* DocumentObjectExtension::extensionExecute(void) {

return App::DocumentObject::StdReturn;
}

void DocumentObjectExtension::onExtendedSettingDocument() {


}

void DocumentObjectExtension::onExtendedDocumentRestored() {

}

void DocumentObjectExtension::onExtendedSetupObject() {
Expand Down
2 changes: 2 additions & 0 deletions src/App/DocumentObjectExtension.h
Expand Up @@ -55,6 +55,8 @@ class AppExport DocumentObjectExtension : public App::Extension

/// get called after setting the document
virtual void onExtendedSettingDocument();
/// get called after a document has been fully restored
virtual void onExtendedDocumentRestored();
/// get called after a brand new object was created
virtual void onExtendedSetupObject();
/// get called when object is going to be removed from the document
Expand Down

0 comments on commit 7d3af36

Please sign in to comment.