KNSCore::Entry

Search for usage in LXR

#include <entry.h>

Public Types

enum  EntryEvent { UnknownEvent = 0 , StatusChangedEvent = 1 , AdoptedEvent = 2 , DetailsLoadedEvent = 3 }
 
enum  EntryType { CatalogEntry = 0 , GroupEntry }
 
typedef QList< EntryList
 
enum  PreviewType {
  PreviewSmall1 , PreviewSmall2 , PreviewSmall3 , PreviewBig1 ,
  PreviewBig2 , PreviewBig3
}
 
enum  Source { Cache , Online , Registry }
 
enum  Status {
  Invalid , Downloadable , Installed , Updateable ,
  Deleted , Installing , Updating
}
 

Properties

KNSCore::Author author
 
QString donationLink
 
int downloadCount
 
QList< KNSCore::Entry::DownloadLinkInformation > downloadLinks
 
KNSCore::Entry::EntryType entryType
 
QUrl homepage
 
QString name
 
int numberOfComments
 
QString providerId
 
int rating
 
QString shortSummary
 
KNSCore::Entry::Status status
 
QString summary
 
QString uniqueId
 

Public Member Functions

 Entry ()
 
 Entry (const Entry &other)
 
 ~Entry ()
 
void appendDownloadLinkInformation (const DownloadLinkInformation &info)
 
Author author () const
 
QString category () const
 
QString changelog () const
 
void clearDownloadLinkInformation ()
 
QString donationLink () const
 
int downloadCount () const
 
int downloadLinkCount () const
 
QList< DownloadLinkInformation > downloadLinkInformationList () const
 
EntryType entryType () const
 
QUrl homepage () const
 
QStringList installedFiles () const
 
bool isValid () const
 
QString knowledgebaseLink () const
 
QString license () const
 
QString name () const
 
int numberFans () const
 
int numberKnowledgebaseEntries () const
 
int numberOfComments () const
 
bool operator< (const Entry &other) const
 
Entryoperator= (const Entry &other)
 
bool operator== (const Entry &other) const
 
QString payload () const
 
QImage previewImage (PreviewType type=PreviewSmall1) const
 
QString previewUrl (PreviewType type=PreviewSmall1) const
 
QString providerId () const
 
int rating () const
 
QDate releaseDate () const
 
void setAuthor (const Author &author)
 
void setCategory (const QString &category)
 
void setChangelog (const QString &changelog)
 
void setDonationLink (const QString &link)
 
void setDownloadCount (int downloads)
 
void setEntryDeleted ()
 
void setEntryType (EntryType type)
 
bool setEntryXML (QXmlStreamReader &reader)
 
void setHomepage (const QUrl &page)
 
void setInstalledFiles (const QStringList &files)
 
void setKnowledgebaseLink (const QString &link)
 
void setLicense (const QString &license)
 
void setName (const QString &name)
 
void setNumberFans (int fans)
 
void setNumberKnowledgebaseEntries (int num)
 
void setNumberOfComments (int comments)
 
void setPayload (const QString &url)
 
void setPreviewImage (const QImage &image, PreviewType type=PreviewSmall1)
 
void setPreviewUrl (const QString &url, PreviewType type=PreviewSmall1)
 
void setProviderId (const QString &id)
 
void setRating (int rating)
 
void setReleaseDate (const QDate &releasedate)
 
void setShortSummary (const QString &summary)
 
void setSource (Source source)
 
void setStatus (KNSCore::Entry::Status status)
 
void setSummary (const QString &summary)
 
void setTags (const QStringList &tags)
 
void setUniqueId (const QString &id)
 
void setUpdateReleaseDate (const QDate &releasedate)
 
void setUpdateVersion (const QString &version)
 
void setVersion (const QString &version)
 
QString shortSummary () const
 
Source source () const
 
KNSCore::Entry::Status status () const
 
QString summary () const
 
QStringList tags () const
 
QStringList uninstalledFiles () const
 
QString uniqueId () const
 
QDate updateReleaseDate () const
 
QString updateVersion () const
 
QString version () const
 

Detailed Description

KNewStuff data entry container.

This class provides accessor methods to the data objects as used by KNewStuff.

