entry.h
00001 /* 00002 This file is part of KOrganizer. 00003 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 00004 Copyright (c) 2014 Timothy Pearson <kb9vqf@pearsoncomputing.net> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 #ifndef KNEWSTUFF_ENTRY_H 00022 #define KNEWSTUFF_ENTRY_H 00023 00024 #include <tqdatetime.h> 00025 #include <tqdom.h> 00026 #include <tqmap.h> 00027 #include <tqstring.h> 00028 #include <tqstringlist.h> 00029 00030 #include <kurl.h> 00031 00032 namespace KNS { 00033 00045 class KDE_EXPORT Entry 00046 { 00047 public: 00048 Entry(); 00052 Entry( const TQDomElement & ); 00053 00057 ~Entry(); 00058 00062 void setName( const TQString & ); 00063 00067 void setName( const TQString &, const TQString & ); 00068 00074 TQString name() const; 00075 00081 TQString name( const TQString &lang ) const; 00082 00086 void setType( const TQString & ); 00087 00093 TQString type() const; 00094 00098 void setAuthor( const TQString & ); 00099 00105 TQString author() const; 00106 00110 void setAuthorEmail( const TQString & ); 00111 00117 TQString authorEmail() const; 00118 00122 void setLicence( const TQString & ); 00123 00129 TQString license() const; 00130 00134 void setSummary( const TQString &, const TQString &lang = TQString::null ); 00135 00142 TQString summary( const TQString &lang = TQString::null ) const; 00143 00147 void setVersion( const TQString & ); 00148 00154 TQString version() const; 00155 00160 void setRelease( int ); 00161 00167 int release() const; 00168 00172 void setReleaseDate( const TQDate & ); 00173 00179 TQDate releaseDate() const; 00180 00184 void setPayload( const KURL &, const TQString &lang = TQString::null ); 00185 00192 KURL payload( const TQString &lang = TQString::null ) const; 00193 00198 void setPreview( const KURL &, const TQString &lang = TQString::null ); 00199 00206 KURL preview( const TQString &lang = TQString::null ) const; 00207 00213 void setRating( int ); 00214 00221 int rating(); 00222 00228 void setDownloads( int ); 00229 00236 int downloads(); 00237 00242 TQString fullName(); 00243 00247 TQStringList langs(); 00248 00252 void parseDomElement( const TQDomElement & ); 00253 00257 TQDomElement createDomElement( TQDomDocument &, TQDomElement &parent ); 00258 00259 protected: 00260 TQDomElement addElement( TQDomDocument &doc, TQDomElement &parent, 00261 const TQString &tag, const TQString &value ); 00262 00263 private: 00264 TQString mName; 00265 TQString mType; 00266 TQString mAuthor; 00267 TQString mLicence; 00268 TQMap<TQString,TQString> mSummaryMap; 00269 TQString mVersion; 00270 int mRelease; 00271 TQDate mReleaseDate; 00272 TQMap<TQString,KURL> mPayloadMap; 00273 TQMap<TQString,KURL> mPreviewMap; 00274 int mRating; 00275 int mDownloads; 00276 00277 TQStringList mLangs; 00278 }; 00279 00280 } 00281 00282 #endif