19 #ifndef INDICATORS_MANAGER_H 20 #define INDICATORS_MANAGER_H 22 #include "indicator.h" 23 #include "unityindicatorsglobal.h" 24 #include "../Platform/platform.h" 27 #include <QFileSystemWatcher> 30 #include <QSharedPointer> 32 class UNITYINDICATORS_EXPORT IndicatorsManager :
public QObject
35 Q_PROPERTY(
bool loaded READ isLoaded NOTIFY loadedChanged)
36 Q_PROPERTY(QString profile READ profile WRITE setProfile NOTIFY profileChanged)
38 explicit IndicatorsManager(QObject* parent =
nullptr);
41 Q_INVOKABLE
void load();
42 Q_INVOKABLE
void unload();
44 QString profile()
const;
45 void setProfile(
const QString& profile);
47 Indicator::Ptr indicator(
const QString& indicator_name);
49 QVector<Indicator::Ptr> indicators();
51 bool isLoaded()
const;
54 void loadedChanged(
bool);
55 void profileChanged(
const QString&);
57 void indicatorLoaded(
const QString& indicator_name);
58 void indicatorAboutToBeUnloaded(
const QString& indicator_name);
61 void onDirectoryChanged(
const QString& directory);
62 void onFileChanged(
const QString& file);
65 void loadDir(
const QDir& dir);
66 void loadFile(
const QFileInfo& file);
67 void unloadFile(
const QFileInfo& dir);
69 void startVerify(
const QString& path);
70 void endVerify(
const QString& path);
75 QHash<QString, IndicatorData*> m_indicatorsData;
76 QSharedPointer<QFileSystemWatcher> m_fsWatcher;
83 #endif // INDICATORS_MANAGER_H