Attica::Content Class

class Attica::Content

Represents a single content. More...

Header: #include <Attica/Content>
CMake: find_package(KF6 REQUIRED COMPONENTS Attica)
target_link_libraries(mytarget PRIVATE KF6::Attica)

Public Types

Public Functions

Content()
void addAttribute(const QString &key, const QString &value)
QString attribute(const QString &key) const
QMap<QString, QString> attributes() const
QString author() const
QString changelog() const
QDateTime created() const
QString depend() const
QString description() const
QUrl detailpage() const
Attica::DownloadDescription downloadUrlDescription(int number) const
QList<Attica::DownloadDescription> downloadUrlDescriptions() const
int downloads() const
QList<Attica::HomePageEntry> homePageEntries()
Attica::HomePageEntry homePageEntry(int number) const
QList<Attica::Icon> icons()
QList<Attica::Icon> icons() const
QString id() const
bool isValid() const
QString license() const
QString licenseName() const
QString name() const
int numberOfComments() const
QString previewPicture(const QString &number = QStringLiteral("1")) const
int rating() const
void setCreated(const QDateTime &created)
void setDownloads(int downloads)
void setIcons(QList<Attica::Icon> icons)
void setId(const QString &id)
void setName(const QString &name)
void setNumberOfComments(int numComments)
void setRating(int rating)
(since 5.50) void setTags(const QStringList &tags)
void setUpdated(const QDateTime &updated)
void setVideos(QList<QUrl> videos)
QString smallPreviewPicture(const QString &number = QStringLiteral("1")) const
QString summary() const
(since 5.50) QStringList tags() const
QDateTime updated() const
QString version() const
QList<QUrl> videos()

Detailed Description

Member Type Documentation

Content::List

Member Function Documentation

Content::Content()

Creates an empty Content

void Content::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. If the attribute already exists it gets overwritten.

key the key of the attribute

value the value of the attribute

QString Content::attribute(const QString &key) const

Get an attribute that is not included in the basis set of attributes exposed by the Content class.

key the key of the attribute

Returns the value of the attribute with the specified key, or an empty string, if the key has not been found

QMap<QString, QString> Content::attributes() const

Get all attributes that are not included in the basis set of attributes exposed by the Content class.

QString Content::author() const

QString Content::changelog() const

QDateTime Content::created() const

Returns the date and time the Content has been created.

See also setCreated().

QString Content::depend() const

QString Content::description() const

A description of this content.

QUrl Content::detailpage() const

A webpage with the detailed description of this content.

Attica::DownloadDescription Content::downloadUrlDescription(int number) const

Get the details about a download (a content can have multiple links, eg for different distros). This is not very helpful if we don't know the allowed numbers.

QList<Attica::DownloadDescription> Content::downloadUrlDescriptions() const

Get all possible downloads. This is slow searching through lots of strings, so beware and don't call it too often.

int Content::downloads() const

Returns the number of downloads for the Content (how often this has been downloaded from the server).

See also setDownloads().

QList<Attica::HomePageEntry> Content::homePageEntries()

Get all home pages for this content. This is slow searching through lots of strings, so beware and don't call it too often.

Attica::HomePageEntry Content::homePageEntry(int number) const

Get the details about a home page (a content can have multiple home pages, blog, bugs, ...). This is not very helpful if we don't know the allowed numbers.

QList<Attica::Icon> Content::icons()

Get all icons for this content.

See also setIcons().

QList<Attica::Icon> Content::icons() const

Get all icons for this content.

QString Content::id() const

Returns the id of the Content.

The id uniquely identifies a Content with the OCS API.

See also setId().

bool Content::isValid() const

Checks whether this Content has an id Returns true if an id has been set, false otherwise

QString Content::license() const

QString Content::licenseName() const

QString Content::name() const

Returns the name of the Content.

See also setName().

int Content::numberOfComments() const

Returns the number of comments for the Content.

See also setNumberOfComments().

QString Content::previewPicture(const QString &number = QStringLiteral("1")) const

int Content::rating() const

Returns the rating of the Content, in the range 0-100

See also setRating().

void Content::setCreated(const QDateTime &created)

Sets the date and time the Content has been created.

created the new creation date and time

See also created().

void Content::setDownloads(int downloads)

Sets the number of downloads for the Content.

downloads the new number of downloads

See also downloads().

void Content::setIcons(QList<Attica::Icon> icons)

Set list of icons.

icons list of icons for this content

See also icons().

void Content::setId(const QString &id)

Sets the id of the Content.

The id uniquely identifies a Content with the OCS API.

id the new id

See also id().

void Content::setName(const QString &name)

Sets the name of the Content.

name the new name

See also name().

void Content::setNumberOfComments(int numComments)

Sets the number of comments for the Content.

numComments the new number of downloads

See also numberOfComments().

void Content::setRating(int rating)

Sets the rating of the Content.

rating the new rating, has to be in the range 0-100

See also rating().

[since 5.50] void Content::setTags(const QStringList &tags)

Set the list of tags

tags list of tags for this content

This function was introduced in 5.50.

See also tags().

void Content::setUpdated(const QDateTime &updated)

Sets the time the Content has been last updated.

updated the new date and time of the last update

See also updated().

void Content::setVideos(QList<QUrl> videos)

Set list of videos.

videos list of videos for this content

See also videos().

QString Content::smallPreviewPicture(const QString &number = QStringLiteral("1")) const

QString Content::summary() const

A summary description of this content.

[since 5.50] QStringList Content::tags() const

Get all the tags for this content

This function was introduced in 5.50.

See also setTags().

QDateTime Content::updated() const

Returns the date and time the Content has been last updated.

See also setUpdated().

QString Content::version() const

QList<QUrl> Content::videos()

Get all videos for this content.

See also setVideos().