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