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 #ifndef DIGIKAM_MEDIAWIKI_PAGE_H 0017 #define DIGIKAM_MEDIAWIKI_PAGE_H 0018 0019 // Qt includes 0020 0021 #include <QDateTime> 0022 #include <QUrl> 0023 0024 namespace MediaWiki 0025 { 0026 0027 /** 0028 * @brief An image info. 0029 */ 0030 class Page 0031 { 0032 0033 public: 0034 0035 /** 0036 * @brief Constructs a page. 0037 */ 0038 Page(); 0039 0040 /** 0041 * @brief Constructs a page from an other page. 0042 * @param other an other page 0043 */ 0044 Page(const Page& other); 0045 0046 /** 0047 * @brief Destructs a page. 0048 */ 0049 ~Page(); 0050 0051 /** 0052 * @brief Assigning a page from an other page. 0053 * @param other an other page 0054 */ 0055 Page& operator=(const Page& other); 0056 0057 /** 0058 * @brief Returns true if this instance and other are equal, else false. 0059 * @param other instance to compare 0060 * @return true if there are equal, else false 0061 */ 0062 bool operator==(const Page& other) const; 0063 0064 /** 0065 * @brief Set the pageId of the page. 0066 * @param id the page id of the page 0067 */ 0068 void setPageId(unsigned int id); 0069 0070 /** 0071 * @brief Return the page id of the page. 0072 * @return the page id of the page 0073 */ 0074 unsigned int pageId() const; 0075 0076 /** 0077 * @brief Set the title of the page. 0078 * @param title the title of the page 0079 */ 0080 void setTitle(const QString& title); 0081 0082 /** 0083 * @brief Return the title of the page. 0084 * @return the title of the page 0085 */ 0086 QString pageTitle() const; 0087 0088 /** 0089 * @brief Set the namespace of the page. 0090 * @param ns the namespace of the page 0091 */ 0092 void setNs(unsigned int ns) const; 0093 0094 /** 0095 * @brief Return the namespace of the page. 0096 * @return the namespace of the page 0097 */ 0098 unsigned int pageNs() const; 0099 0100 /** 0101 * @brief Set the last revision id of the page. 0102 * @param lastRevId the last revision id of the page 0103 */ 0104 void setLastRevId(unsigned int lastRevId) const; 0105 0106 /** 0107 * @brief Return the last revision id of the page. 0108 * @return the last revision id of the page 0109 */ 0110 unsigned int pageLastRevId() const; 0111 0112 /** 0113 * @brief Set the number of views of the page. 0114 * @param counter the number of views of the page 0115 */ 0116 void setCounter(unsigned int counter) const; 0117 0118 /** 0119 * @brief Return the number of views of the page. 0120 * @return the number of views of the page 0121 */ 0122 unsigned int pageCounter() const; 0123 0124 /** 0125 * @brief Set the page size. 0126 * @param length the page size 0127 */ 0128 void setLength(unsigned int length) const; 0129 0130 /** 0131 * @brief Return the page size. 0132 * @return the page size 0133 */ 0134 unsigned int pageLength() const; 0135 0136 /** 0137 * @brief Set the page token. 0138 * @param editToken the page token 0139 */ 0140 void setEditToken(const QString& editToken); 0141 0142 /** 0143 * @brief Return the page token. 0144 * @return the page token 0145 */ 0146 QString pageEditToken() const; 0147 0148 /** 0149 * @brief Set the page ID of the talk page for each non-talk page. 0150 * @param talkid the page ID of the talk page for each non-talk page 0151 */ 0152 void setTalkid(unsigned int talkid) const; 0153 0154 /** 0155 * @brief Return the page ID of the talk page for each non-talk page. 0156 * @return the page ID of the talk page for each non-talk page 0157 */ 0158 unsigned int pageTalkid() const; 0159 0160 /** 0161 * @brief Set the full url of the page. 0162 * @param fullurl the full url of the page 0163 */ 0164 void setFullurl(const QUrl& fullurl); 0165 0166 /** 0167 * @brief Return the full url of the page. 0168 * @return the full url of the page 0169 */ 0170 QUrl pageFullurl() const; 0171 0172 /** 0173 * @brief Set the edit url of the page. 0174 * @param editurl the edit url of the page 0175 */ 0176 void setEditurl(const QUrl& editurl); 0177 0178 /** 0179 * @brief Return the edit url of the page. 0180 * @return the edit url of the page 0181 */ 0182 QUrl pageEditurl() const; 0183 0184 /** 0185 * @brief Set the readability of the page. 0186 * @param readable the readability of the page 0187 */ 0188 void setReadable(const QString& readable); 0189 0190 /** 0191 * @brief Return the readability of the page. 0192 * @return the readability of the page 0193 */ 0194 QString pageReadable() const; 0195 0196 /** 0197 * @brief Set the text returned by EditFormPreloadText. 0198 * @param preload the text returned by EditFormPreloadText 0199 */ 0200 void setPreload(const QString& preload); 0201 0202 /** 0203 * @brief Return the text returned by EditFormPreloadText. 0204 * @return the text returned by EditFormPreloadText 0205 */ 0206 QString pagePreload() const; 0207 0208 /** 0209 * @brief Set the last touched timestamp. 0210 * @param touched the last touched timestamp 0211 */ 0212 void setTouched(const QDateTime& touched); 0213 0214 /** 0215 * @brief Return the last touched timestamp. 0216 * @return the last touched timestamp 0217 */ 0218 QDateTime pageTouched() const; 0219 0220 /** 0221 * @brief Set the timestamp when you obtained the edit token. 0222 * @param starttimestamp the timestamp when you obtained the edit token 0223 */ 0224 void setStarttimestamp(const QDateTime& starttimestamp); 0225 0226 /** 0227 * @brief Return the timestamp when you obtained the edit token. 0228 * @return the timestamp when you obtained the edit token 0229 */ 0230 QDateTime pageStarttimestamp() const; 0231 0232 private: 0233 0234 class Private; 0235 Private* const d; 0236 }; 0237 0238 } // namespace MediaWiki 0239 0240 #endif // PAGE_H