KNSCore::EntryInternal
#include <entryinternal.h>
Public Types | |
enum | EntryEvent { UnknownEvent = 0, StatusChangedEvent = 1, AdoptedEvent = 2, DetailsLoadedEvent = 3 } |
enum | EntryType { CatalogEntry = 0, GroupEntry } |
typedef QList< EntryInternal > | List |
enum | PreviewType { PreviewSmall1, PreviewSmall2, PreviewSmall3, PreviewBig1, PreviewBig2, PreviewBig3 } |
enum | Source { Cache, Online, Registry } |
Public Member Functions | |
EntryInternal () | |
EntryInternal (const EntryInternal &other) | |
~EntryInternal () | |
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 |
QDomElement | entryXML () 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 EntryInternal &other) const |
EntryInternal & | operator= (const EntryInternal &other) |
bool | operator== (const EntryInternal &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 | setEntryType (EntryType type) |
bool | setEntryXML (const QDomElement &xmldata) |
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 (KNS3::Entry::Status status) |
void | setSummary (const QString &summary) |
void | setTags (const QStringList &tags) |
void | setUnInstalledFiles (const QStringList &files) |
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 |
KNS3::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 |
Static Public Member Functions | |
static KNSCore::EntryInternal | fromEntry (const KNS3::Entry &entry) |
Detailed Description
KNewStuff data entry container.
This class provides accessor methods to the data objects as used by KNewStuff.
- Maintainer:
- Jeremy Whiting (jpwhi) ting @kde. org
Definition at line 52 of file entryinternal.h.
Member Enumeration Documentation
◆ EntryEvent
Enumerator | |
---|---|
UnknownEvent | A generic event, not generally used. |
StatusChangedEvent | Used when an event's status is set (use EntryInternal::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 89 of file entryinternal.h.
◆ EntryType
Represents whether the current entry is an actual catalog entry, or an entry that represents a set of entries.
- Since
- 5.83
Definition at line 102 of file entryinternal.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 63 of file entryinternal.h.
Constructor & Destructor Documentation
◆ EntryInternal()
EntryInternal::EntryInternal | ( | ) |
Constructor.
Definition at line 84 of file entryinternal.cpp.
◆ ~EntryInternal()
EntryInternal::~EntryInternal | ( | ) |
Destructor.
Definition at line 110 of file entryinternal.cpp.
Member Function Documentation
◆ appendDownloadLinkInformation()
void KNSCore::EntryInternal::appendDownloadLinkInformation | ( | const DownloadLinkInformation & | info | ) |
Add a new download option to this entry.
- Parameters
-
info The new download option
Definition at line 427 of file entryinternal.cpp.
◆ author()
Author EntryInternal::author | ( | ) | const |
Retrieve the author of the object.
- Returns
- object author
Definition at line 179 of file entryinternal.cpp.
◆ category()
QString EntryInternal::category | ( | ) | const |
Retrieve the category of the data object.
This is the category's name or ID (as opposed to displayName).
- Returns
- object category
Definition at line 159 of file entryinternal.cpp.
◆ clearDownloadLinkInformation()
void EntryInternal::clearDownloadLinkInformation | ( | ) |
Remove all download options from this entry.
Definition at line 432 of file entryinternal.cpp.
◆ donationLink()
QString EntryInternal::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 339 of file entryinternal.cpp.
◆ downloadCount()
int EntryInternal::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 319 of file entryinternal.cpp.
◆ downloadLinkCount()
int KNSCore::EntryInternal::downloadLinkCount | ( | ) | const |
The number of available download options for this entry.
- Returns
- The number of download options
Definition at line 417 of file entryinternal.cpp.
◆ downloadLinkInformationList()
QList< KNSCore::EntryInternal::DownloadLinkInformation > KNSCore::EntryInternal::downloadLinkInformationList | ( | ) | const |
A list of downloadable data for this entry.
- Returns
- The list of download options
- See also
- DownloadLinkInformation
Definition at line 422 of file entryinternal.cpp.
◆ entryXML()
QDomElement KNSCore::EntryInternal::entryXML | ( | ) | const |
get the xml string for the entry
Definition at line 680 of file entryinternal.cpp.
◆ homepage()
QUrl EntryInternal::homepage | ( | ) | const |
A link to a website containing information about this entry.
- Returns
- The URL representing the entry's website
Definition at line 169 of file entryinternal.cpp.
◆ installedFiles()
QStringList KNSCore::EntryInternal::installedFiles | ( | ) | const |
Retrieve the locally installed files.
- Returns
- file names
Definition at line 402 of file entryinternal.cpp.
◆ knowledgebaseLink()
QString EntryInternal::knowledgebaseLink | ( | ) | const |
The link for the knowledgebase for this entry.
- Returns
- A string version of the URL for the knowledgebase
Definition at line 358 of file entryinternal.cpp.
◆ license()
QString EntryInternal::license | ( | ) | const |
Retrieve the license name of the object.
- Returns
- object license
Definition at line 189 of file entryinternal.cpp.
◆ name()
QString EntryInternal::name | ( | ) | const |
Retrieve the name of the data object.
- Returns
- object name (potentially translated)
Definition at line 119 of file entryinternal.cpp.
◆ numberFans()
int EntryInternal::numberFans | ( | ) | const |
How many people have marked themselves as fans of this entry.
- Returns
- The number of fans this entry has
Definition at line 329 of file entryinternal.cpp.
◆ numberKnowledgebaseEntries()
int EntryInternal::numberKnowledgebaseEntries | ( | ) | const |
The number of entries in the knowledgebase for this entry.
- Returns
- The number of knowledgebase entries
Definition at line 349 of file entryinternal.cpp.
◆ numberOfComments()
int EntryInternal::numberOfComments | ( | ) | const |
- Returns
- the number of comments against the asset
Definition at line 309 of file entryinternal.cpp.
◆ payload()
QString EntryInternal::payload | ( | ) | const |
Retrieve the file name of the object.
- Returns
- object filename
Definition at line 249 of file entryinternal.cpp.
◆ previewImage()
QImage EntryInternal::previewImage | ( | PreviewType | type = PreviewSmall1 | ) | const |
This will not be loaded automatically, instead use Engine to load the actual images.
Definition at line 289 of file entryinternal.cpp.
◆ previewUrl()
QString EntryInternal::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 279 of file entryinternal.cpp.
◆ providerId()
QString EntryInternal::providerId | ( | ) | const |
The id of the provider this entry belongs to.
Definition at line 139 of file entryinternal.cpp.
◆ rating()
int EntryInternal::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 299 of file entryinternal.cpp.
◆ releaseDate()
QDate EntryInternal::releaseDate | ( | ) | const |
Retrieve the date of the object's publication.
- Returns
- object release date
Definition at line 239 of file entryinternal.cpp.
◆ setAuthor()
void EntryInternal::setAuthor | ( | const Author & | author | ) |
Sets the author of the object.
Definition at line 184 of file entryinternal.cpp.
◆ setCategory()
void EntryInternal::setCategory | ( | const QString & | category | ) |
Sets the data category, e.g.
"KWin Scripts" or "Plasma Theme".
Definition at line 164 of file entryinternal.cpp.
◆ setChangelog()
void EntryInternal::setChangelog | ( | const QString & | changelog | ) |
The user written changelog.
Definition at line 219 of file entryinternal.cpp.
◆ setDonationLink()
void EntryInternal::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
-
link String version of the URL for the entry's donation website
Definition at line 344 of file entryinternal.cpp.
◆ setDownloadCount()
void EntryInternal::setDownloadCount | ( | int | downloads | ) |
Sets the number of downloads.
Definition at line 324 of file entryinternal.cpp.
◆ setEntryType()
void EntryInternal::setEntryType | ( | EntryInternal::EntryType | type | ) |
The entry type is either catalog entry, or group entry.
- Since
- 5.83
Definition at line 372 of file entryinternal.cpp.
◆ setEntryXML() [1/2]
bool KNSCore::EntryInternal::setEntryXML | ( | const QDomElement & | xmldata | ) |
set the xml for the entry parses the xml and sets the private members accordingly used to deserialize data loaded from provider
- Parameters
-
xmldata string to load xml data from
- Returns
- whether or not setting the values was successful
- Deprecated:
- since 5.36, use setEntryXML(QXmlStreamReader&) instead
Definition at line 583 of file entryinternal.cpp.
◆ setEntryXML() [2/2]
bool KNSCore::EntryInternal::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
-
xmldata string to load xml data from
- Returns
- whether or not setting the values was successful
- Since
- 5.36
Definition at line 478 of file entryinternal.cpp.
◆ setHomepage()
void EntryInternal::setHomepage | ( | const QUrl & | page | ) |
Set a link to a website containing information about this entry.
- Parameters
-
page The URL representing the entry's website
Definition at line 174 of file entryinternal.cpp.
◆ setInstalledFiles()
void KNSCore::EntryInternal::setInstalledFiles | ( | const QStringList & | files | ) |
Set the files that have been installed by the install command.
- Parameters
-
files local file names
Definition at line 397 of file entryinternal.cpp.
◆ setKnowledgebaseLink()
void EntryInternal::setKnowledgebaseLink | ( | const QString & | link | ) |
Set the link for the knowledgebase.
Note: This is not checked for validity, the caller must do this.
- Parameters
-
link The string version of the URL for the knowledgebase
Definition at line 362 of file entryinternal.cpp.
◆ setLicense()
void EntryInternal::setLicense | ( | const QString & | license | ) |
Sets the license (abbreviation) applicable to the object.
Definition at line 194 of file entryinternal.cpp.
◆ setName()
void EntryInternal::setName | ( | const QString & | name | ) |
Sets the name for this data object.
Definition at line 124 of file entryinternal.cpp.
◆ setNumberFans()
void EntryInternal::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
-
fans The number of fans this entry has
Definition at line 334 of file entryinternal.cpp.
◆ setNumberKnowledgebaseEntries()
void EntryInternal::setNumberKnowledgebaseEntries | ( | int | num | ) |
Set the number of knowledgebase entries for this entry.
- Parameters
-
num The number of entries
Definition at line 353 of file entryinternal.cpp.
◆ setNumberOfComments()
void EntryInternal::setNumberOfComments | ( | int | comments | ) |
Sets the number of comments in the asset.
Definition at line 314 of file entryinternal.cpp.
◆ setPayload()
void EntryInternal::setPayload | ( | const QString & | url | ) |
Sets the object's file.
Definition at line 254 of file entryinternal.cpp.
◆ setPreviewUrl()
void EntryInternal::setPreviewUrl | ( | const QString & | url, |
PreviewType | type = PreviewSmall1 |
||
) |
Sets the object's preview file, if available.
This should be a picture file.
Definition at line 284 of file entryinternal.cpp.
◆ setRating()
void EntryInternal::setRating | ( | int | rating | ) |
Sets the rating between 0 (worst) and 100 (best).
Definition at line 304 of file entryinternal.cpp.
◆ setReleaseDate()
void EntryInternal::setReleaseDate | ( | const QDate & | releasedate | ) |
Sets the release date.
Definition at line 244 of file entryinternal.cpp.
◆ setShortSummary()
void EntryInternal::setShortSummary | ( | const QString & | summary | ) |
Sets a short description of what the object is all about (should be very short)
Definition at line 214 of file entryinternal.cpp.
◆ setSource()
void EntryInternal::setSource | ( | Source | source | ) |
The source of this entry can be Cache, Registry or Online -.
- See also
- source
Definition at line 382 of file entryinternal.cpp.
◆ setStatus()
void EntryInternal::setStatus | ( | KNS3::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
-
status New status of the entry
Definition at line 392 of file entryinternal.cpp.
◆ setSummary()
void EntryInternal::setSummary | ( | const QString & | summary | ) |
Sets a description (which can potentially be very long)
Definition at line 204 of file entryinternal.cpp.
◆ setTags()
void KNSCore::EntryInternal::setTags | ( | const QStringList & | tags | ) |
Set the tags for the content item.
- Parameters
-
tags A string list containing the tags for this entry
- Since
- 5.51
Definition at line 154 of file entryinternal.cpp.
◆ setUnInstalledFiles()
void KNSCore::EntryInternal::setUnInstalledFiles | ( | const QStringList & | files | ) |
Set the files that have been uninstalled by the uninstall command.
- Parameters
-
files local file names
- Since
- 4.1
Definition at line 407 of file entryinternal.cpp.
◆ setUniqueId()
void EntryInternal::setUniqueId | ( | const QString & | id | ) |
Set the object's unique ID.
This must be unique to the provider.
- Parameters
-
id The unique ID of this entry as unique to this provider
- See also
- KNSCore::Provider
Definition at line 134 of file entryinternal.cpp.
◆ setUpdateReleaseDate()
void EntryInternal::setUpdateReleaseDate | ( | const QDate & | releasedate | ) |
Sets the release date that is available as update.
Definition at line 264 of file entryinternal.cpp.
◆ setUpdateVersion()
void EntryInternal::setUpdateVersion | ( | const QString & | version | ) |
Sets the version number that is available as update.
Definition at line 274 of file entryinternal.cpp.
◆ setVersion()
void EntryInternal::setVersion | ( | const QString & | version | ) |
Sets the version number.
Definition at line 234 of file entryinternal.cpp.
◆ shortSummary()
QString EntryInternal::shortSummary | ( | ) | const |
Retrieve a short description of what the object is all about (should be very short)
- Returns
- object license
Definition at line 209 of file entryinternal.cpp.
◆ status()
KNS3::Entry::Status EntryInternal::status | ( | ) | const |
Retrieves the entry's status.
- Returns
- Current status of the entry
Definition at line 387 of file entryinternal.cpp.
◆ summary()
QString EntryInternal::summary | ( | ) | const |
Retrieve a (potentially very long) description of the object.
- Returns
- object description
Definition at line 199 of file entryinternal.cpp.
◆ tags()
QStringList KNSCore::EntryInternal::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 149 of file entryinternal.cpp.
◆ uninstalledFiles()
QStringList KNSCore::EntryInternal::uninstalledFiles | ( | ) | const |
Retrieve the locally uninstalled files.
- Returns
- file names
- Since
- 4.1
Definition at line 412 of file entryinternal.cpp.
◆ uniqueId()
QString EntryInternal::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 129 of file entryinternal.cpp.
◆ updateReleaseDate()
QDate EntryInternal::updateReleaseDate | ( | ) | const |
Retrieve the date of the newer version that is available as update.
- Returns
- object release date
Definition at line 259 of file entryinternal.cpp.
◆ updateVersion()
QString EntryInternal::updateVersion | ( | ) | const |
Retrieve the version string of the object that is available as update.
- Returns
- object version
Definition at line 269 of file entryinternal.cpp.
◆ version()
QString EntryInternal::version | ( | ) | const |
Retrieve the version string of the object.
- Returns
- object version
Definition at line 229 of file entryinternal.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:19:30 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.