Attica 5.109.0
content.h
1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2008 Cornelius Schumacher <schumacher@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 ATTICA_CONTENT_H
10#define ATTICA_CONTENT_H
11
12#include <QList>
13#include <QMap>
14#include <QSharedDataPointer>
15#include <QString>
16#include <QUrl>
17
18#include "attica_export.h"
19#include "downloaddescription.h"
20#include "homepageentry.h"
21#include "icon.h"
22
23class QDateTime;
24
25namespace Attica
26{
32class ATTICA_EXPORT Content
33{
34public:
35 typedef QList<Content> List;
36 class Parser;
37
42
47 Content(const Content &other);
48
54 Content &operator=(const Content &other);
55
60
66 void setId(const QString &id);
67
73 QString id() const;
74
79 void setName(const QString &name);
80
85 QString name() const;
86
91 void setRating(int rating);
92
97 int rating() const;
98
103 void setDownloads(int downloads);
104
109 int downloads() const;
110
115 void setNumberOfComments(int numComments);
116
121 int numberOfComments() const;
122
127 void setCreated(const QDateTime &created);
128
133 QDateTime created() const;
134
139 void setUpdated(const QDateTime &updated);
140
145 QDateTime updated() const;
146
150 QString summary() const;
151
155 QString description() const;
156
160 QUrl detailpage() const;
161
162 QString changelog() const;
163 QString version() const;
164 QString depend() const;
165
171
176 QList<DownloadDescription> downloadUrlDescriptions() const;
177
182 HomePageEntry homePageEntry(int number) const;
183
188 QList<HomePageEntry> homePageEntries();
189
190 QString previewPicture(const QString &number = QStringLiteral("1")) const;
191 QString smallPreviewPicture(const QString &number = QStringLiteral("1")) const;
192 QString license() const;
193 QString licenseName() const;
194 QString author() const;
195
199 QList<Icon> icons();
200
204 QList<Icon> icons() const;
205
210 void setIcons(QList<Icon> icons);
211
215 QList<QUrl> videos();
220 void setVideos(QList<QUrl> videos);
221
226 QStringList tags() const;
232 void setTags(const QStringList &tags);
233
240 void addAttribute(const QString &key, const QString &value);
241
247 QString attribute(const QString &key) const;
248
253 QMap<QString, QString> attributes() const;
254
259 bool isValid() const;
260
261private:
262 class Private;
263 QSharedDataPointer<Private> d;
264};
265
266}
267
268#endif
Represents a single content.
Definition content.h:33
QStringList tags() const
Get all the tags for this content.
QString id() const
Gets the id of the Content.
void setIcons(QList< Icon > icons)
Set list of icons.
QMap< QString, QString > attributes() const
Get all attributes that are not included in the basis set of attributes exposed by the Content class.
QList< Icon > icons() const
Get all icons for this content.
void setVideos(QList< QUrl > videos)
Set list of videos.
QDateTime created() const
Gets the date and time the Content has been created.
QString description() const
A description of this content.
int numberOfComments() const
Gets the number of comments for the Content.
QList< Icon > icons()
Get all icons for this content.
HomePageEntry homePageEntry(int number) const
Get the details about a home page (a content can have multiple home pages, blog, bugs,...
QList< QUrl > videos()
Get all videos for this content.
QDateTime updated() const
Gets the date and time the Content has been last updated.
bool isValid() const
Checks whether this Content has an id.
void setDownloads(int downloads)
Sets the number of downloads for the Content.
QList< HomePageEntry > homePageEntries()
Get all home pages for this content.
QUrl detailpage() const
A webpage with the detailed description of this content.
Content()
Creates an empty Content.
DownloadDescription downloadUrlDescription(int number) const
Get the details about a download (a content can have multiple links, eg for different distros).
void setCreated(const QDateTime &created)
Sets the date and time the Content has been created.
void setId(const QString &id)
Sets the id of the Content.
Content(const Content &other)
Copy constructor.
int downloads() const
Gets the number of downloads for the Content (how often this has been downloaded from the server).
void setTags(const QStringList &tags)
Set the list of tags.
QString attribute(const QString &key) const
Get an attribute that is not included in the basis set of attributes exposed by the Content class.
QString summary() const
A summary description of this content.
void setUpdated(const QDateTime &updated)
Sets the time the Content has been last updated.
void addAttribute(const QString &key, const QString &value)
Add an attribute that is not included in the basis set of attributes exposed by the Content class.
~Content()
Destructor.
void setRating(int rating)
Sets the rating of the Content.
Content & operator=(const Content &other)
Assignment operator.
QList< DownloadDescription > downloadUrlDescriptions() const
Get all possible downloads.
void setName(const QString &name)
Sets the name of the Content.
void setNumberOfComments(int numComments)
Sets the number of comments for the Content.
int rating() const
Gets the rating of the Content.
QString name() const
Gets the name of the Content.
Represents a download description.
Definition downloaddescription.h:26
The HomePageEntry class contains information about one home page entry.
Definition homepageentry.h:27
The Attica namespace,.
Definition activity.h:21