# knewstuff Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KNS::Entry Class Reference

KNewStuff data entry container. More...

`#include <entry.h>`

Collaboration diagram for KNS::Entry:

[legend]
List of all members.

## Public Member Functions

| Entry (const QDomElement &)
| ~Entry ()
void | setName (const QString &)
QString | name () const
void | setType (const QString &)
QString | type () const
void | setAuthor (const QString &)
QString | author () const
void | setLicence (const QString &)
QString | license () const
void | setSummary (const QString &, const QString &lang=QString::null)
QString | summary (const QString &lang=QString::null) const
void | setVersion (const QString &)
QString | version () const
void | setRelease (int)
int | release () const
void | setReleaseDate (const QDate &)
QDate | releaseDate () const
void | setPayload (const KURL &, const QString &lang=QString::null)
KURL | payload (const QString &lang=QString::null) const
void | setPreview (const KURL &, const QString &lang=QString::null)
KURL | preview (const QString &lang=QString::null) const
void | setRating (int)
int | rating ()
void | setDownloads (int)
int | downloads ()
QString | fullName ()
QStringList | langs ()
void | parseDomElement (const QDomElement &)
QDomElement | createDomElement (QDomDocument &, QDomElement &parent)

## Protected Member Functions

QDomElement | addElement (QDomDocument &doc, QDomElement &parent, const QString &tag, const QString &value)

## Detailed Description

KNewStuff data entry container.

This class provides accessor methods to the data objects as used by KNewStuff. It should probably not be used directly by the application.

Author:
  Cornelius Schumacher (schumacher@kde.org)

Maintainer:
  Josef Spillner (spillner@kde.org)

Definition at line 44 of file entry.h.

## Constructor & Destructor Documentation

Entry::Entry | ( | const QDomElement & |  | ) |

| Constructor. Definition at line 34 of file entry.cpp.

Entry::~Entry | ( |  | ) |

| Destructor. Definition at line 40 of file entry.cpp.

## Member Function Documentation

void Entry::setName | ( | const QString & |  | ) |

| Sets the (unique) name for this data object. Definition at line 45 of file entry.cpp. References name().

QString Entry::name | ( |  | ) | const

Retrieve the name of the data object.

Returns:
  object name

Definition at line 50 of file entry.cpp.

Referenced by fullName(), and setName().

void Entry::setType | ( | const QString & |  | ) |

| Sets the application type, e.g. 'kdesktop/wallpaper'. Definition at line 56 of file entry.cpp. References type().

QString Entry::type | ( |  | ) | const

Retrieve the type of the data object.

Returns:
  object type

Definition at line 61 of file entry.cpp.

Referenced by setType().

void Entry::setAuthor | ( | const QString & |  | ) |

| Sets the full name of the object's author. Definition at line 67 of file entry.cpp. References author().

QString Entry::author | ( |  | ) | const

Retrieve the author's name of the object.

Returns:
  object author

Definition at line 72 of file entry.cpp.

Referenced by setAuthor().

void Entry::setLicence | ( | const QString & |  | ) |

| Sets the license (abbreviation) applicable to the object. Definition at line 78 of file entry.cpp. References license().

QString Entry::license | ( |  | ) | const

Retrieve the license name of the object.

Returns:
  object license

Definition at line 83 of file entry.cpp.

Referenced by setLicence().

void Entry::setSummary | ( | const QString & | ,
|  | const QString & | lang = `QString::null`
| ) |

| Sets a short description on what the object is all about. Definition at line 89 of file entry.cpp. References QMap::insert().

QString Entry::summary | ( | const QString & | lang = `QString::null` | ) | const

Retrieve a short description about the object.

Parameters:

  | lang | preferred language, or QString::null for KDE default

Returns:
  object description

Definition at line 96 of file entry.cpp.

References QMap::begin(), QMap::isEmpty(), and langs().

void Entry::setVersion | ( | const QString & |  | ) |

| Sets the version number. Definition at line 111 of file entry.cpp. References version().

QString Entry::version | ( |  | ) | const

Retrieve the version string of the object.

Returns:
  object version

Definition at line 116 of file entry.cpp.

Referenced by fullName(), and setVersion().

void Entry::setRelease | ( | int |  | ) |

| Sets the release number, which is increased for feature-equal objects with the same version number, but slightly updated contents. Definition at line 122 of file entry.cpp.

int Entry::release | ( |  | ) | const

Retrieve the release number of the object.

Returns:
  object release

Definition at line 127 of file entry.cpp.

Referenced by fullName().

void Entry::setReleaseDate | ( | const QDate & |  | ) |

| Sets the release date. Definition at line 133 of file entry.cpp.

QDate Entry::releaseDate | ( |  | ) | const

Retrieve the date of the object's publication.

Returns:
  object release date

Definition at line 138 of file entry.cpp.

void Entry::setPayload | ( | const KURL & | ,
|  | const QString & | lang = `QString::null`
| ) |

| Sets the object's file. Definition at line 144 of file entry.cpp. References QMap::insert().

KURL Entry::payload | ( | const QString & | lang = `QString::null` | ) | const

Retrieve the file name of the object.

Parameters:

  | lang | preferred language, or QString::null for KDE default

Returns:
  object filename

Definition at line 151 of file entry.cpp.

References QMap::begin(), QMap::isEmpty(), langs(), and payload().

Referenced by payload().

void Entry::setPreview | ( | const KURL & | ,
|  | const QString & | lang = `QString::null`
| ) |

| Sets the object's preview file, if available. This should be a picture file. Definition at line 167 of file entry.cpp. References QMap::insert().

KURL Entry::preview | ( | const QString & | lang = `QString::null` | ) | const

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

Parameters:

  | lang | preferred language, or QString::null for KDE default

Returns:
  object preview filename

Definition at line 174 of file entry.cpp.

References QMap::begin(), QMap::isEmpty(), langs(), and preview().

Referenced by preview().

void Entry::setRating | ( | int |  | ) |

| Sets the rating between 0 (worst) and 10 (best). Definition at line 190 of file entry.cpp.

int Entry::rating | ( |  | ) |

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 195 of file entry.cpp.

void Entry::setDownloads | ( | int |  | ) |

| Sets the number of downloads. Definition at line 201 of file entry.cpp.

int Entry::downloads | ( |  | ) |

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 206 of file entry.cpp.

QString Entry::fullName | ( |  | ) |

| Return the full name for the meta information. It is constructed as name-version-release. Definition at line 211 of file entry.cpp. References name(), QString::number(), release(), and version().

QStringList Entry::langs | ( |  | ) |

| Return the list of languages this object supports. Definition at line 216 of file entry.cpp. Referenced by payload(), preview(), and summary().

The documentation for this class was generated from the following files:

- entry.h
- entry.cpp

This file is part of the documentation for knewstuff Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:28:45 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003