11class Plugin :
public QObject
16class Interface :
public QObject
23 , m_interface(interface)
32class PluginInterfacesModel :
public QAbstractListModel
37 void append(Interface *interface);
38 bool contains(
const QString &
id);
39 int rowCount(
const QModelIndex &
parent)
const override;
40 QVariant data(
const QModelIndex &
index,
int role)
const override;
41 QHash<int, QByteArray> roleNames()
const override;
44 QVector<Interface *> m_interfaces;
47class PluginsModel :
public MauiList
53 void append(Plugin *plugin);
56 FMH::MODEL_LIST m_plugins;
60class PluginInterface : public
QObject
63 Q_PROPERTY(
int orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
64 Q_PROPERTY(
int type READ type WRITE setType NOTIFY typeChanged)
68 static PluginInterface *qmlAttachedProperties(
QObject *
object)
70 return new PluginInterface(
object);
72 void setOrientation(
const uint &value);
73 uint orintation()
const
78 void setType(
const uint &value);
98 void orientationChanged();
100 void targetChanged();
103class PluginManager :
public QObject
106 Q_PROPERTY(PluginsModel *plugins READ plugins FINAL CONSTANT)
107 Q_PROPERTY(PluginInterfacesModel *interfaces READ interfaces FINAL CONSTANT)
109 static PluginManager *instance()
111 static PluginManager manager;
115 PluginManager(
const PluginManager &) =
delete;
116 PluginManager &operator=(
const PluginManager &) =
delete;
117 PluginManager(PluginManager &&) =
delete;
118 PluginManager &operator=(PluginManager &&) =
delete;
120 void registerInterface(QObject *interface,
const QString &
id);
121 PluginsModel *plugins()
const
125 PluginInterfacesModel *interfaces()
const
131 PluginManager(QObject *parent =
nullptr);
133 PluginsModel *m_plugins;
134 PluginInterfacesModel *m_interfaces;
137 void interfacesChanged();
void setTarget(const SkyPoint &targetCoord)
Type type(const QSqlDatabase &db)
QVector< MODEL > MODEL_LIST
An alias for a container of multiple FMH::MODEL key-value pairs.
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const=0
virtual QModelIndex parent(const QModelIndex &index) const const=0
QObject * parent() const const