1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2009 Frederik Gladhorn <gladhorn@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7*/
8
9#ifndef DOWNLOADDESCRIPTION_H
10#define DOWNLOADDESCRIPTION_H
11
12#include <QSharedData>
13#include <QString>
14
15#include "attica_export.h"
16
17namespace Attica
18{
19
20/**
21 * @class DownloadDescription downloaddescription.h <Attica/DownloadDescription>
22 *
23 * Represents a download description.
24 */
25class ATTICA_EXPORT DownloadDescription
26{
27public:
28 enum Type {
29 FileDownload = 0,
30 LinkDownload,
31 PackageDownload,
32 };
33
34 DownloadDescription();
35 DownloadDescription(const DownloadDescription &other);
36
37 DownloadDescription &operator=(const DownloadDescription &other);
38 ~DownloadDescription();
39
40 /**
41 The id of the description - as one Content can have multiple download descriptions associated.
42 This will simply be 1, 2, ...
43 */
44 int id() const;
45
46 Attica::DownloadDescription::Type type() const;
47 bool hasPrice() const;
48 QString category() const;
49 QString name() const;
50 QString link() const;
51 QString distributionType() const;
52 QString priceReason() const;
53 QString priceAmount() const;
54 uint size() const;
55 QString gpgFingerprint() const;
56 QString gpgSignature() const;
57 QString packageName() const;
58 QString repository() const;
59 /**
60 * Get the list of tags for this download description
61 * @since 5.50
62 */
63 QStringList tags() const;
64
65 void setId(int id);
66 void setType(Attica::DownloadDescription::Type type);
67 void setHasPrice(bool hasPrice);
68 void setCategory(const QString &category);
69 void setName(const QString &name);
70 void setLink(const QString &link);
71 void setDistributionType(const QString &distributionType);
72 void setPriceReason(const QString &priceReason);
73 void setPriceAmount(const QString &priceAmount);
74 void setSize(uint size);
75 void setGpgFingerprint(const QString &fingerprint);
76 void setGpgSignature(const QString &signature);
77 void setPackageName(const QString &packageName);
78 void setRepository(const QString &repository);
79 /**
80 * Set the list of tags for this download description
81 * @since 5.50
82 */
83 void setTags(const QStringList &tags);
84
85private:
86 class Private;
87 QSharedDataPointer<Private> d;
88};
89
90}
91
92#endif // DOWNLOADDESCRIPTION_H
93

source code of attica/src/downloaddescription.h