KNewStuff
entry.cpp
Go to the documentation of this file.00001 /* 00002 This file is part of KNewStuff2. 00003 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 00004 Copyright (c) 2003 - 2007 Josef Spillner <spillner@kde.org> 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 00022 #include "entry.h" 00023 00024 using namespace KNS; 00025 00026 struct KNS::EntryPrivate { 00027 EntryPrivate() : mReleaseDate(QDate::currentDate()) 00028 , mRelease(0) 00029 , mRating(0) 00030 , mDownloads(0) 00031 , mStatus(Entry::Invalid) 00032 , mSource(Entry::Online) 00033 , mIdNumber(0) {} 00034 00035 QString mCategory; 00036 QString mLicense; 00037 QString mVersion; 00038 QDate mReleaseDate; 00039 Author mAuthor; 00040 int mRelease; 00041 int mRating; 00042 int mDownloads; 00043 KTranslatable mName; 00044 KTranslatable mSummary; 00045 KTranslatable mPayload; 00046 KTranslatable mPreview; 00047 QStringList mInstalledFiles; 00048 int mIdNumber; 00049 QStringList mUnInstalledFiles; 00050 00051 QString mChecksum; 00052 QString mSignature; 00053 Entry::Status mStatus; 00054 Entry::Source mSource; 00055 }; 00056 00057 Entry::Entry() 00058 : d(new EntryPrivate) 00059 { 00060 } 00061 00062 Entry::Entry(const Entry& other) 00063 : d(new EntryPrivate(*other.d)) 00064 { 00065 } 00066 00067 Entry& Entry::operator=(const Entry & other) 00068 { 00069 *d = *other.d; 00070 return *this; 00071 } 00072 00073 Entry::~Entry() 00074 { 00075 delete d; 00076 } 00077 00078 void Entry::setName(const KTranslatable& name) 00079 { 00080 d->mName = name; 00081 } 00082 00083 KTranslatable Entry::name() const 00084 { 00085 return d->mName; 00086 } 00087 00088 void Entry::setCategory(const QString& category) 00089 { 00090 d->mCategory = category; 00091 } 00092 00093 QString Entry::category() const 00094 { 00095 return d->mCategory; 00096 } 00097 00098 void Entry::setAuthor(const Author &author) 00099 { 00100 d->mAuthor = author; 00101 } 00102 00103 Author Entry::author() const 00104 { 00105 return d->mAuthor; 00106 } 00107 00108 void Entry::setLicense(const QString &license) 00109 { 00110 d->mLicense = license; 00111 } 00112 00113 QString Entry::license() const 00114 { 00115 return d->mLicense; 00116 } 00117 00118 void Entry::setSummary(const KTranslatable &text) 00119 { 00120 d->mSummary = text; 00121 } 00122 00123 KTranslatable Entry::summary() const 00124 { 00125 return d->mSummary; 00126 } 00127 00128 void Entry::setVersion(const QString& version) 00129 { 00130 d->mVersion = version; 00131 } 00132 00133 QString Entry::version() const 00134 { 00135 return d->mVersion; 00136 } 00137 00138 void Entry::setRelease(int release) 00139 { 00140 d->mRelease = release; 00141 } 00142 00143 int Entry::release() const 00144 { 00145 return d->mRelease; 00146 } 00147 00148 void Entry::setReleaseDate(const QDate& date) 00149 { 00150 d->mReleaseDate = date; 00151 } 00152 00153 QDate Entry::releaseDate() const 00154 { 00155 return d->mReleaseDate; 00156 } 00157 00158 void Entry::setPayload(const KTranslatable& url) 00159 { 00160 d->mPayload = url; 00161 } 00162 00163 KTranslatable Entry::payload() const 00164 { 00165 return d->mPayload; 00166 } 00167 00168 void Entry::setPreview(const KTranslatable& url) 00169 { 00170 d->mPreview = url; 00171 } 00172 00173 KTranslatable Entry::preview() const 00174 { 00175 return d->mPreview; 00176 } 00177 00178 void Entry::setRating(int rating) 00179 { 00180 d->mRating = rating; 00181 } 00182 00183 int Entry::rating() const 00184 { 00185 return d->mRating; 00186 } 00187 00188 void Entry::setDownloads(int downloads) 00189 { 00190 d->mDownloads = downloads; 00191 } 00192 00193 int Entry::downloads() const 00194 { 00195 return d->mDownloads; 00196 } 00197 00198 void Entry::setChecksum(const QString& checksum) 00199 { 00200 d->mChecksum = checksum; 00201 } 00202 00203 QString Entry::checksum() const 00204 { 00205 return d->mChecksum; 00206 } 00207 00208 void Entry::setSignature(const QString& signature) 00209 { 00210 d->mSignature = signature; 00211 } 00212 00213 QString Entry::signature() const 00214 { 00215 return d->mSignature; 00216 } 00217 00218 Entry::Status Entry::status() 00219 { 00220 return d->mStatus; 00221 } 00222 00223 void Entry::setStatus(Status status) 00224 { 00225 d->mStatus = status; 00226 } 00227 00228 Entry::Source Entry::source() 00229 { 00230 return d->mSource; 00231 } 00232 00233 void Entry::setSource(Source source) 00234 { 00235 d->mSource = source; 00236 } 00237 00238 void KNS::Entry::setInstalledFiles(const QStringList & files) 00239 { 00240 d->mInstalledFiles = files; 00241 } 00242 00243 QStringList KNS::Entry::installedFiles() const 00244 { 00245 return d->mInstalledFiles; 00246 } 00247 00248 void Entry::setIdNumber(int number) 00249 { 00250 d->mIdNumber = number; 00251 } 00252 00253 int Entry::idNumber() const 00254 { 00255 return d->mIdNumber; 00256 } 00257 00258 void KNS::Entry::setUnInstalledFiles(const QStringList & files) 00259 { 00260 d->mUnInstalledFiles = files; 00261 } 00262 00263 QStringList KNS::Entry::uninstalledFiles() const 00264 { 00265 return d->mUnInstalledFiles; 00266 } 00267