File indexing completed on 2025-01-05 03:53:36
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2011-03-22 0007 * Description : a Iface C++ interface 0008 * 0009 * SPDX-FileCopyrightText: 2011-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * SPDX-FileCopyrightText: 2011 by Joris Munoz <munozjoris at gmail dot com> 0011 * 0012 * SPDX-License-Identifier: GPL-2.0-or-later 0013 * 0014 * ============================================================ */ 0015 0016 #include "mediawiki_page.h" 0017 0018 // C++ includes 0019 0020 #include <algorithm> 0021 0022 // Qt includes 0023 0024 0025 namespace MediaWiki 0026 { 0027 0028 class Q_DECL_HIDDEN Page::Private 0029 { 0030 public: 0031 0032 unsigned int m_pageid; 0033 unsigned int m_ns; 0034 unsigned int m_lastrevid; 0035 unsigned int m_counter; 0036 unsigned int m_length; 0037 unsigned int m_talkid; 0038 QString m_edittoken; 0039 QString m_title; 0040 QString m_readable; 0041 QString m_preload; 0042 QUrl m_fullurl; 0043 QUrl m_editurl; 0044 QDateTime m_touched; 0045 QDateTime m_starttimestamp; 0046 }; 0047 0048 Page::Page() 0049 : d(new Private()) 0050 { 0051 } 0052 0053 Page::~Page() 0054 { 0055 delete d; 0056 } 0057 0058 Page::Page( const Page& other) 0059 : d(new Private(*(other.d))) 0060 { 0061 } 0062 0063 Page& Page::operator=(const Page& other) 0064 { 0065 *d = *other.d; 0066 0067 return *this; 0068 } 0069 0070 bool Page::operator==(const Page& other) const 0071 { 0072 return ( 0073 (pageId() == other.pageId()) && 0074 (pageTitle() == other.pageTitle()) && 0075 (pageNs() == other.pageNs()) && 0076 (pageLastRevId() == other.pageLastRevId()) && 0077 (pageCounter() == other.pageCounter()) && 0078 (pageLength() == other.pageLength()) && 0079 (pageEditToken() == other.pageEditToken()) && 0080 (pageTalkid() == other.pageTalkid()) && 0081 (pageFullurl() == other.pageFullurl()) && 0082 (pageEditurl() == other.pageEditurl()) && 0083 (pageReadable() == other.pageReadable()) && 0084 (pagePreload() == other.pagePreload()) && 0085 (pageTouched() == other.pageTouched()) && 0086 (pageStarttimestamp() == other.pageStarttimestamp()) 0087 ); 0088 } 0089 0090 void Page::setPageId(unsigned int id) 0091 { 0092 d->m_pageid = id; 0093 } 0094 0095 unsigned int Page::pageId() const 0096 { 0097 return d->m_pageid; 0098 } 0099 0100 void Page::setTitle(const QString& title) 0101 { 0102 d->m_title = title; 0103 } 0104 0105 QString Page::pageTitle() const 0106 { 0107 return d->m_title; 0108 } 0109 0110 void Page::setNs(unsigned int ns) const 0111 { 0112 d->m_ns = ns; 0113 } 0114 0115 unsigned int Page::pageNs() const 0116 { 0117 return d->m_ns; 0118 } 0119 0120 void Page::setLastRevId(unsigned int lastRevId) const 0121 { 0122 d->m_lastrevid = lastRevId; 0123 } 0124 0125 unsigned int Page::pageLastRevId() const 0126 { 0127 return d->m_lastrevid; 0128 } 0129 0130 void Page::setCounter(unsigned int counter) const 0131 { 0132 d->m_counter = counter; 0133 } 0134 0135 unsigned int Page::pageCounter() const 0136 { 0137 return d->m_counter; 0138 } 0139 0140 void Page::setLength(unsigned int length) const 0141 { 0142 d->m_length = length; 0143 } 0144 0145 unsigned int Page::pageLength() const 0146 { 0147 return d->m_length; 0148 } 0149 0150 void Page::setEditToken(const QString& editToken) 0151 { 0152 d->m_edittoken = editToken; 0153 } 0154 0155 QString Page::pageEditToken() const 0156 { 0157 return d->m_edittoken; 0158 } 0159 0160 void Page::setTalkid(unsigned int talkid) const 0161 { 0162 d->m_talkid = talkid; 0163 } 0164 0165 unsigned int Page::pageTalkid() const 0166 { 0167 return d->m_talkid; 0168 } 0169 0170 void Page::setFullurl(const QUrl& fullurl) 0171 { 0172 d->m_fullurl = fullurl; 0173 } 0174 0175 QUrl Page::pageFullurl() const 0176 { 0177 return d->m_fullurl; 0178 } 0179 0180 void Page::setEditurl(const QUrl& editurl) 0181 { 0182 d->m_editurl = editurl; 0183 } 0184 0185 QUrl Page::pageEditurl() const 0186 { 0187 return d->m_editurl; 0188 } 0189 0190 void Page::setReadable(const QString& readable) 0191 { 0192 d->m_readable = readable; 0193 } 0194 0195 QString Page::pageReadable() const 0196 { 0197 return d->m_readable; 0198 } 0199 0200 void Page::setPreload(const QString& preload) 0201 { 0202 d->m_preload = preload; 0203 } 0204 0205 QString Page::pagePreload() const 0206 { 0207 return d->m_preload; 0208 } 0209 0210 void Page::setTouched(const QDateTime& touched) 0211 { 0212 d->m_touched = touched; 0213 } 0214 0215 QDateTime Page::pageTouched() const 0216 { 0217 return d->m_touched; 0218 } 0219 0220 void Page::setStarttimestamp(const QDateTime& starttimestamp) 0221 { 0222 d->m_starttimestamp = starttimestamp; 0223 } 0224 0225 QDateTime Page::pageStarttimestamp() const 0226 { 0227 return d->m_starttimestamp; 0228 } 0229 0230 } // namespace MediaWiki;