You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
283 lines
6.7 KiB
283 lines
6.7 KiB
15 years ago
|
/*
|
||
|
This file is part of KOrganizer.
|
||
|
Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
|
||
10 years ago
|
Copyright (c) 2014 Timothy Pearson <kb9vqf@pearsoncomputing.net>
|
||
15 years ago
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
#ifndef KNEWSTUFF_ENTRY_H
|
||
|
#define KNEWSTUFF_ENTRY_H
|
||
|
|
||
14 years ago
|
#include <tqdatetime.h>
|
||
|
#include <tqdom.h>
|
||
|
#include <tqmap.h>
|
||
|
#include <tqstring.h>
|
||
|
#include <tqstringlist.h>
|
||
15 years ago
|
|
||
|
#include <kurl.h>
|
||
|
|
||
|
namespace KNS {
|
||
|
|
||
|
/**
|
||
10 years ago
|
* @short TDENewStuff data entry container.
|
||
15 years ago
|
*
|
||
|
* This class provides accessor methods to the data objects
|
||
10 years ago
|
* as used by TDENewStuff.
|
||
15 years ago
|
* It should probably not be used directly by the application.
|
||
|
*
|
||
|
* @author Cornelius Schumacher (schumacher@kde.org)
|
||
|
* \par Maintainer:
|
||
|
* Josef Spillner (spillner@kde.org)
|
||
|
*/
|
||
|
class KDE_EXPORT Entry
|
||
|
{
|
||
|
public:
|
||
|
Entry();
|
||
|
/**
|
||
|
* Constructor.
|
||
|
*/
|
||
14 years ago
|
Entry( const TQDomElement & );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Destructor.
|
||
|
*/
|
||
|
~Entry();
|
||
|
|
||
|
/**
|
||
|
* Sets the (unique) name for this data object.
|
||
|
*/
|
||
14 years ago
|
void setName( const TQString & );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Sets the (internationalised) name for this data object.
|
||
|
*/
|
||
14 years ago
|
void setName( const TQString &, const TQString & );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Retrieve the name of the data object.
|
||
|
*
|
||
|
* @return object name
|
||
|
*/
|
||
14 years ago
|
TQString name() const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Retrieve the internationalised name of the data object.
|
||
|
*
|
||
|
* @return object name (potentially translated)
|
||
|
*/
|
||
14 years ago
|
TQString name( const TQString &lang ) const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Sets the application type, e.g. 'kdesktop/wallpaper'.
|
||
|
*/
|
||
14 years ago
|
void setType( const TQString & );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Retrieve the type of the data object.
|
||
|
*
|
||
|
* @return object type
|
||
|
*/
|
||
14 years ago
|
TQString type() const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Sets the full name of the object's author.
|
||
|
*/
|
||
14 years ago
|
void setAuthor( const TQString & );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Retrieve the author's name of the object.
|
||
|
*
|
||
|
* @return object author
|
||
|
*/
|
||
14 years ago
|
TQString author() const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Sets the email address of the object's author.
|
||
|
*/
|
||
14 years ago
|
void setAuthorEmail( const TQString & );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Retrieve the author's email address of the object.
|
||
|
*
|
||
|
* @return object author email address
|
||
|
*/
|
||
14 years ago
|
TQString authorEmail() const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Sets the license (abbreviation) applicable to the object.
|
||
|
*/
|
||
14 years ago
|
void setLicence( const TQString & );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Retrieve the license name of the object.
|
||
|
*
|
||
|
* @return object license
|
||
|
*/
|
||
14 years ago
|
TQString license() const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Sets a short description on what the object is all about.
|
||
|
*/
|
||
14 years ago
|
void setSummary( const TQString &, const TQString &lang = TQString::null );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Retrieve a short description about the object.
|
||
|
*
|
||
14 years ago
|
* @param lang preferred language, or TQString::null for KDE default
|
||
15 years ago
|
* @return object description
|
||
|
*/
|
||
14 years ago
|
TQString summary( const TQString &lang = TQString::null ) const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Sets the version number.
|
||
|
*/
|
||
14 years ago
|
void setVersion( const TQString & );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Retrieve the version string of the object.
|
||
|
*
|
||
|
* @return object version
|
||
|
*/
|
||
14 years ago
|
TQString version() const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Sets the release number, which is increased for feature-equal objects
|
||
|
* with the same version number, but slightly updated contents.
|
||
|
*/
|
||
|
void setRelease( int );
|
||
|
|
||
|
/**
|
||
|
* Retrieve the release number of the object
|
||
|
*
|
||
|
* @return object release
|
||
|
*/
|
||
|
int release() const;
|
||
|
|
||
|
/**
|
||
|
* Sets the release date.
|
||
|
*/
|
||
14 years ago
|
void setReleaseDate( const TQDate & );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Retrieve the date of the object's publication.
|
||
|
*
|
||
|
* @return object release date
|
||
|
*/
|
||
14 years ago
|
TQDate releaseDate() const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Sets the object's file.
|
||
|
*/
|
||
14 years ago
|
void setPayload( const KURL &, const TQString &lang = TQString::null );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Retrieve the file name of the object.
|
||
|
*
|
||
14 years ago
|
* @param lang preferred language, or TQString::null for KDE default
|
||
15 years ago
|
* @return object filename
|
||
|
*/
|
||
14 years ago
|
KURL payload( const TQString &lang = TQString::null ) const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Sets the object's preview file, if available. This should be a
|
||
|
* picture file.
|
||
|
*/
|
||
14 years ago
|
void setPreview( const KURL &, const TQString &lang = TQString::null );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Retrieve the file name of an image containing a preview of the object.
|
||
|
*
|
||
14 years ago
|
* @param lang preferred language, or TQString::null for KDE default
|
||
15 years ago
|
* @return object preview filename
|
||
|
*/
|
||
14 years ago
|
KURL preview( const TQString &lang = TQString::null ) const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Sets the rating between 0 (worst) and 10 (best).
|
||
|
*
|
||
|
* @internal
|
||
|
*/
|
||
|
void setRating( int );
|
||
|
|
||
|
/**
|
||
|
* Retrieve the rating for the object, which has been determined by its
|
||
|
* users and thus might change over time.
|
||
|
*
|
||
|
* @return object rating
|
||
|
*/
|
||
|
int rating();
|
||
|
|
||
|
/**
|
||
|
* Sets the number of downloads.
|
||
|
*
|
||
|
* @internal
|
||
|
*/
|
||
|
void setDownloads( int );
|
||
|
|
||
|
/**
|
||
|
* Retrieve the download count for the object, which has been determined
|
||
|
* by its hosting sites and thus might change over time.
|
||
|
*
|
||
|
* @return object download count
|
||
|
*/
|
||
|
int downloads();
|
||
|
|
||
|
/**
|
||
|
* Return the full name for the meta information. It is constructed as
|
||
|
* name-version-release.
|
||
|
*/
|
||
14 years ago
|
TQString fullName();
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Return the list of languages this object supports.
|
||
|
*/
|
||
14 years ago
|
TQStringList langs();
|
||
15 years ago
|
|
||
|
/**
|
||
|
* @internal
|
||
|
*/
|
||
14 years ago
|
void parseDomElement( const TQDomElement & );
|
||
15 years ago
|
|
||
|
/**
|
||
|
* @internal
|
||
|
*/
|
||
14 years ago
|
TQDomElement createDomElement( TQDomDocument &, TQDomElement &parent );
|
||
15 years ago
|
|
||
|
protected:
|
||
14 years ago
|
TQDomElement addElement( TQDomDocument &doc, TQDomElement &parent,
|
||
|
const TQString &tag, const TQString &value );
|
||
15 years ago
|
|
||
|
private:
|
||
14 years ago
|
TQString mName;
|
||
|
TQString mType;
|
||
|
TQString mAuthor;
|
||
|
TQString mLicence;
|
||
|
TQMap<TQString,TQString> mSummaryMap;
|
||
|
TQString mVersion;
|
||
15 years ago
|
int mRelease;
|
||
14 years ago
|
TQDate mReleaseDate;
|
||
|
TQMap<TQString,KURL> mPayloadMap;
|
||
|
TQMap<TQString,KURL> mPreviewMap;
|
||
15 years ago
|
int mRating;
|
||
|
int mDownloads;
|
||
|
|
||
14 years ago
|
TQStringList mLangs;
|
||
15 years ago
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
#endif
|