• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.5 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 
34 namespace KNS3
35 {
36  static const int PreviewWidth = 96;
37  static const int PreviewHeight = 72;
38 
42  QString replaceBBCode(const QString& unformattedText);
43 
54 class EntryInternal
55 {
56 public:
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);
412 private:
413  class Private;
414  QExplicitlySharedDataPointer<Private> d;
415 };
416 
417 inline uint qHash(const KNS3::EntryInternal& entry) {
418  return qHash(entry.uniqueId());
419 }
420 
421 }
422 
423 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Fri Jul 12 2013 08:55:13 by doxygen 1.8.3.1 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.10.5 API Reference

Skip menu "kdelibs-4.10.5 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