summaryrefslogtreecommitdiff
path: root/src/pluginlistproxy.h
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2020-10-11 21:17:34 +0200
committerMikaël Capelle <capelle.mikael@gmail.com>2020-10-11 21:17:34 +0200
commit3932371cd12ae7ec0812fbb2db3315448e18f1a8 (patch)
tree9751fce7edd8d6042f3f78bdfecedea520338b83 /src/pluginlistproxy.h
parent0363b73adb75714c94a7a7cea2840a9c40ee006e (diff)
Use proxy for ModList, PluginList and DownloadManager. Do not use registered callbacks when plugin is inactive.
Diffstat (limited to 'src/pluginlistproxy.h')
-rw-r--r--src/pluginlistproxy.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/pluginlistproxy.h b/src/pluginlistproxy.h
new file mode 100644
index 00000000..e08406e3
--- /dev/null
+++ b/src/pluginlistproxy.h
@@ -0,0 +1,36 @@
+#ifndef PLUGINLISTPROXY_H
+#define PLUGINLISTPROXY_H
+
+#include <ipluginlist.h>
+
+class OrganizerProxy;
+
+class PluginListProxy : public MOBase::IPluginList
+{
+
+public:
+
+ PluginListProxy(OrganizerProxy* oproxy, IPluginList* pluginlist);
+ virtual ~PluginListProxy() { }
+
+ QStringList pluginNames() const override;
+ PluginStates state(const QString& name) const override;
+ void setState(const QString& name, PluginStates state) override;
+ int priority(const QString& name) const override;
+ bool setPriority(const QString& name, int newPriority) override;
+ int loadOrder(const QString& name) const override;
+ void setLoadOrder(const QStringList& pluginList) override;
+ bool isMaster(const QString& name) const override;
+ QStringList masters(const QString& name) const override;
+ QString origin(const QString& name) const override;
+ bool onRefreshed(const std::function<void()>& callback) override;
+ bool onPluginMoved(const std::function<void(const QString&, int, int)>& func) override;
+ bool onPluginStateChanged(const std::function<void(const std::map<QString, PluginStates>&)>& func) override;
+
+private:
+
+ OrganizerProxy* m_OrganizerProxy;
+ IPluginList* m_Proxied;
+};
+
+#endif // ORGANIZERPROXY_H