Attica::Content

Search for usage in LXR

Attica::Content Class Reference

#include <Attica/Content>

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< DownloadDescriptiondownloadUrlDescriptions () 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 32 of file content.h.

Member Typedef Documentation

◆ List

Definition at line 35 of file content.h.

Constructor & Destructor Documentation

◆ Content() [1/2]

Content::Content ( )

Creates an empty Content.

Definition at line 39 of file content.cpp.

◆ Content() [2/2]

Content::Content ( const Content & other)

Copy constructor.

Parameters
otherthe Content to copy from

Definition at line 44 of file content.cpp.

◆ ~Content()

Content::~Content ( )

Destructor.

Definition at line 55 of file content.cpp.

Member Function Documentation

◆ addAttribute()

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.

◆ 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.

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.

◆ attributes()

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.

◆ author()

QString Attica::Content::author ( ) const

Definition at line 268 of file content.cpp.

◆ changelog()

QString Attica::Content::changelog ( ) const

Definition at line 164 of file content.cpp.

◆ created()

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.

◆ depend()

QString Attica::Content::depend ( ) const

Definition at line 169 of file content.cpp.

◆ description()

QString Content::description ( ) const

A description of this content.

Definition at line 154 of file content.cpp.

◆ detailpage()

QUrl Content::detailpage ( ) const

A webpage with the detailed description of this content.

Definition at line 159 of file content.cpp.

◆ downloads()

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.

◆ downloadUrlDescription()

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.

◆ downloadUrlDescriptions()

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 174 of file content.cpp.

◆ 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.

Definition at line 227 of file content.cpp.

◆ homePageEntry()

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.

◆ icons() [1/2]

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

Get all icons for this content.

Definition at line 293 of file content.cpp.

◆ icons() [2/2]

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

Get all icons for this content.

Definition at line 298 of file content.cpp.

◆ id()

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.

◆ isValid()

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.

◆ license()

QString Attica::Content::license ( ) const

Definition at line 273 of file content.cpp.

◆ licenseName()

QString Attica::Content::licenseName ( ) const

Definition at line 278 of file content.cpp.

◆ name()

QString Content::name ( ) const

Gets the name of the Content.

Returns
the name

Definition at line 74 of file content.cpp.

◆ numberOfComments()

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.

◆ operator=()

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.

◆ previewPicture()

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

Definition at line 283 of file content.cpp.

◆ rating()

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.

◆ setCreated()

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.

◆ setDownloads()

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.

◆ setIcons()

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.

◆ setId()

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.

◆ setName()

void Content::setName ( const QString & name)

Sets the name of the Content.

Parameters
namethe new name

Definition at line 69 of file content.cpp.

◆ setNumberOfComments()

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.

◆ setRating()

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.

◆ setTags()

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.

◆ setUpdated()

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.

◆ setVideos()

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.

◆ smallPreviewPicture()

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

Definition at line 288 of file content.cpp.

◆ summary()

QString Content::summary ( ) const

A summary description of this content.

Definition at line 149 of file content.cpp.

◆ tags()

QStringList Attica::Content::tags ( ) const

Get all the tags for this content.

Since
5.50

Definition at line 318 of file content.cpp.

◆ updated()

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.

◆ version()

QString Attica::Content::version ( ) const

Definition at line 263 of file content.cpp.

◆ videos()

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-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:46:19 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.