Attica::Content

Attica::Content Class Reference

#include <content.h>

Public Types

typedef QList< ContentList
 

Public Member Functions

 Content ()
 
 Content (const Content &other)
 
 ~Content ()
 
void addAttribute (const QString &key, const QString &value)
 
QString attribute (const QString &key) const
 
QMap< QString, QStringattributes () const
 
QString author () const
 
QString changelog () const
 
QDateTime created () const
 
QString depend () const
 
QString description () const
 
QUrl detailpage () const
 
int downloads () const
 
DownloadDescription downloadUrlDescription (int number) const
 
QList< DownloadDescription > downloadUrlDescriptions () const
 
QList< HomePageEntryhomePageEntries ()
 
HomePageEntry homePageEntry (int number) const
 
QList< Iconicons ()
 
QList< Iconicons () const
 
QString id () const
 
bool isValid () const
 
QString license () const
 
QString licenseName () const
 
QString name () const
 
int numberOfComments () const
 
Contentoperator= (const Content &other)
 
QString previewPicture (const QString &number=QStringLiteral("1")) const
 
int rating () const
 
void setCreated (const QDateTime &created)
 
void setDownloads (int downloads)
 
void setIcons (QList< Icon > icons)
 
void setId (const QString &id)
 
void setName (const QString &name)
 
void setNumberOfComments (int numComments)
 
void setRating (int rating)
 
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
 
QStringList tags () const
 
QDateTime updated () const
 
QString version () const
 
QList< QUrlvideos ()
 

Detailed Description

Represents a single content.

Definition at line 31 of file content.h.

Constructor & Destructor Documentation

Content::Content ( )

Creates an empty Content.

Definition at line 39 of file content.cpp.

Content::Content ( const Content other)

Copy constructor.

Parameters
otherthe Content to copy from

Definition at line 44 of file content.cpp.

Content::~Content ( )

Destructor.

Definition at line 55 of file content.cpp.

Member Function Documentation

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.

Parameters
keythe key of the attribute
valuethe value of the attribute

Definition at line 129 of file content.cpp.

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.

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

Definition at line 134 of file content.cpp.

QMap< QString, QString > 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

Definition at line 139 of file content.cpp.

QDateTime Content::created ( ) const

Gets the date and time the Content has been created.

Returns
the date and time of the last update

Definition at line 114 of file content.cpp.

QString Content::description ( ) const

A description of this content.

Definition at line 154 of file content.cpp.

QUrl Content::detailpage ( ) const

A webpage with the detailed description of this content.

Definition at line 159 of file content.cpp.

int 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

Definition at line 94 of file content.cpp.

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

Definition at line 197 of file content.cpp.

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

Definition at line 175 of file content.cpp.

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.

Definition at line 227 of file content.cpp.

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

Definition at line 250 of file content.cpp.

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

Get all icons for this content.

Definition at line 293 of file content.cpp.

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

Get all icons for this content.

Definition at line 298 of file content.cpp.

QString Content::id ( ) const

Gets the id of the Content.

The id uniquely identifies a Content with the OCS API.

Returns
the id

Definition at line 64 of file content.cpp.

bool Content::isValid ( ) const

Checks whether this Content has an id.

Returns
true if an id has been set, false otherwise

Definition at line 144 of file content.cpp.

QString Content::name ( ) const

Gets the name of the Content.

Returns
the name

Definition at line 74 of file content.cpp.

int Content::numberOfComments ( ) const

Gets the number of comments for the Content.

Returns
the number of comments

Definition at line 104 of file content.cpp.

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

Assignment operator.

Parameters
otherthe Content to assign from
Returns
pointer to this Content

Definition at line 49 of file content.cpp.

int Content::rating ( ) const

Gets the rating of the Content.

Returns
the rating in the range 0-100

Definition at line 84 of file content.cpp.

void Content::setCreated ( const QDateTime created)

Sets the date and time the Content has been created.

Parameters
createdthe new creation date and time

Definition at line 109 of file content.cpp.

void Content::setDownloads ( int  downloads)

Sets the number of downloads for the Content.

Parameters
downloadsthe new number of downloads

Definition at line 89 of file content.cpp.

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

Set list of icons.

Parameters
iconslist of icons for this content

Definition at line 303 of file content.cpp.

void 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

Definition at line 59 of file content.cpp.

void Content::setName ( const QString name)

Sets the name of the Content.

Parameters
namethe new name

Definition at line 69 of file content.cpp.

void Content::setNumberOfComments ( int  numComments)

Sets the number of comments for the Content.

Parameters
numCommentsthe new number of downloads

Definition at line 99 of file content.cpp.

void Content::setRating ( int  rating)

Sets the rating of the Content.

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

Definition at line 79 of file content.cpp.

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

Set the list of tags.

Parameters
tagslist of tags for this content
Since
5.50

Definition at line 323 of file content.cpp.

void Content::setUpdated ( const QDateTime updated)

Sets the time the Content has been last updated.

Parameters
updatedthe new date and time of the last update

Definition at line 119 of file content.cpp.

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

Set list of videos.

Parameters
videoslist of videos for this content

Definition at line 313 of file content.cpp.

QString Content::summary ( ) const

A summary description of this content.

Definition at line 149 of file content.cpp.

QStringList Attica::Content::tags ( ) const

Get all the tags for this content.

Since
5.50

Definition at line 318 of file content.cpp.

QDateTime Content::updated ( ) const

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

Returns
the date and time of the last update

Definition at line 124 of file content.cpp.

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

Get all videos for this content.

Definition at line 308 of file content.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 6 2020 23:00:20 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.