31 lines
695 B
C++
31 lines
695 B
C++
|
|
#ifndef COCKPITMANAGER_H
|
||
|
|
#define COCKPITMANAGER_H
|
||
|
|
|
||
|
|
#include <QObject>
|
||
|
|
#include <QHash>
|
||
|
|
#include "ICockpitPlugin.h"
|
||
|
|
|
||
|
|
class CockpitManager : public QObject
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
public:
|
||
|
|
explicit CockpitManager(QObject *parent = nullptr);
|
||
|
|
|
||
|
|
void registerCockpit(ICockpitPlugin *plugin);
|
||
|
|
void setCurrentCockpit(const QString &name);
|
||
|
|
ICockpitPlugin *currentCockpit() const { return m_current; }
|
||
|
|
ICockpitPlugin *cockpit(const QString &name) const;
|
||
|
|
QStringList cockpitNames() const;
|
||
|
|
|
||
|
|
QWidget *currentWidget() const;
|
||
|
|
|
||
|
|
signals:
|
||
|
|
void cockpitChanged(const QString &name);
|
||
|
|
|
||
|
|
private:
|
||
|
|
QHash<QString, ICockpitPlugin*> m_cockpits;
|
||
|
|
ICockpitPlugin *m_current = nullptr;
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif
|