OpenLexocad  27.1
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
Definition: CoreApplication.h:94
Observer< Core::AppChanges > ObserverType
Definition: Observer.h:111
Definition: CoreApplication.h:38
Definition: CoreDocument.h:210
Document holding all persistent DocObjects.
Definition: Document.h:60
Definition: ActiveScript.h:7
virtual const char * name(void) override
Definition: DocumentObserverImpl.h:28
void onChange(Core::CoreApplication::SubjectType *rCaller, Core::CoreApplication::MessageType Reason)
Definition: DocumentObserverImpl.h:13
DocumentObserver observes the Document. This class has to be overridden to get messages from the obse...
Definition: DocumentObserver.h:40