2026-01-18 12:13:07 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
// SPDX-FileCopyrightText: 2024 A-La-Karte Contributors
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <QList>
|
|
|
|
|
#include <QObject>
|
2026-01-19 23:12:12 +00:00
|
|
|
#include <QStringList>
|
2026-01-18 12:13:07 +00:00
|
|
|
|
|
|
|
|
#include "game.h"
|
|
|
|
|
|
|
|
|
|
class PlatformImporter : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit PlatformImporter(QObject *parent = nullptr);
|
|
|
|
|
virtual ~PlatformImporter() = default;
|
|
|
|
|
|
|
|
|
|
virtual QString platformName() const = 0;
|
|
|
|
|
virtual QString platformId() const = 0;
|
|
|
|
|
virtual bool isAvailable() const = 0;
|
|
|
|
|
virtual QList<Game *> importGames() = 0;
|
|
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
|
void importProgress(int current, int total);
|
|
|
|
|
void importError(const QString &error);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
QString findExecutable(const QString &name) const;
|
|
|
|
|
bool directoryExists(const QString &path) const;
|
|
|
|
|
QString expandPath(const QString &path) const;
|
2026-01-19 23:12:12 +00:00
|
|
|
static bool hasGameCategory(const QStringList &categories);
|
2026-01-18 12:13:07 +00:00
|
|
|
};
|