OpenLexocad  28.0
DocumentObserverImpl.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <App/Document.h>
4 #include <Core/CoreApplication.h>
5 #include <Gui/PickedPoint.h>
6 #include <Gui/Selection.h>
7 
8 namespace OpenLxApp
9 {
10 class Document;
11 class DocumentObserver;
12 
14  public App::Document::ObserverType,
15  public Gui::Selection::ObserverType,
16  public Gui::PickedPoint::ObserverType
17 {
18 public:
19  friend class DocumentObserver;
20 
21  DocumentObserverImpl(std::shared_ptr<DocumentObserver> aParent, Document* aDoc);
23 
25  void onChange(Gui::Selection::SubjectType* rCaller, Gui::Selection::MessageType Reason);
26  void onChange(App::Document::SubjectType* rCaller, App::Document::MessageType Reason);
27  void onChange(Gui::PickedPoint::SubjectType* rCaller, Gui::PickedPoint::MessageType Reason);
28  virtual const char* name(void) override { return "DocumentObserverImpl"; }
29 private:
31  Core::CoreApplication* _theApp = nullptr;
32  Core::CoreDocument* _theDoc = nullptr;
33  Gui::Selection* _theSelection = nullptr;
34  Gui::PickedPoint* _thePickedPoint = nullptr;
35  std::shared_ptr<DocumentObserver> _parent;
36  Document* _openlxDoc;
37 };
38 
39 } // namespace OpenLxApp
OpenLxApp
Definition: ActiveScript.h:10
Core::CoreDocument
Definition: CoreDocument.h:269
OpenLxApp::DocumentObserverImpl::DocumentObserverImpl
DocumentObserverImpl(std::shared_ptr< DocumentObserver > aParent, Document *aDoc)
OpenLxApp::DocumentObserverImpl::onChange
void onChange(Gui::PickedPoint::SubjectType *rCaller, Gui::PickedPoint::MessageType Reason)
OpenLxApp::DocumentObserver
DocumentObserver observes the Document. This class has to be overridden to get messages from the obse...
Definition: DocumentObserver.h:45
Base::Subject< Core::AppChanges >::ObserverType
Observer< Core::AppChanges > ObserverType
Definition: Observer.h:114
OpenLxApp::DocumentObserverImpl::~DocumentObserverImpl
~DocumentObserverImpl()
OpenLxApp::DocumentObserverImpl::onChange
void onChange(App::Document::SubjectType *rCaller, App::Document::MessageType Reason)
Core::AppChanges
Definition: CoreApplication.h:28
OpenLxApp::Document
Document holding all persistent DocObjects.
Definition: Document.h:62
OpenLxApp::DocumentObserverImpl::onChange
void onChange(Core::CoreApplication::SubjectType *rCaller, Core::CoreApplication::MessageType Reason)
Core::CoreApplication
Definition: CoreApplication.h:71
OpenLxApp::DocumentObserverImpl::name
virtual const char * name(void) override
Definition: DocumentObserverImpl.h:28
OpenLxApp::DocumentObserverImpl::onChange
void onChange(Gui::Selection::SubjectType *rCaller, Gui::Selection::MessageType Reason)
Base::Subject< Core::AppChanges >
CoreApplication.h
OpenLxApp::DocumentObserverImpl
Definition: DocumentObserverImpl.h:17
Document.h