Author
Cornelius Schumacher (schum.nosp@m.ache.nosp@m.r@kde.nosp@m..org)
Maintainer:
Jeremy Whiting (jpwhi.nosp@m.ting.nosp@m.@kde..nosp@m.org)

Definition at line 47 of file entry.h.

Member Typedef Documentation

◆ List

Definition at line 51 of file entry.h.

Member Enumeration Documentation

◆ EntryEvent

Enumerator
UnknownEvent 

A generic event, not generally used.

StatusChangedEvent 

Used when an event's status is set (use Entry::status() to get the new status)

AdoptedEvent 

Used when an entry has been successfully adopted (use this to determine whether a call to Engine::adoptEntry() succeeded)

DetailsLoadedEvent 

Used when more details have been added to an existing entry (such as the full description), and the UI should be updated.

Definition at line 120 of file entry.h.

◆ EntryType

Represents whether the current entry is an actual catalog entry, or an entry that represents a set of entries.

Since
5.83
Enumerator
CatalogEntry 

These are the main entries that KNewStuff can get the details about and download links for.

GroupEntry 

these are entries whose payload is another feed. Currently only used by the OPDS provider.

Definition at line 133 of file entry.h.

◆ PreviewType

enum KNSCore::Entry::PreviewType

Definition at line 100 of file entry.h.

◆ Source

Source of the entry, A entry's data is coming from either cache, or an online provider this helps the engine know which data to use when merging cached entries with online entry data.

Definition at line 94 of file entry.h.

◆ Status

Status of the entry.

An entry will be downloadable from the provider's site prior to the download. Once downloaded and installed, it will be either installed or updateable, implying an out-of-date installation. Finally, the entry can be deleted and hence show up as downloadable again. Entries not taking part in this cycle, for example those in upload, have an invalid status.

Definition at line 78 of file entry.h.

Property Documentation

◆ author

KNSCore::Author KNSCore::Entry::author
read

Definition at line 58 of file entry.h.

◆ donationLink

QString KNSCore::Entry::donationLink
read

Definition at line 63 of file entry.h.

◆ downloadCount

int KNSCore::Entry::downloadCount
read

Definition at line 66 of file entry.h.

◆ downloadLinks

QList<KNSCore::Entry::DownloadLinkInformation> KNSCore::Entry::downloadLinks
read

Definition at line 67 of file entry.h.

◆ entryType

KNSCore::Entry::EntryType KNSCore::Entry::entryType
read

Definition at line 55 of file entry.h.

◆ homepage

QUrl KNSCore::Entry::homepage
read

Definition at line 62 of file entry.h.

◆ name

QString KNSCore::Entry::name
read

Definition at line 57 of file entry.h.

◆ numberOfComments

int KNSCore::Entry::numberOfComments
read

Definition at line 64 of file entry.h.

◆ providerId

QString KNSCore::Entry::providerId
read

Definition at line 52 of file entry.h.

◆ rating

int KNSCore::Entry::rating
read

Definition at line 65 of file entry.h.

◆ shortSummary

QString KNSCore::Entry::shortSummary
read

Definition at line 59 of file entry.h.

◆ status

KNSCore::Entry::Status KNSCore::Entry::status
read

Definition at line 54 of file entry.h.

◆ summary

QString KNSCore::Entry::summary
read

Definition at line 60 of file entry.h.

◆ uniqueId

QString KNSCore::Entry::uniqueId
read

Definition at line 53 of file entry.h.

Constructor & Destructor Documentation

◆ Entry() [1/2]

Entry::Entry ( )

Constructor.

Definition at line 23 of file entry.cpp.

◆ Entry() [2/2]

Entry::Entry ( const Entry & other)

Definition at line 28 of file entry.cpp.

◆ ~Entry()

Entry::~Entry ( )
default

Destructor.

Member Function Documentation

◆ appendDownloadLinkInformation()

void KNSCore::Entry::appendDownloadLinkInformation ( const DownloadLinkInformation & info)

Add a new download option to this entry.

Parameters
infoThe new download option

Definition at line 372 of file entry.cpp.

◆ author()

Author Entry::author ( ) const

Retrieve the author of the object.

Returns
object author

Definition at line 116 of file entry.cpp.

◆ category()

QString Entry::category ( ) const

Retrieve the category of the data object.

This is the category's name or ID (as opposed to displayName).

See also
KNSCore::Provider::CategoryMetadata
KNSCore::Engine::categories()
Returns
object category

