appcontext.h 701 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __APPCONTEXT_H__
  2. #define __APPCONTEXT_H__
  3. #include <QObject>
  4. #include "pluginmanager.h"
  5. #include "projectmanager.h"
  6. #include "network.h"
  7. #include "serialport.h"
  8. #include "httpserver.h"
  9. class AppContext : public QObject
  10. {
  11. Q_OBJECT
  12. explicit AppContext(QObject *parent = nullptr);
  13. ~AppContext();
  14. public:
  15. static AppContext &instance();
  16. PluginManager &pluginManager();
  17. ProjectManager &projectManager();
  18. Network &network();
  19. SerialPort &serialPort();
  20. HttpServer &httpServer();
  21. private:
  22. PluginManager m_pluginMgr;
  23. ProjectManager m_projectMgr;
  24. Network m_network;
  25. SerialPort m_serialPort;
  26. HttpServer m_httpServer;
  27. };
  28. #endif // APPCONTEXT_H