2023-01-23 19:33:55 +05:30
|
|
|
// SPDX-FileCopyrightText: 2023 flowln <flowlnlnln@gmail.com>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
2022-11-25 17:53:46 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "modplatform/ResourceAPI.h"
|
|
|
|
|
|
|
|
class NetworkResourceAPI : public ResourceAPI {
|
|
|
|
public:
|
2023-01-03 22:28:27 +05:30
|
|
|
Task::Ptr searchProjects(SearchArgs&&, SearchCallbacks&&) const override;
|
2022-11-25 17:53:46 +05:30
|
|
|
|
2023-01-03 22:28:27 +05:30
|
|
|
Task::Ptr getProject(QString addonId, QByteArray* response) const override;
|
2022-11-25 17:53:46 +05:30
|
|
|
|
2023-01-03 22:28:27 +05:30
|
|
|
Task::Ptr getProjectInfo(ProjectInfoArgs&&, ProjectInfoCallbacks&&) const override;
|
|
|
|
Task::Ptr getProjectVersions(VersionSearchArgs&&, VersionSearchCallbacks&&) const override;
|
2022-11-25 17:53:46 +05:30
|
|
|
|
|
|
|
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;
|
|
|
|
};
|