Definition at line 96 of file entry.cpp.

◆ changelog()

QString Entry::changelog ( ) const

Definition at line 161 of file entry.cpp.

◆ clearDownloadLinkInformation()

void Entry::clearDownloadLinkInformation ( )

Remove all download options from this entry.

Definition at line 385 of file entry.cpp.

◆ donationLink()

QString Entry::donationLink ( ) const

A string representing the URL for a website where the user can donate to the author of this entry.

Returns
The string version of the URL for the entry's donation website

Definition at line 276 of file entry.cpp.

◆ downloadCount()

int Entry::downloadCount ( ) const

Retrieve the download count for the object, which has been determined by its hosting sites and thus might change over time.

Returns
object download count

Definition at line 256 of file entry.cpp.

◆ downloadLinkCount()

int KNSCore::Entry::downloadLinkCount ( ) const

The number of available download options for this entry.

Returns
The number of download options

Definition at line 349 of file entry.cpp.

◆ downloadLinkInformationList()

QList< KNSCore::Entry::DownloadLinkInformation > KNSCore::Entry::downloadLinkInformationList ( ) const

A list of downloadable data for this entry.

Returns
The list of download options
See also
DownloadLinkInformation

Definition at line 354 of file entry.cpp.

◆ entryType()

Entry::EntryType Entry::entryType ( ) const

Definition at line 314 of file entry.cpp.

◆ homepage()

QUrl Entry::homepage ( ) const

A link to a website containing information about this entry.

Returns
The URL representing the entry's website

Definition at line 106 of file entry.cpp.

◆ installedFiles()

QStringList KNSCore::Entry::installedFiles ( ) const

Retrieve the locally installed files.

Returns
file names

Definition at line 339 of file entry.cpp.

◆ isValid()

bool Entry::isValid ( ) const

Definition at line 51 of file entry.cpp.

◆ knowledgebaseLink()

QString Entry::knowledgebaseLink ( ) const

The link for the knowledgebase for this entry.

Returns
A string version of the URL for the knowledgebase

Definition at line 295 of file entry.cpp.

◆ license()

QString Entry::license ( ) const

Retrieve the license name of the object.

Returns
object license

Definition at line 126 of file entry.cpp.

◆ name()

QString Entry::name ( ) const

Retrieve the name of the data object.

Returns
object name (potentially translated)

Definition at line 56 of file entry.cpp.

◆ numberFans()

int Entry::numberFans ( ) const

How many people have marked themselves as fans of this entry.

Returns
The number of fans this entry has
See also
KNSCore::Engine::becomeFan(const Entry& entry)

Definition at line 266 of file entry.cpp.

◆ numberKnowledgebaseEntries()

int Entry::numberKnowledgebaseEntries ( ) const

The number of entries in the knowledgebase for this entry.

Returns
The number of knowledgebase entries

Definition at line 286 of file entry.cpp.

◆ numberOfComments()

int Entry::numberOfComments ( ) const
Returns
the number of comments against the asset

Definition at line 246 of file entry.cpp.

◆ operator<()

bool Entry::operator< ( const Entry & other) const

Definition at line 39 of file entry.cpp.

◆ operator=()

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

Definition at line 33 of file entry.cpp.

◆ operator==()

bool Entry::operator== ( const Entry & other) const

Definition at line 44 of file entry.cpp.

◆ payload()

QString Entry::payload ( ) const

Retrieve the file name of the object.

Returns
object filename

Definition at line 186 of file entry.cpp.

◆ previewImage()

QImage Entry::previewImage ( PreviewType type = PreviewSmall1) const

This will not be loaded automatically, instead use Engine to load the actual images.

Definition at line 226 of file entry.cpp.

◆ previewUrl()

QString Entry::previewUrl ( PreviewType type = PreviewSmall1) const

Retrieve the file name of an image containing a preview of the object.

Returns
object preview filename

Definition at line 216 of file entry.cpp.

◆ providerId()

QString Entry::providerId ( ) const

The id of the provider this entry belongs to.

Definition at line 76 of file entry.cpp.

◆ rating()

int Entry::rating ( ) const

Retrieve the rating for the object, which has been determined by its users and thus might change over time.

Returns
object rating

Definition at line 236 of file entry.cpp.

