Attica

downloaddescription.h
1 /*
2  This file is part of KDE.
3 
4  SPDX-FileCopyrightText: 2009 Frederik Gladhorn <[email protected]>
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 DownloadDescription downloaddescription.h <Attica/DownloadDescription>
22  *
23  * Represents a download description.
24  */
25 class ATTICA_EXPORT DownloadDescription
26 {
27 public:
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 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
46  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
47  int id();
48 #endif
49 
50 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
51  ATTICA_DEPRECATED_VERSION(0, 2, "Use DownloadDescription::type()")
52  Attica::DownloadDescription::Type type();
53 #endif
54  Attica::DownloadDescription::Type type() const;
55 #if ATTICA_ENABLE_DEPRECATED_SINCE(0, 2)
56  ATTICA_DEPRECATED_VERSION(0, 2, "Use DownloadDescription::type()")
57  bool isDownloadtypLink();
58 #endif
59 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
60  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
61  bool hasPrice();
62 #endif
63  bool hasPrice() const;
64 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
65  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
66  QString category();
67 #endif
68  QString category() const;
69 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
70  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
71  QString name();
72 #endif
73  QString name() const;
74 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
75  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
76  QString link();
77 #endif
78  QString link() const;
79 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
80  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
81  QString distributionType();
82 #endif
83  QString distributionType() const;
84 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
85  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
86  QString priceReason();
87 #endif
88  QString priceReason() const;
89 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
90  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
91  QString priceAmount();
92 #endif
93  QString priceAmount() const;
94 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
95  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
96  uint size();
97 #endif
98  uint size() const;
99 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
100  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
101  QString gpgFingerprint();
102 #endif
103  QString gpgFingerprint() const;
104 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
105  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
106  QString gpgSignature();
107 #endif
108  QString gpgSignature() const;
109 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
110  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
111  QString packageName();
112 #endif
113  QString packageName() const;
114 #if ATTICA_ENABLE_DEPRECATED_SINCE(5, 4)
115  ATTICA_DEPRECATED_VERSION(5, 4, "Use const overload")
116  QString repository();
117 #endif
118  QString repository() const;
119  /**
120  * Get the list of tags for this download description
121  * @since 5.50
122  */
123  QStringList tags() const;
124 
125  void setId(int id);
126  void setType(Attica::DownloadDescription::Type type);
127 #if ATTICA_ENABLE_DEPRECATED_SINCE(0, 2)
128  ATTICA_DEPRECATED_VERSION(0, 2, "Use DownloadDescription::setType(Attica::DownloadDescription::Type)")
129  void setDownloadtypLink(bool isLink);
130 #endif
131  void setHasPrice(bool hasPrice);
132  void setCategory(const QString &category);
133  void setName(const QString &name);
134  void setLink(const QString &link);
135  void setDistributionType(const QString &distributionType);
136  void setPriceReason(const QString &priceReason);
137  void setPriceAmount(const QString &priceAmount);
138  void setSize(uint size);
139  void setGpgFingerprint(const QString &fingerprint);
140  void setGpgSignature(const QString &signature);
141  void setPackageName(const QString &packageName);
142  void setRepository(const QString &repository);
143  /**
144  * Set the list of tags for this download description
145  * @since 5.50
146  */
147  void setTags(const QStringList &tags);
148 
149 private:
150  class Private;
152 };
153 
154 }
155 
156 #endif // DOWNLOADDESCRIPTION_H
The Attica namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Dec 11 2023 04:05:13 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.