• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KNewStuff

  • knewstuff
  • knewstuff3
  • core
entryinternal.h
Go to the documentation of this file.
1/*
2 knewstuff3/entry.h.
3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
4 Copyright (c) 2003 - 2007 Josef Spillner <spillner@kde.org>
5 Copyright (c) 2009 Jeremy Whiting <jpwhiting@kde.org>
6 Copyright (C) 2009 Frederik Gladhorn <gladhorn@kde.org>
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#ifndef KNEWSTUFF3_ENTRY_H
23#define KNEWSTUFF3_ENTRY_H
24
25#include <QtCore/QDate>
26#include <QtXml/QDomElement>
27#include <QtCore/QString>
28
29#include <kurl.h>
30
31#include <knewstuff3/core/author.h>
32#include <knewstuff3/entry.h>
33
34namespace KNS3
35{
36 static const int PreviewWidth = 96;
37 static const int PreviewHeight = 72;
38
42 QString replaceBBCode(const QString& unformattedText);
43
54class EntryInternal
55{
56public:
57 typedef QList<EntryInternal> List;
58
64 enum Source {
65 Cache,
66 Online,
67 Registry
68 };
69
70 enum PreviewType {
71 PreviewSmall1,
72 PreviewSmall2,
73 PreviewSmall3,
74 PreviewBig1,
75 PreviewBig2,
76 PreviewBig3
77 };
78
79 struct DownloadLinkInformation {
80 QString name;
81 QString priceAmount;
82 QString distributionType;
83 QString descriptionLink;
84 int id;
85 bool isDownloadtypeLink;
86 };
87
91 EntryInternal();
92
93 EntryInternal(const EntryInternal& other);
94 EntryInternal& operator=(const EntryInternal& other);
95
96 bool operator==(const EntryInternal& other) const;
97 bool operator<(const EntryInternal& other) const;
98
102 ~EntryInternal();
103
104 bool isValid() const;
105
109 void setName(const QString& name);
110
116 QString name() const;
117
118 void setUniqueId(const QString& id);
119 QString uniqueId() const;
120
124 void setCategory(const QString& category);
125
131 QString category() const;
132
133 void setHomepage(const KUrl& page);
134 KUrl homepage() const;
135
139 void setAuthor(const Author& author);
140
146 Author author() const;
147
151 void setLicense(const QString& license);
152
158 QString license() const;
159
163 void setSummary(const QString& summary);
164
170 QString summary() const;
171
175 void setChangelog(const QString& changelog);
176 QString changelog() const;
177
181 void setVersion(const QString& version);
182
188 QString version() const;
189
193 void setReleaseDate(const QDate& releasedate);
194
200 QDate releaseDate() const;
201
205 void setUpdateVersion(const QString& version);
206
212 QString updateVersion() const;
213
217 void setUpdateReleaseDate(const QDate& releasedate);
218
224 QDate updateReleaseDate() const;
225
229 void setPayload(const QString& url);
230
236 QString payload() const;
237
242 void setPreviewUrl(const QString& url, PreviewType type = PreviewSmall1);
243
249 QString previewUrl(PreviewType type = PreviewSmall1) const;
250
254 QImage previewImage(PreviewType type = PreviewSmall1) const;
255 void setPreviewImage(const QImage& image, PreviewType type = PreviewSmall1);
256
261 void setInstalledFiles(const QStringList& files);
262
267 QStringList installedFiles() const;
268
274 void setUnInstalledFiles(const QStringList& files);
275
281 QStringList uninstalledFiles() const;
282
288 void setRating(int rating);
289
296 int rating() const;
297
303 void setDownloadCount(int downloads);
304
311 int downloadCount() const;
312
313 int numberFans() const;
314 void setNumberFans(int fans);
315
316 int numberKnowledgebaseEntries() const;
317 void setNumberKnowledgebaseEntries(int num);
318 QString knowledgebaseLink() const;
319 void setKnowledgebaseLink(const QString& link);
320
321 int downloadLinkCount() const;
322 QList<DownloadLinkInformation> downloadLinkInformationList() const;
323 void appendDownloadLinkInformation(const DownloadLinkInformation& info);
324 void clearDownloadLinkInformation();
325
326 QString donationLink() const;
327 void setDonationLink(const QString& link);
328
332 QString providerId() const;
333 void setProviderId(const QString& id);
334
338 void setSource(Source source);
339 Source source() const;
340
350 bool setEntryXML(const QDomElement & xmldata);
351
355 QDomElement entryXML() const;
356
364 //QString checksum() const;
365
372 //void setChecksum(const QString& checksum);
373
381 //QString signature() const;
382
389 //void setSignature(const QString& signature);
390
397 void setStatus(Entry::Status status);
398
404 Entry::Status status() const;
405
406 //void setIdNumber(int number);
407 //int idNumber() const;
408
409 Entry toEntry() const;
410
411 static KNS3::EntryInternal fromEntry(const KNS3::Entry& entry);
412private:
413 class Private;
414 QExplicitlySharedDataPointer<Private> d;
415};
416
417inline uint qHash(const KNS3::EntryInternal& entry) {
418 return qHash(entry.uniqueId());
419}
420
421}
422
423#endif
KNS3::Author
KNewStuff author information.
Definition: knewstuff3/core/author.h:38
KNS3::EntryInternal
KNewStuff data entry container.
Definition: entryinternal.h:55
KNS3::EntryInternal::appendDownloadLinkInformation
void appendDownloadLinkInformation(const DownloadLinkInformation &info)
Definition: entryinternal.cpp:407
KNS3::EntryInternal::setVersion
void setVersion(const QString &version)
Sets the version number.
Definition: entryinternal.cpp:219
KNS3::EntryInternal::setUpdateReleaseDate
void setUpdateReleaseDate(const QDate &releasedate)
Sets the release date that is available as update.
Definition: entryinternal.cpp:249
KNS3::EntryInternal::setSource
void setSource(Source source)
The source of this entry can be Cache, Registry or Online -.
Definition: entryinternal.cpp:362
KNS3::EntryInternal::EntryInternal
EntryInternal()
Constructor.
Definition: entryinternal.cpp:89
KNS3::EntryInternal::setReleaseDate
void setReleaseDate(const QDate &releasedate)
Sets the release date.
Definition: entryinternal.cpp:229
KNS3::EntryInternal::fromEntry
static KNS3::EntryInternal fromEntry(const KNS3::Entry &entry)
Definition: entryinternal.cpp:581
KNS3::EntryInternal::version
QString version() const
Retrieve the version string of the object.
Definition: entryinternal.cpp:214
KNS3::EntryInternal::source
Source source() const
Definition: entryinternal.cpp:357
KNS3::EntryInternal::setUnInstalledFiles
void setUnInstalledFiles(const QStringList &files)
Set the files that have been uninstalled by the uninstall command.
Definition: entryinternal.cpp:387
KNS3::EntryInternal::donationLink
QString donationLink() const
Definition: entryinternal.cpp:314
KNS3::EntryInternal::homepage
KUrl homepage() const
Definition: entryinternal.cpp:164
KNS3::EntryInternal::operator==
bool operator==(const EntryInternal &other) const
Definition: entryinternal.cpp:110
KNS3::EntryInternal::license
QString license() const
Retrieve the license name of the object.
Definition: entryinternal.cpp:184
KNS3::EntryInternal::setUpdateVersion
void setUpdateVersion(const QString &version)
Sets the version number that is available as update.
Definition: entryinternal.cpp:259
KNS3::EntryInternal::knowledgebaseLink
QString knowledgebaseLink() const
Definition: entryinternal.cpp:333
KNS3::EntryInternal::~EntryInternal
~EntryInternal()
Destructor.
Definition: entryinternal.cpp:115
KNS3::EntryInternal::setEntryXML
bool setEntryXML(const QDomElement &xmldata)
set the xml for the entry parses the xml and sets the private members accordingly used to deserialize...
Definition: entryinternal.cpp:417
KNS3::EntryInternal::downloadLinkCount
int downloadLinkCount() const
Definition: entryinternal.cpp:397
KNS3::EntryInternal::name
QString name() const
Retrieve the name of the data object.
Definition: entryinternal.cpp:124
KNS3::EntryInternal::updateVersion
QString updateVersion() const
Retrieve the version string of the object that is available as update.
Definition: entryinternal.cpp:254
KNS3::EntryInternal::setSummary
void setSummary(const QString &summary)
Sets a short description on what the object is all about.
Definition: entryinternal.cpp:199
KNS3::EntryInternal::operator<
bool operator<(const EntryInternal &other) const
Definition: entryinternal.cpp:105
KNS3::EntryInternal::payload
QString payload() const
Retrieve the file name of the object.
Definition: entryinternal.cpp:234
KNS3::EntryInternal::setProviderId
void setProviderId(const QString &id)
Definition: entryinternal.cpp:149
KNS3::EntryInternal::downloadCount
int downloadCount() const
Retrieve the download count for the object, which has been determined by its hosting sites and thus m...
Definition: entryinternal.cpp:294
KNS3::EntryInternal::Source
Source
Source of the entry, A entry's data is coming from either cache, or an online provider this helps the...
Definition: entryinternal.h:64
KNS3::EntryInternal::Cache
@ Cache
Definition: entryinternal.h:65
KNS3::EntryInternal::Online
@ Online
Definition: entryinternal.h:66
KNS3::EntryInternal::Registry
@ Registry
Definition: entryinternal.h:67
KNS3::EntryInternal::setUniqueId
void setUniqueId(const QString &id)
Definition: entryinternal.cpp:139
KNS3::EntryInternal::setPreviewImage
void setPreviewImage(const QImage &image, PreviewType type=PreviewSmall1)
Definition: entryinternal.cpp:279
KNS3::EntryInternal::setPayload
void setPayload(const QString &url)
Sets the object's file.
Definition: entryinternal.cpp:239
KNS3::EntryInternal::entryXML
QDomElement entryXML() const
get the xml string for the entry
Definition: entryinternal.cpp:510
KNS3::EntryInternal::List
QList< EntryInternal > List
Definition: entryinternal.h:57
KNS3::EntryInternal::setDonationLink
void setDonationLink(const QString &link)
Definition: entryinternal.cpp:319
KNS3::EntryInternal::clearDownloadLinkInformation
void clearDownloadLinkInformation()
Definition: entryinternal.cpp:412
KNS3::EntryInternal::setPreviewUrl
void setPreviewUrl(const QString &url, PreviewType type=PreviewSmall1)
Sets the object's preview file, if available.
Definition: entryinternal.cpp:269
KNS3::EntryInternal::installedFiles
QStringList installedFiles() const
Retrieve the locally installed files.
Definition: entryinternal.cpp:382
KNS3::EntryInternal::previewUrl
QString previewUrl(PreviewType type=PreviewSmall1) const
Retrieve the file name of an image containing a preview of the object.
Definition: entryinternal.cpp:264
KNS3::EntryInternal::setNumberKnowledgebaseEntries
void setNumberKnowledgebaseEntries(int num)
Definition: entryinternal.cpp:328
KNS3::EntryInternal::setDownloadCount
void setDownloadCount(int downloads)
Sets the number of downloads.
Definition: entryinternal.cpp:299
KNS3::EntryInternal::setNumberFans
void setNumberFans(int fans)
Definition: entryinternal.cpp:309
KNS3::EntryInternal::setName
void setName(const QString &name)
Sets the name for this data object.
Definition: entryinternal.cpp:129
KNS3::EntryInternal::setStatus
void setStatus(Entry::Status status)
Returns the checksum for the entry.
Definition: entryinternal.cpp:372
KNS3::EntryInternal::setRating
void setRating(int rating)
Sets the rating between 0 (worst) and 100 (best).
Definition: entryinternal.cpp:289
KNS3::EntryInternal::author
Author author() const
Retrieve the author of the object.
Definition: entryinternal.cpp:174
KNS3::EntryInternal::PreviewType
PreviewType
Definition: entryinternal.h:70
KNS3::EntryInternal::PreviewBig1
@ PreviewBig1
Definition: entryinternal.h:74
KNS3::EntryInternal::PreviewSmall1
@ PreviewSmall1
Definition: entryinternal.h:71
KNS3::EntryInternal::PreviewSmall3
@ PreviewSmall3
Definition: entryinternal.h:73
KNS3::EntryInternal::PreviewSmall2
@ PreviewSmall2
Definition: entryinternal.h:72
KNS3::EntryInternal::PreviewBig3
@ PreviewBig3
Definition: entryinternal.h:76
KNS3::EntryInternal::PreviewBig2
@ PreviewBig2
Definition: entryinternal.h:75
KNS3::EntryInternal::status
Entry::Status status() const
Retrieves the entry's status.
Definition: entryinternal.cpp:367
KNS3::EntryInternal::releaseDate
QDate releaseDate() const
Retrieve the date of the object's publication.
Definition: entryinternal.cpp:224
KNS3::EntryInternal::providerId
QString providerId() const
The id of the provider this entry belongs to.
Definition: entryinternal.cpp:144
KNS3::EntryInternal::setAuthor
void setAuthor(const Author &author)
Sets the author of the object.
Definition: entryinternal.cpp:179
KNS3::EntryInternal::rating
int rating() const
Retrieve the rating for the object, which has been determined by its users and thus might change over...
Definition: entryinternal.cpp:284
KNS3::EntryInternal::summary
QString summary() const
Retrieve a short description about the object.
Definition: entryinternal.cpp:194
KNS3::EntryInternal::numberFans
int numberFans() const
Definition: entryinternal.cpp:304
KNS3::EntryInternal::setHomepage
void setHomepage(const KUrl &page)
Definition: entryinternal.cpp:169
KNS3::EntryInternal::previewImage
QImage previewImage(PreviewType type=PreviewSmall1) const
This will not be loaded automatically, instead use Engine to load the actual images.
Definition: entryinternal.cpp:274
KNS3::EntryInternal::numberKnowledgebaseEntries
int numberKnowledgebaseEntries() const
Definition: entryinternal.cpp:324
KNS3::EntryInternal::setKnowledgebaseLink
void setKnowledgebaseLink(const QString &link)
Definition: entryinternal.cpp:337
KNS3::EntryInternal::setInstalledFiles
void setInstalledFiles(const QStringList &files)
Set the files that have been installed by the install command.
Definition: entryinternal.cpp:377
KNS3::EntryInternal::setLicense
void setLicense(const QString &license)
Sets the license (abbreviation) applicable to the object.
Definition: entryinternal.cpp:189
KNS3::EntryInternal::uninstalledFiles
QStringList uninstalledFiles() const
Retrieve the locally uninstalled files.
Definition: entryinternal.cpp:392
KNS3::EntryInternal::setChangelog
void setChangelog(const QString &changelog)
The user written changelog.
Definition: entryinternal.cpp:204
KNS3::EntryInternal::downloadLinkInformationList
QList< DownloadLinkInformation > downloadLinkInformationList() const
Definition: entryinternal.cpp:402
KNS3::EntryInternal::uniqueId
QString uniqueId() const
Definition: entryinternal.cpp:134
KNS3::EntryInternal::category
QString category() const
Retrieve the category of the data object.
Definition: entryinternal.cpp:154
KNS3::EntryInternal::setCategory
void setCategory(const QString &category)
Sets the data category, e.g.
Definition: entryinternal.cpp:159
KNS3::EntryInternal::updateReleaseDate
QDate updateReleaseDate() const
Retrieve the date of the newer version that is available as update.
Definition: entryinternal.cpp:244
KNS3::EntryInternal::isValid
bool isValid() const
Definition: entryinternal.cpp:119
KNS3::EntryInternal::changelog
QString changelog() const
Definition: entryinternal.cpp:209
KNS3::EntryInternal::toEntry
Entry toEntry() const
Definition: entryinternal.cpp:574
KNS3::EntryInternal::operator=
EntryInternal & operator=(const EntryInternal &other)
Definition: entryinternal.cpp:99
KNS3::Entry
KNewStuff information about changed entries.
Definition: knewstuff3/entry.h:45
KNS3::Entry::Status
Status
Status of the entry.
Definition: knewstuff3/entry.h:58
KUrl
QList
author.h
entry.h
kurl.h
KNS3
Definition: atticaprovider.cpp:36
KNS3::PreviewHeight
static const int PreviewHeight
Definition: entryinternal.h:37
KNS3::PreviewWidth
static const int PreviewWidth
Definition: entryinternal.h:36
KNS3::replaceBBCode
QString replaceBBCode(const QString &unformattedText)
function to remove bb code formatting that opendesktop sends
Definition: entryinternal.cpp:586
KNS3::qHash
uint qHash(const KNS3::EntryInternal &entry)
Definition: entryinternal.h:417
KNS3::EntryInternal::DownloadLinkInformation
Definition: entryinternal.h:79
KNS3::EntryInternal::DownloadLinkInformation::distributionType
QString distributionType
Definition: entryinternal.h:82
KNS3::EntryInternal::DownloadLinkInformation::id
int id
Definition: entryinternal.h:84
KNS3::EntryInternal::DownloadLinkInformation::descriptionLink
QString descriptionLink
Definition: entryinternal.h:83
KNS3::EntryInternal::DownloadLinkInformation::priceAmount
QString priceAmount
Definition: entryinternal.h:81
KNS3::EntryInternal::DownloadLinkInformation::isDownloadtypeLink
bool isDownloadtypeLink
Definition: entryinternal.h:85
KNS3::EntryInternal::DownloadLinkInformation::name
QString name
Definition: entryinternal.h:80
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNewStuff

Skip menu "KNewStuff"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal