OpenLexocad  27.0
UIApplication.h
Go to the documentation of this file.
1 // //
3 // LEXOCAD API //
4 // //
5 // ©2005-2016 Cadwork Informatik. All rights reserved. //
6 // //
7 // ONLY INCLUDE OTHER INTERFACES! //
8 // Lexocad provides API Classes for public use and //
9 // Implementation Classes for private use. //
10 // //
11 // - Do ONLY include and use the LEXOCAD API in this header. //
12 // - Do not change existing interfaces. //
13 // - Document your code! //
14 // //
15 // - All types from Base, Core, Geom, Topo are allowed here. //
16 // - In the Gui modules the use of Qt types is allowed. //
17 // //
19 
20 #pragma once
21 
22 #include <Gui/PropertyTree.h>
23 #include <OpenLxApp/Application.h>
24 #include <OpenLxApp/Document.h>
27 #include <OpenLxUI/UIDocument.h>
28 #include <OpenLxUI/UIElement.h>
30 
31 #include <QObject>
32 
37 namespace OpenLxUI
38 {
39 class UIApplicationP;
40 class UIApplicationCB;
41 
49 
50 #ifndef SWIG
51  : public QObject
52 #endif
53 
54 {
55  Q_OBJECT
56 
57 public:
58  OpenLxApp::Application* getApplication() const;
59  std::shared_ptr<OpenLxUI::UIDocument> getUIDocument(std::shared_ptr<OpenLxApp::Document> aDoc) const;
60 
61  static UIApplication* getInstance();
62 
63 #ifndef SWIG
64 signals:
65  // This signal is emitted when the UIProperties in the Modify Panel are about to be displayed.
66  void displayUIPropertiesSignal(Gui::PropertyTree*, std::shared_ptr<OpenLxUI::UIElement>);
67  // This signal is emitted when a UIProperty has been changed by the user.
68  void changedUIPropertySignal(Gui::PropertyTreeItem*, std::shared_ptr<OpenLxUI::UIElement>);
69 
70 private slots:
71 
72  void _onLexocadDisplayUIProperties(Gui::PropertyTree*, Core::DocObject*);
73  void _onLexocadChangedUIProperty(Gui::PropertyTreeItem*, Core::DocObject*);
74 
75 public:
76  void installCustomEventFilter(QObject* aFilterObj);
77  void removeCustomEventFilter(QObject* aFilterObj);
78 
79 
80 #endif
81 public:
82  ~UIApplication();
83 
84 public:
85  void processEvents();
86 
87  void addCallback(OpenLxUI::UIApplicationCB* aCB);
88  void addCallback(OpenLxUI::UIApplicationCB* aCB, OpenLxUI::UIElementFilter* aFilter);
89  void removeCallback(OpenLxUI::UIApplicationCB* aCB);
90  void removeCallbacks();
91 
92  // Testing
93  void testCB();
94  void onLexocadChangedUIProperty(Gui::PropertyTreeItem*, std::shared_ptr<OpenLxUI::UIElement>);
95 
96  UIApplication() = delete;
97 
98 private:
100  static UIApplication* instance;
101  std::shared_ptr<UIApplicationP> _pimpl;
102 };
103 
104 } // namespace OpenLxUI
Definition: UIApplicationCB.h:39
Definition: UIElementFilter.h:17
#define slots
Definition: PyExport.h:22
#define signals
Definition: pythonize.h:34
Definition: ActiveEdge.h:25
Definition: UIApplication.h:48
#define OPENLXUI_EXPORT
Definition: OpenLxUI_defines.h:12
The one and only Application.
Definition: Application.h:50
Definition: DocObject.h:28