21 #ifndef INDICATORSMODEL_H
22 #define INDICATORSMODEL_H
24 #include "indicator.h"
25 #include "unityindicatorsglobal.h"
27 #include <QAbstractListModel>
30 class IndicatorsManager;
32 class UNITYINDICATORS_EXPORT IndicatorsModel :
public QAbstractListModel
36 Q_PROPERTY(
int count READ count NOTIFY countChanged)
40 IndicatorsModel(QObject *parent=0);
43 Q_INVOKABLE
void load(const QString& profile);
44 Q_INVOKABLE
void unload();
46 Q_INVOKABLE QVariant data(
int row,
int role) const;
49 QHash<
int, QByteArray> roleNames() const;
50 int columnCount(const QModelIndex &parent = QModelIndex()) const;
51 QVariant data(const QModelIndex &index,
int role = Qt::DisplayRole) const;
52 QModelIndex parent (const QModelIndex &index) const;
53 int rowCount(const QModelIndex &parent = QModelIndex()) const;
58 void indicatorDataChanged(const QVariant& data);
61 void onIdentifierChanged();
62 void onIndicatorPropertiesChanged();
63 void onIndicatorLoaded(const QString& indicator);
64 void onIndicatorAboutToBeUnloaded(const QString& indicator);
67 IndicatorsManager *m_manager;
69 QList<Indicator::Ptr> m_indicators;
71 void notifyDataChanged(QObject *sender,
int role);
75 #endif // INDICATORSMODEL_H