2022-11-25 12:23:46 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "modplatform/ResourceAPI.h"
|
|
|
|
|
|
|
|
class NetworkResourceAPI : public ResourceAPI {
|
|
|
|
public:
|
2023-01-03 16:58:27 +00:00
|
|
|
Task::Ptr searchProjects(SearchArgs&&, SearchCallbacks&&) const override;
|
2022-11-25 12:23:46 +00:00
|
|
|
|
2023-01-03 16:58:27 +00:00
|
|
|
Task::Ptr getProject(QString addonId, QByteArray* response) const override;
|
2022-11-25 12:23:46 +00:00
|
|
|
|
2023-01-03 16:58:27 +00:00
|
|
|
Task::Ptr getProjectInfo(ProjectInfoArgs&&, ProjectInfoCallbacks&&) const override;
|
|
|
|
Task::Ptr getProjectVersions(VersionSearchArgs&&, VersionSearchCallbacks&&) const override;
|
2022-11-25 12:23:46 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
[[nodiscard]] virtual auto getSearchURL(SearchArgs const& args) const -> std::optional<QString> = 0;
|
|
|
|
[[nodiscard]] virtual auto getInfoURL(QString const& id) const -> std::optional<QString> = 0;
|
|
|
|
[[nodiscard]] virtual auto getVersionsURL(VersionSearchArgs const& args) const -> std::optional<QString> = 0;
|
|
|
|
};
|