diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-10-11 21:17:34 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-10-11 21:17:34 +0200 |
| commit | 3932371cd12ae7ec0812fbb2db3315448e18f1a8 (patch) | |
| tree | 9751fce7edd8d6042f3f78bdfecedea520338b83 /src/modlistproxy.h | |
| parent | 0363b73adb75714c94a7a7cea2840a9c40ee006e (diff) | |
Use proxy for ModList, PluginList and DownloadManager. Do not use registered callbacks when plugin is inactive.
Diffstat (limited to 'src/modlistproxy.h')
| -rw-r--r-- | src/modlistproxy.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/modlistproxy.h b/src/modlistproxy.h new file mode 100644 index 00000000..13399e0a --- /dev/null +++ b/src/modlistproxy.h @@ -0,0 +1,32 @@ +#ifndef MODLISTPROXY_H +#define MODLISTPROXY_H + +#include <imodlist.h> + +class OrganizerProxy; + +class ModListProxy : public MOBase::IModList +{ + +public: + + ModListProxy(OrganizerProxy* oproxy, IModList* modlist); + virtual ~ModListProxy() { } + + QString displayName(const QString& internalName) const override; + QStringList allMods() const override; + ModStates state(const QString& name) const override; + bool setActive(const QString& name, bool active) override; + int setActive(const QStringList& names, bool active) override; + int priority(const QString& name) const override; + bool setPriority(const QString& name, int newPriority) override; + bool onModStateChanged(const std::function<void(const std::map<QString, ModStates>&)>& func) override; + bool onModMoved(const std::function<void(const QString&, int, int)>& func) override; + +private: + + OrganizerProxy* m_OrganizerProxy; + IModList* m_Proxied; +}; + +#endif // ORGANIZERPROXY_H |
