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 | |
17 | namespace Attica |
18 | { |
19 | |
20 | /*! |
21 | * \class Attica::DownloadDescription |
22 | * \inheaderfile Attica/DownloadDescription |
23 | * \inmodule Attica |
24 | * |
25 | * \brief Represents a download description. |
26 | */ |
27 | class ATTICA_EXPORT DownloadDescription |
28 | { |
29 | public: |
30 | /*! |
31 | * \value FileDownload |
32 | * \value LinkDownload |
33 | * \value PackageDownload |
34 | */ |
35 | enum Type { |
36 | FileDownload = 0, |
37 | LinkDownload, |
38 | PackageDownload, |
39 | }; |
40 | |
41 | /*! |
42 | * |
43 | */ |
44 | DownloadDescription(); |
45 | DownloadDescription(const DownloadDescription &other); |
46 | |
47 | DownloadDescription &operator=(const DownloadDescription &other); |
48 | ~DownloadDescription(); |
49 | |
50 | /*! |
51 | The id of the description - as one Content can have multiple download descriptions associated. |
52 | This will simply be 1, 2, ... |
53 | */ |
54 | int id() const; |
55 | |
56 | /*! |
57 | * |
58 | */ |
59 | Attica::DownloadDescription::Type type() const; |
60 | |
61 | /*! |
62 | * |
63 | */ |
64 | bool hasPrice() const; |
65 | |
66 | /*! |
67 | * |
68 | */ |
69 | QString category() const; |
70 | |
71 | /*! |
72 | * |
73 | */ |
74 | QString name() const; |
75 | |
76 | /*! |
77 | * |
78 | */ |
79 | QString link() const; |
80 | |
81 | /*! |
82 | * |
83 | */ |
84 | QString distributionType() const; |
85 | |
86 | /*! |
87 | * |
88 | */ |
89 | QString priceReason() const; |
90 | |
91 | /*! |
92 | * |
93 | */ |
94 | QString priceAmount() const; |
95 | |
96 | /*! |
97 | * |
98 | */ |
99 | uint size() const; |
100 | |
101 | /*! |
102 | * |
103 | */ |
104 | QString gpgFingerprint() const; |
105 | |
106 | /*! |
107 | * |
108 | */ |
109 | QString gpgSignature() const; |
110 | |
111 | /*! |
112 | * |
113 | */ |
114 | QString packageName() const; |
115 | |
116 | /*! |
117 | * |
118 | */ |
119 | QString repository() const; |
120 | |
121 | /*! |
122 | * Get the list of tags for this download description |
123 | * \since 5.50 |
124 | */ |
125 | QStringList tags() const; |
126 | |
127 | /*! |
128 | * |
129 | */ |
130 | void setId(int id); |
131 | |
132 | /*! |
133 | * |
134 | */ |
135 | void setType(Attica::DownloadDescription::Type type); |
136 | |
137 | /*! |
138 | * |
139 | */ |
140 | void setHasPrice(bool hasPrice); |
141 | |
142 | /*! |
143 | * |
144 | */ |
145 | void setCategory(const QString &category); |
146 | |
147 | /*! |
148 | * |
149 | */ |
150 | void setName(const QString &name); |
151 | |
152 | /*! |
153 | * |
154 | */ |
155 | void setLink(const QString &link); |
156 | |
157 | /*! |
158 | * |
159 | */ |
160 | void setDistributionType(const QString &distributionType); |
161 | |
162 | /*! |
163 | * |
164 | */ |
165 | void setPriceReason(const QString &priceReason); |
166 | |
167 | /*! |
168 | * |
169 | */ |
170 | void setPriceAmount(const QString &priceAmount); |
171 | |
172 | /*! |
173 | * |
174 | */ |
175 | void setSize(uint size); |
176 | |
177 | /*! |
178 | * |
179 | */ |
180 | void setGpgFingerprint(const QString &fingerprint); |
181 | |
182 | /*! |
183 | * |
184 | */ |
185 | void setGpgSignature(const QString &signature); |
186 | |
187 | /*! |
188 | * |
189 | */ |
190 | void setPackageName(const QString &packageName); |
191 | |
192 | /*! |
193 | * |
194 | */ |
195 | void setRepository(const QString &repository); |
196 | |
197 | /*! |
198 | * Set the list of tags for this download description |
199 | * \since 5.50 |
200 | */ |
201 | void setTags(const QStringList &tags); |
202 | |
203 | /*! |
204 | * The download version as set on the remote. May be QString() when not set. |
205 | * \since 6.5 |
206 | */ |
207 | [[nodiscard]] QString version() const; |
208 | |
209 | /*! |
210 | * \since 6.5 |
211 | */ |
212 | void setVersion(const QString &version); |
213 | |
214 | private: |
215 | class Private; |
216 | QSharedDataPointer<Private> d; |
217 | }; |
218 | |
219 | } |
220 | |
221 | #endif // DOWNLOADDESCRIPTION_H |
222 | |