◆ releaseDate()

QDate Entry::releaseDate ( ) const

Retrieve the date of the object's publication.

Returns
object release date

Definition at line 176 of file entry.cpp.

◆ setAuthor()

void Entry::setAuthor ( const Author & author)

Sets the author of the object.

Definition at line 121 of file entry.cpp.

◆ setCategory()

void Entry::setCategory ( const QString & category)

Sets the data category, e.g.

"KWin Scripts" or "Plasma Theme".

Definition at line 101 of file entry.cpp.

◆ setChangelog()

void Entry::setChangelog ( const QString & changelog)

The user written changelog.

Definition at line 156 of file entry.cpp.

◆ setDonationLink()

void Entry::setDonationLink ( const QString & link)

Set a string representation of the URL for the donation website for this entry.

Note: This is not checked for validity, the caller must do this.

Parameters
linkString version of the URL for the entry's donation website

Definition at line 281 of file entry.cpp.

◆ setDownloadCount()

void Entry::setDownloadCount ( int downloads)

Sets the number of downloads.

Definition at line 261 of file entry.cpp.

◆ setEntryDeleted()

void KNSCore::Entry::setEntryDeleted ( )

Definition at line 700 of file entry.cpp.

◆ setEntryType()

void Entry::setEntryType ( Entry::EntryType type)

The entry type is either catalog entry, or group entry.

Since
5.83

Definition at line 309 of file entry.cpp.

◆ setEntryXML()

bool KNSCore::Entry::setEntryXML ( QXmlStreamReader & reader)

set the xml for the entry parses the xml and sets the private members accordingly used to deserialize data loaded from provider

Parameters
xmldatastring to load xml data from
Returns
whether or not setting the values was successful
Since
5.36

Definition at line 431 of file entry.cpp.

◆ setHomepage()

void Entry::setHomepage ( const QUrl & page)

Set a link to a website containing information about this entry.

Parameters
pageThe URL representing the entry's website

Definition at line 111 of file entry.cpp.

◆ setInstalledFiles()

void KNSCore::Entry::setInstalledFiles ( const QStringList & files)

Set the files that have been installed by the install command.

Parameters
fileslocal file names

Definition at line 334 of file entry.cpp.

◆ setKnowledgebaseLink()

void Entry::setKnowledgebaseLink ( const QString & link)

Set the link for the knowledgebase.

Note: This is not checked for validity, the caller must do this.

Parameters
linkThe string version of the URL for the knowledgebase

Definition at line 299 of file entry.cpp.

◆ setLicense()

void Entry::setLicense ( const QString & license)

Sets the license (abbreviation) applicable to the object.

Definition at line 131 of file entry.cpp.

◆ setName()

void Entry::setName ( const QString & name)

Sets the name for this data object.

Definition at line 61 of file entry.cpp.

◆ setNumberFans()

void Entry::setNumberFans ( int fans)

Sets how many people are fans.

Note: This is purely informational. To become a fan, call the KNSCore::Engine::becomeFan function.

Parameters
fansThe number of fans this entry has
See also
KNSCore::Engine::becomeFan(const Entry& entry)

Definition at line 271 of file entry.cpp.

◆ setNumberKnowledgebaseEntries()

void Entry::setNumberKnowledgebaseEntries ( int num)

Set the number of knowledgebase entries for this entry.

Parameters
numThe number of entries

Definition at line 290 of file entry.cpp.

◆ setNumberOfComments()

void Entry::setNumberOfComments ( int comments)

Sets the number of comments in the asset.

Definition at line 251 of file entry.cpp.

◆ setPayload()

void Entry::setPayload ( const QString & url)

Sets the object's file.

Definition at line 191 of file entry.cpp.

◆ setPreviewImage()

void Entry::setPreviewImage ( const QImage & image,
PreviewType type = PreviewSmall1 )

Definition at line 231 of file entry.cpp.

◆ setPreviewUrl()

void Entry::setPreviewUrl ( const QString & url,
PreviewType type = PreviewSmall1 )

Sets the object's preview file, if available.

This should be a picture file.

Definition at line 221 of file entry.cpp.

◆ setProviderId()

void Entry::setProviderId ( const QString & id)

Definition at line 81 of file entry.cpp.

◆ setRating()

void Entry::setRating ( int rating)

