2023-01-23 14:03:55 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 flowln <flowlnlnln@gmail.com>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
2022-11-25 12:23:46 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-06-23 17:13:52 +01:00
|
|
|
#include <memory>
|
2022-11-25 12:23:46 +00:00
|
|
|
#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-06-23 17:13:52 +01:00
|
|
|
Task::Ptr getProject(QString addonId, std::shared_ptr<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;
|
|
|
|
};
|