pollymc/launcher/modplatform/ModAPI.h
flow f714adf6d2
refactor: move NetJob away from ModModel to ModAPI
This is done so that 1. ModAPI behaves more like an actual API instead
of just a helper, and 2. Allows for more easily creating other mod
providers that may or may not use network tasks (foreshadowing lol)
2022-03-07 16:22:57 -03:00

31 lines
743 B
C++

#pragma once
#include <QJsonDocument>
#include <QString>
namespace ModPlatform {
class ListModel;
}
class ModAPI {
protected:
using CallerType = ModPlatform::ListModel;
public:
virtual ~ModAPI() = default;
// https://docs.curseforge.com/?http#tocS_ModLoaderType
enum ModLoaderType { Any = 0, Forge = 1, Cauldron = 2, LiteLoader = 3, Fabric = 4 };
struct SearchArgs {
int offset;
QString search;
QString sorting;
ModLoaderType mod_loader;
QString version;
};
inline virtual void searchMods(CallerType* caller, SearchArgs&& args) const {};
inline virtual void getVersions(CallerType* caller, const QString& addonId, const QString& debugName = "") const {};
};