OpenLexocad  27.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 #include <OpenLxApp/Globals.h>
9 
10 namespace OpenLxApp
11 {
12 class Document;
13 class DocumentObserver;
14 
16  public App::Document::ObserverType,
17  public Gui::Selection::ObserverType,
18  public Gui::PickedPoint::ObserverType
19 {
20 public:
21  friend class DocumentObserver;
22 
23  DocumentObserverImpl(std::shared_ptr<DocumentObserver> aParent, Document* aDoc);
25 
27  void onChange(Gui::Selection::SubjectType* rCaller, Gui::Selection::MessageType Reason);
28  void onChange(App::Document::SubjectType* rCaller, App::Document::MessageType Reason);
29  void onChange(Gui::PickedPoint::SubjectType* rCaller, Gui::PickedPoint::MessageType Reason);
30 
31 private:
33  Core::CoreApplication* _theApp = nullptr;
34  Core::CoreDocument* _theDoc = nullptr;
35  Gui::Selection* _theSelection = nullptr;
36  Gui::PickedPoint* _thePickedPoint = nullptr;
37  std::shared_ptr<DocumentObserver> _parent;
38  Document* _openlxDoc;
39 };
40 
41 } // namespace OpenLxApp
Definition: CoreApplication.h:94
Observer< Core::AppChanges > ObserverType
Definition: Observer.h:112
Definition: CoreApplication.h:38
Definition: CoreDocument.h:197
Document holding all persistent DocObjects.
Definition: Document.h:62
Definition: ActiveScript.h:9
void onChange(Core::CoreApplication::SubjectType *rCaller, Core::CoreApplication::MessageType Reason)
Definition: DocumentObserverImpl.h:15
DocumentObserver observes the Document. This class has to be overridden to get messages from the obse...
Definition: DocumentObserver.h:41