File indexing completed on 2024-04-14 03:49:31

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef DOWNLOADDESCRIPTION_H
0010 #define DOWNLOADDESCRIPTION_H
0011 
0012 #include <QSharedData>
0013 #include <QString>
0014 
0015 #include "attica_export.h"
0016 
0017 namespace Attica
0018 {
0019 
0020 /**
0021  * @class DownloadDescription downloaddescription.h <Attica/DownloadDescription>
0022  *
0023  * Represents a download description.
0024  */
0025 class ATTICA_EXPORT DownloadDescription
0026 {
0027 public:
0028     enum Type {
0029         FileDownload = 0,
0030         LinkDownload,
0031         PackageDownload,
0032     };
0033 
0034     DownloadDescription();
0035     DownloadDescription(const DownloadDescription &other);
0036 
0037     DownloadDescription &operator=(const DownloadDescription &other);
0038     ~DownloadDescription();
0039 
0040     /**
0041       The id of the description - as one Content can have multiple download descriptions associated.
0042       This will simply be 1, 2, ...
0043       */
0044     int id() const;
0045 
0046     Attica::DownloadDescription::Type type() const;
0047     bool hasPrice() const;
0048     QString category() const;
0049     QString name() const;
0050     QString link() const;
0051     QString distributionType() const;
0052     QString priceReason() const;
0053     QString priceAmount() const;
0054     uint size() const;
0055     QString gpgFingerprint() const;
0056     QString gpgSignature() const;
0057     QString packageName() const;
0058     QString repository() const;
0059     /**
0060      * Get the list of tags for this download description
0061      * @since 5.50
0062      */
0063     QStringList tags() const;
0064 
0065     void setId(int id);
0066     void setType(Attica::DownloadDescription::Type type);
0067     void setHasPrice(bool hasPrice);
0068     void setCategory(const QString &category);
0069     void setName(const QString &name);
0070     void setLink(const QString &link);
0071     void setDistributionType(const QString &distributionType);
0072     void setPriceReason(const QString &priceReason);
0073     void setPriceAmount(const QString &priceAmount);
0074     void setSize(uint size);
0075     void setGpgFingerprint(const QString &fingerprint);
0076     void setGpgSignature(const QString &signature);
0077     void setPackageName(const QString &packageName);
0078     void setRepository(const QString &repository);
0079     /**
0080      * Set the list of tags for this download description
0081      * @since 5.50
0082      */
0083     void setTags(const QStringList &tags);
0084 
0085 private:
0086     class Private;
0087     QSharedDataPointer<Private> d;
0088 };
0089 
0090 }
0091 
0092 #endif // DOWNLOADDESCRIPTION_H