Attica

downloaddescription.h
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
36
37 DownloadDescription &operator=(const DownloadDescription &other);
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
85 /**
86 * The download version as set on the remote. May be QString() when not set.
87 * @since 6.5
88 */
89 [[nodiscard]] QString version() const;
90
91 /**
92 * @since 6.5
93 */
94 void setVersion(const QString &version);
95
96private:
97 class Private;
99};
100
101}
102
103#endif // DOWNLOADDESCRIPTION_H
Represents a download description.
The Attica namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 13 2024 11:54:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.