The DocumentObserver class simplfies the step to write classes that listen to what happens inside a document. More...
#include <DocumentObserver.h>
Public Member Functions | |
void | attachDocument (Document *) |
Attaches to another document, the old document is not longer observed then. | |
void | detachDocument () |
Detaches from the current document, the document is not longer observed then. | |
DocumentObserver (Document *) | |
DocumentObserver () | |
Constructor. | |
virtual | ~DocumentObserver () |
Protected Member Functions | |
Document * | getDocument () const |
The DocumentObserver class simplfies the step to write classes that listen to what happens inside a document.
This is very useful for classes that needs to be notified when an observed object has changed.
Definition at line 44 of file DocumentObserver.h.
DocumentObserver::DocumentObserver | ( | ) |
Constructor.
Definition at line 39 of file DocumentObserver.cpp.
References draftlibs::fcgeo::bind(), App::GetApplication(), App::Application::signalDeleteDocument, and App::Application::signalNewDocument.
DocumentObserver::DocumentObserver | ( | Document * | doc | ) |
Definition at line 47 of file DocumentObserver.cpp.
References attachDocument(), draftlibs::fcgeo::bind(), App::GetApplication(), App::Application::signalDeleteDocument, and App::Application::signalNewDocument.
DocumentObserver::~DocumentObserver | ( | ) | [virtual] |
Definition at line 57 of file DocumentObserver.cpp.
References detachDocument().
void DocumentObserver::attachDocument | ( | Document * | doc | ) |
Attaches to another document, the old document is not longer observed then.
Definition at line 70 of file DocumentObserver.cpp.
References draftlibs::fcgeo::bind(), detachDocument(), App::Document::signalChangedObject, App::Document::signalDeletedObject, and App::Document::signalNewObject.
Referenced by MeshGui::ViewProviderMeshCurvature::attach(), DocumentObserver(), MeshGui::DlgEvaluateMeshImp::on_refreshButton_clicked(), and MeshGui::DlgEvaluateMeshImp::setMesh().
void DocumentObserver::detachDocument | ( | ) |
Detaches from the current document, the document is not longer observed then.
Definition at line 85 of file DocumentObserver.cpp.
Referenced by attachDocument(), and ~DocumentObserver().
Document * DocumentObserver::getDocument | ( | void | ) | const [protected] |
Definition at line 65 of file DocumentObserver.cpp.
Referenced by Sandbox::DocumentProtector::addObject(), MeshGui::DlgEvaluateMeshImp::on_meshNameButton_activated(), MeshGui::DlgEvaluateMeshImp::on_refreshButton_clicked(), Sandbox::DocumentProtector::recompute(), MeshGui::DlgEvaluateMeshImp::refreshList(), Sandbox::DocumentProtector::removeObject(), and MeshGui::DlgEvaluateMeshImp::setMesh().