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
|
|
|
|
|
|
|
|
#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;
|
2023-04-14 16:59:31 +01:00
|
|
|
Task::Ptr getDependencyVersion(DependencySearchArgs&&, DependencySearchCallbacks&&) 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;
|
2023-04-21 16:41:40 +01:00
|
|
|
[[nodiscard]] virtual auto getDependencyURL(DependencySearchArgs const& args) const -> std::optional<QString> = 0;
|
2022-11-25 12:23:46 +00:00
|
|
|
};
|