Sets the rating between 0 (worst) and 100 (best).

Definition at line 241 of file entry.cpp.

◆ setReleaseDate()

void Entry::setReleaseDate ( const QDate & releasedate)

Sets the release date.

Definition at line 181 of file entry.cpp.

◆ setShortSummary()

void Entry::setShortSummary ( const QString & summary)

Sets a short description of what the object is all about (should be very short)

Definition at line 151 of file entry.cpp.

◆ setSource()

void Entry::setSource ( Source source)

The source of this entry can be Cache, Registry or Online -.

See also
source

Definition at line 319 of file entry.cpp.

◆ setStatus()

void Entry::setStatus ( KNSCore::Entry::Status status)

Sets the entry's status.

If no status is set, the default will be Invalid.

Note that while this enum is currently found in KNS3::Entry, it will be moved to this class once the binary compatibility lock is lifted for Frameworks 6. For now, you should read any reference to the KNS3::Entry::Status enumerator as KNSCore::Entry::Status

Parameters
statusNew status of the entry

Definition at line 329 of file entry.cpp.

◆ setSummary()

void Entry::setSummary ( const QString & summary)

Sets a description (which can potentially be very long)

Definition at line 141 of file entry.cpp.

◆ setTags()

void KNSCore::Entry::setTags ( const QStringList & tags)

Set the tags for the content item.

Parameters
tagsA string list containing the tags for this entry
Since
5.51

Definition at line 91 of file entry.cpp.

◆ setUniqueId()

void Entry::setUniqueId ( const QString & id)

Set the object's unique ID.

This must be unique to the provider.

Parameters
idThe unique ID of this entry as unique to this provider
See also
KNSCore::Provider

Definition at line 71 of file entry.cpp.

◆ setUpdateReleaseDate()

void Entry::setUpdateReleaseDate ( const QDate & releasedate)

Sets the release date that is available as update.

Definition at line 201 of file entry.cpp.

◆ setUpdateVersion()

void Entry::setUpdateVersion ( const QString & version)

Sets the version number that is available as update.

Definition at line 211 of file entry.cpp.

◆ setVersion()

void Entry::setVersion ( const QString & version)

Sets the version number.

Definition at line 171 of file entry.cpp.

◆ shortSummary()

QString Entry::shortSummary ( ) const

Retrieve a short description of what the object is all about (should be very short)

Returns
object license

Definition at line 146 of file entry.cpp.

◆ source()

Entry::Source Entry::source ( ) const

Definition at line 304 of file entry.cpp.

◆ status()

KNSCore::Entry::Status Entry::status ( ) const

Retrieves the entry's status.

Returns
Current status of the entry

Definition at line 324 of file entry.cpp.

◆ summary()

QString Entry::summary ( ) const

Retrieve a (potentially very long) description of the object.

Returns
object description

Definition at line 136 of file entry.cpp.

◆ tags()

QStringList KNSCore::Entry::tags ( ) const

The set of tags assigned specifically to this content item.

This does not include tags for the download links. To get those, you must concatenate the lists yourself.

See also
downloadLinkInformationList()
DownloadLinkInformation
Engine::setTagFilter(QStringList)
Since
5.51

Definition at line 86 of file entry.cpp.

◆ uninstalledFiles()

QStringList KNSCore::Entry::uninstalledFiles ( ) const

Retrieve the locally uninstalled files.

Returns
file names
Since
4.1

Definition at line 344 of file entry.cpp.

◆ uniqueId()

QString Entry::uniqueId ( ) const

Get the object's unique ID.

This will be unique to the provider. This is not intended as user-facing information - though it can be useful for certain purposes, this is supposed to only be used for keeping track of the entry.

Returns
The unique ID of this entry

Definition at line 66 of file entry.cpp.

◆ updateReleaseDate()

QDate Entry::updateReleaseDate ( ) const

Retrieve the date of the newer version that is available as update.

Returns
object release date

Definition at line 196 of file entry.cpp.

◆ updateVersion()

QString Entry::updateVersion ( ) const

Retrieve the version string of the object that is available as update.

Returns
object version

Definition at line 206 of file entry.cpp.

◆ version()

QString Entry::version ( ) const

Retrieve the version string of the object.

Returns
object version

Definition at line 166 of file entry.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 Fri Oct 11 2024 12:12:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.