File indexing completed on 2024-03-24 16:13:23

0001 /** ===========================================================
0002  * @file
0003  *
0004  * This file is a part of KDE project
0005  * <a href="https://commits.kde.org/libmediawiki">libmediawiki</a>
0006  *
0007  * @date   2011-03-22
0008  * @brief  a MediaWiki C++ interface for KDE
0009  *
0010  * @author Copyright (C) 2011-2012 by Gilles Caulier
0011  *         <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
0012  * @author Copyright (C) 2011 by Manuel Campomanes
0013  *         <a href="mailto:campomanes dot manuel at gmail dot com">campomanes dot manuel at gmail dot com</a>
0014  *
0015  * This program is free software; you can redistribute it
0016  * and/or modify it under the terms of the GNU General
0017  * Public License as published by the Free Software Foundation;
0018  * either version 2, or (at your option)
0019  * any later version.
0020  *
0021  * This program is distributed in the hope that it will be useful,
0022  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0024  * GNU General Public License for more details.
0025  *
0026  * ============================================================ */
0027 
0028 #include "generalinfo.h"
0029 
0030 // C++ includes
0031 
0032 #include <algorithm>
0033 
0034 // Local includes
0035 
0036 #include "mediawiki.h"
0037 
0038 namespace mediawiki
0039 {
0040 
0041 class Q_DECL_HIDDEN Generalinfo::GeneralinfoPrivate
0042 {
0043 public:
0044 
0045     QString   mainPage;
0046     QString   siteName;
0047     QString   generator;
0048     QString   phpVersion;
0049     QString   phpApi;
0050     QString   dataBaseType;
0051     QString   dataBaseVersion;
0052     QString   rev;
0053     QString   cas;
0054     QString   licence;
0055     QString   language;
0056     QString   fallBack8bitEncoding;
0057     QString   writeApi;
0058     QString   timeZone;
0059     QString   timeOffset;
0060     QString   articlePath;
0061     QString   scriptPath;
0062     QString   script;
0063     QString   variantArticlePath;
0064     QString   wikiId;
0065 
0066     QUrl      serverUrl;
0067     QUrl      url;
0068 
0069     QDateTime time;
0070 };
0071 
0072 Generalinfo::Generalinfo()
0073     : d(new GeneralinfoPrivate())
0074 {}
0075 
0076 Generalinfo::Generalinfo(const Generalinfo& other)
0077     : d(new GeneralinfoPrivate(*(other.d)))
0078 {}
0079 
0080 Generalinfo::~Generalinfo()
0081 {
0082     delete d;
0083 }
0084 
0085 Generalinfo& Generalinfo::operator=(const Generalinfo& other)
0086 {
0087     *d = *other.d;
0088     return *this;
0089 }
0090 
0091 bool Generalinfo::operator==(const Generalinfo& other) const
0092 {
0093     return mainPage()             == other.mainPage()             &&
0094            url()                  == other.url()                  &&
0095            siteName()             == other.siteName()             &&
0096            generator()            == other.generator()            &&
0097            phpVersion()           == other.phpVersion()           &&
0098            phpApi()               == other.phpApi()               &&
0099            dataBaseType()         == other.dataBaseType()         &&
0100            dataBaseVersion()      == other.dataBaseVersion()      &&
0101            rev()                  == other.rev()                  &&
0102            cas()                  == other.cas()                  &&
0103            licence()              == other.licence()              &&
0104            language()             == other.language()             &&
0105            fallBack8bitEncoding() == other.fallBack8bitEncoding() &&
0106            writeApi()             == other.writeApi()             &&
0107            timeZone()             == other.timeZone()             &&
0108            timeOffset()           == other.timeOffset()           &&
0109            articlePath()          == other.articlePath()          &&
0110            scriptPath()           == other.scriptPath()           &&
0111            script()               == other.script()               &&
0112            variantArticlePath()   == other.variantArticlePath()   &&
0113            serverUrl()            == other.serverUrl()            &&
0114            wikiId()               == other.wikiId()               &&
0115            time()                 == other.time();
0116 }
0117 
0118 QString Generalinfo::mainPage() const
0119 {
0120     return d->mainPage;
0121 }
0122 
0123 void Generalinfo::setMainPage(const QString& mainPage)
0124 {
0125     d->mainPage = mainPage;
0126 }
0127 
0128 QUrl Generalinfo::url() const
0129 {
0130     return d->url;
0131 }
0132 
0133 void Generalinfo::setUrl(const QUrl& url)
0134 {
0135     d->url = url;
0136 }
0137 
0138 QString Generalinfo::siteName() const
0139 {
0140     return d->siteName;
0141 }
0142 
0143 void Generalinfo::setSiteName(const QString& siteName)
0144 {
0145     d->siteName = siteName;
0146 }
0147 
0148 QString Generalinfo::generator() const
0149 {
0150     return d->generator;
0151 }
0152 
0153 void Generalinfo::setGenerator(const QString& generator)
0154 {
0155     d->generator = generator;
0156 }
0157 
0158 QString Generalinfo::phpVersion() const
0159 {
0160     return d->phpVersion;
0161 }
0162 
0163 void Generalinfo::setPhpVersion(const QString& phpVersion)
0164 {
0165     d->phpVersion = phpVersion;
0166 }
0167 
0168 QString Generalinfo::phpApi() const
0169 {
0170     return d->phpApi;
0171 }
0172 
0173 void Generalinfo::setPhpApi(const QString& phpApi)
0174 {
0175     d->phpApi = phpApi;
0176 }
0177 
0178 QString Generalinfo::dataBaseType() const
0179 {
0180     return d->dataBaseType;
0181 }
0182 
0183 void Generalinfo::setDataBaseType(const QString& dataBaseType)
0184 {
0185     d->dataBaseType = dataBaseType;
0186 }
0187 
0188 QString Generalinfo::dataBaseVersion() const
0189 {
0190     return d->dataBaseVersion;
0191 }
0192 
0193 void Generalinfo::setDataBaseVersion(const QString& dataBaseVersion)
0194 {
0195     d->dataBaseVersion = dataBaseVersion;
0196 }
0197 
0198 QString Generalinfo::rev() const
0199 {
0200     return d->rev;
0201 }
0202 
0203 void Generalinfo::setRev(const QString& rev)
0204 {
0205     d->rev = rev;
0206 }
0207 
0208 QString Generalinfo::cas() const
0209 {
0210     return d->cas;
0211 }
0212 
0213 void Generalinfo::setCas(const QString& cas)
0214 {
0215     d->cas = cas;
0216 }
0217 
0218 QString Generalinfo::licence() const
0219 {
0220     return d->licence;
0221 }
0222 
0223 void Generalinfo::setLicence(const QString& licence)
0224 {
0225     d->licence = licence;
0226 }
0227 
0228 QString Generalinfo::language() const
0229 {
0230     return d->language;
0231 }
0232 
0233 void Generalinfo::setLanguage(const QString& language)
0234 {
0235     d->language = language;
0236 }
0237 
0238 QString Generalinfo::fallBack8bitEncoding() const
0239 {
0240     return d->fallBack8bitEncoding;
0241 }
0242 
0243 void Generalinfo::setFallBack8bitEncoding(const QString& fallBack8bitEncoding)
0244 {
0245     d->fallBack8bitEncoding = fallBack8bitEncoding;
0246 }
0247 
0248 QString Generalinfo::writeApi() const
0249 {
0250     return d->writeApi;
0251 }
0252 
0253 void Generalinfo::setWriteApi(const QString& writeApi)
0254 {
0255     d->writeApi = writeApi;
0256 }
0257 
0258 QString Generalinfo::timeZone() const
0259 {
0260     return d->timeZone;
0261 }
0262 
0263 void Generalinfo::setTimeZone(const QString& timeZone)
0264 {
0265     d->timeZone = timeZone;
0266 }
0267 
0268 QString Generalinfo::timeOffset() const
0269 {
0270     return d->timeOffset;
0271 }
0272 
0273 void Generalinfo::setTimeOffset(const QString& timeOffset)
0274 {
0275     d->timeOffset = timeOffset;
0276 }
0277 
0278 QString Generalinfo::articlePath() const
0279 {
0280     return d->articlePath;
0281 }
0282 
0283 void Generalinfo::setArticlePath(const QString& articlePath)
0284 {
0285     d->articlePath = articlePath;
0286 }
0287 
0288 QString Generalinfo::scriptPath() const
0289 {
0290     return d->scriptPath;
0291 }
0292 
0293 void Generalinfo::setScriptPath(const QString& scriptPath)
0294 {
0295     d->scriptPath = scriptPath;
0296 }
0297 
0298 QString Generalinfo::script() const
0299 {
0300     return d->script;
0301 }
0302 
0303 void Generalinfo::setScript(const QString& script)
0304 {
0305     d->script = script;
0306 }
0307 
0308 QString Generalinfo::variantArticlePath() const
0309 {
0310     return d->variantArticlePath;
0311 }
0312 
0313 void Generalinfo::setVariantArticlePath(const QString& variantArticlePath)
0314 {
0315     d->variantArticlePath = variantArticlePath;
0316 }
0317 
0318 QUrl Generalinfo::serverUrl() const
0319 {
0320     return d->serverUrl;
0321 }
0322 
0323 void Generalinfo::setServerUrl(const QUrl& serverUrl)
0324 {
0325     d->serverUrl = serverUrl;
0326 }
0327 
0328 QString Generalinfo::wikiId() const
0329 {
0330     return d->wikiId;
0331 }
0332 
0333 void Generalinfo::setWikiId(const QString& wikiId)
0334 {
0335     d->wikiId = wikiId;
0336 }
0337 
0338 QDateTime Generalinfo::time() const
0339 {
0340     return d->time;
0341 }
0342 
0343 void Generalinfo::setTime(const QDateTime& time)
0344 {
0345     d->time = time;
0346 }
0347 
0348 } // namespace mediawiki