Attica 5.109.0
Public Types | Public Member Functions | List of all members
Attica::Content

Represents a single content. More...

#include <Attica/Content>

Public Types

typedef QList< ContentList
 

Public Member Functions

 Content ()
 Creates an empty Content.
 
 Content (const Content &other)
 Copy constructor.
 
 ~Content ()
 Destructor.
 
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.
 
QString attribute (const QString &key) const
 Get an attribute that is not included in the basis set of attributes exposed by the Content class.
 
QMap< QString, QString > attributes () const
 Get all attributes that are not included in the basis set of attributes exposed by the Content class.
 
QString author () const
 
QString changelog () const
 
QDateTime created () const
 Gets the date and time the Content has been created.
 
QString depend () const
 
QString description () const
 A description of this content.
 
QUrl detailpage () const
 A webpage with the detailed description of this content.
 
int downloads () const
 Gets the number of downloads for the Content (how often this has been downloaded from the server).
 
DownloadDescription downloadUrlDescription (int number) const
 Get the details about a download (a content can have multiple links, eg for different distros).
 
QList< DownloadDescriptiondownloadUrlDescriptions () const
 Get all possible downloads.
 
QList< HomePageEntryhomePageEntries ()
 Get all home pages 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< Iconicons ()
 Get all icons for this content.
 
QList< Iconicons () const
 Get all icons for this content.
 
QString id () const
 Gets the id of the Content.
 
bool isValid () const
 Checks whether this Content has an id.
 
QString license () const
 
QString licenseName () const
 
QString name () const
 Gets the name of the Content.
 
int numberOfComments () const
 Gets the number of comments for the Content.
 
Contentoperator= (const Content &other)
 Assignment operator.
 
QString previewPicture (const QString &number=QStringLiteral("1")) const
 
int rating () const
 Gets the rating of the Content.
 
void setCreated (const QDateTime &created)
 Sets the date and time the Content has been created.
 
void setDownloads (int downloads)
 Sets the number of downloads for the Content.
 
void setIcons (QList< Icon > icons)
 Set list of icons.
 
void setId (const QString &id)
 Sets the id of the Content.
 
void setName (const QString &name)
 Sets the name of the Content.
 
void setNumberOfComments (int numComments)
 Sets the number of comments for the Content.
 
void setRating (int rating)
 Sets the rating of the Content.
 
void setTags (const QStringList &tags)
 Set the list of tags.
 
void setUpdated (const QDateTime &updated)
 Sets the time the Content has been last updated.
 
void setVideos (QList< QUrl > videos)
 Set list of videos.
 
QString smallPreviewPicture (const QString &number=QStringLiteral("1")) const
 
QString summary () const
 A summary description of this content.
 
QStringList tags () const
 Get all the tags for this content.
 
QDateTime updated () const
 Gets the date and time the Content has been last updated.
 
QString version () const
 
QList< QUrl > videos ()
 Get all videos for this content.
 

Detailed Description

Represents a single content.

Constructor & Destructor Documentation

◆ Content() [1/2]

Attica::Content::Content ( )

Creates an empty Content.

◆ Content() [2/2]

Attica::Content::Content ( const Content other)

Copy constructor.

Parameters
otherthe Content to copy from

◆ ~Content()

Attica::Content::~Content ( )

Destructor.

Member Function Documentation

◆ addAttribute()

void Attica::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.

Parameters
keythe key of the attribute
valuethe value of the attribute

◆ attribute()

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

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

Parameters
keythe 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

◆ attributes()

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

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

Returns
the attribute mappings

◆ created()

QDateTime Attica::Content::created ( ) const

Gets the date and time the Content has been created.

Returns
the date and time of the last update

◆ description()

QString Attica::Content::description ( ) const

A description of this content.

◆ detailpage()

QUrl Attica::Content::detailpage ( ) const

A webpage with the detailed description of this content.

◆ downloads()

int Attica::Content::downloads ( ) const

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

Returns
the number of downloads

◆ downloadUrlDescription()

DownloadDescription Attica::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.

◆ downloadUrlDescriptions()

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

Get all possible downloads.

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

◆ homePageEntries()

QList< HomePageEntry > Attica::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.

◆ homePageEntry()

HomePageEntry Attica::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.

◆ icons() [1/2]

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

Get all icons for this content.

◆ icons() [2/2]

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

Get all icons for this content.

◆ id()

QString Attica::Content::id ( ) const

Gets the id of the Content.

The id uniquely identifies a Content with the OCS API.

Returns
the id

◆ isValid()

bool Attica::Content::isValid ( ) const

Checks whether this Content has an id.

Returns
true if an id has been set, false otherwise

◆ name()

QString Attica::Content::name ( ) const

Gets the name of the Content.

Returns
the name

◆ numberOfComments()

int Attica::Content::numberOfComments ( ) const

Gets the number of comments for the Content.

Returns
the number of comments

◆ operator=()

Content & Attica::Content::operator= ( const Content other)

Assignment operator.

Parameters
otherthe Content to assign from
Returns
pointer to this Content

◆ rating()

int Attica::Content::rating ( ) const

Gets the rating of the Content.

Returns
the rating in the range 0-100

◆ setCreated()

void Attica::Content::setCreated ( const QDateTime &  created)

Sets the date and time the Content has been created.

Parameters
createdthe new creation date and time

◆ setDownloads()

void Attica::Content::setDownloads ( int  downloads)

Sets the number of downloads for the Content.

Parameters
downloadsthe new number of downloads

◆ setIcons()

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

Set list of icons.

Parameters
iconslist of icons for this content

◆ setId()

void Attica::Content::setId ( const QString &  id)

Sets the id of the Content.

The id uniquely identifies a Content with the OCS API.

Parameters
idthe new id

◆ setName()

void Attica::Content::setName ( const QString &  name)

Sets the name of the Content.

Parameters
namethe new name

◆ setNumberOfComments()

void Attica::Content::setNumberOfComments ( int  numComments)

Sets the number of comments for the Content.

Parameters
numCommentsthe new number of downloads

◆ setRating()

void Attica::Content::setRating ( int  rating)

Sets the rating of the Content.

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

◆ setTags()

void Attica::Content::setTags ( const QStringList &  tags)

Set the list of tags.

Parameters
tagslist of tags for this content
Since
5.50

◆ setUpdated()

void Attica::Content::setUpdated ( const QDateTime &  updated)

Sets the time the Content has been last updated.

Parameters
updatedthe new date and time of the last update

◆ setVideos()

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

Set list of videos.

Parameters
videoslist of videos for this content

◆ summary()

QString Attica::Content::summary ( ) const

A summary description of this content.

◆ tags()

QStringList Attica::Content::tags ( ) const

Get all the tags for this content.

Since
5.50

◆ updated()

QDateTime Attica::Content::updated ( ) const

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

Returns
the date and time of the last update

◆ videos()

QList< QUrl > Attica::Content::videos ( )

Get all videos for this content.