File indexing completed on 2024-11-24 04:54:53

0001 /*
0002  *   SPDX-FileCopyrightText: 2013 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
0003  *
0004  *   SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 #pragma once
0008 
0009 #include <resources/AbstractResource.h>
0010 
0011 class AddonList;
0012 class DummyResource : public AbstractResource
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit DummyResource(QString name, AbstractResource::Type type, AbstractResourcesBackend *parent);
0017 
0018     QList<PackageState> addonsInformation() override;
0019     QString section() override;
0020     QString origin() const override;
0021     QString longDescription() override;
0022     QString availableVersion() const override;
0023     QString installedVersion() const override;
0024     QJsonArray licenses() override;
0025     quint64 size() override;
0026     QUrl homepage() override;
0027     QUrl helpURL() override;
0028     QUrl bugURL() override;
0029     QUrl donationURL() override;
0030     QUrl contributeURL() override;
0031     QStringList categories() override;
0032     AbstractResource::State state() override;
0033     QVariant icon() const override;
0034     QString comment() override;
0035     QString name() const override;
0036     QString packageName() const override;
0037     AbstractResource::Type type() const override
0038     {
0039         return m_type;
0040     }
0041     bool canExecute() const override
0042     {
0043         return true;
0044     }
0045     void invokeApplication() const override;
0046     void fetchChangelog() override;
0047     void fetchScreenshots() override;
0048     QUrl url() const override;
0049     QString author() const override
0050     {
0051         return QStringLiteral("BananaPerson");
0052     }
0053     void setState(State state);
0054     void setSize(quint64 size)
0055     {
0056         m_size = size;
0057     }
0058     void setAddons(const AddonList &addons);
0059 
0060     void setAddonInstalled(const QString &addon, bool installed);
0061     QString sourceIcon() const override
0062     {
0063         return QStringLiteral("player-time");
0064     }
0065     QDate releaseDate() const override
0066     {
0067         return {};
0068     }
0069 
0070 public:
0071     const QString m_name;
0072     AbstractResource::State m_state;
0073     Screenshots m_screenshots;
0074     QString m_iconName;
0075     QList<PackageState> m_addons;
0076     const AbstractResource::Type m_type;
0077     quint64 m_size;
0078 };