File indexing completed on 2024-04-28 08:34:15
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 Robin Bussenot 0013 * <a href="mailto:bussenot dot robin at gmail dot com">bussenot dot robin 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_REVISION_H 0029 #define MEDIAWIKI_REVISION_H 0030 0031 // Qt includes 0032 0033 #include <QDateTime> 0034 0035 // Local includes 0036 0037 #include "mediawiki_export.h" 0038 0039 namespace mediawiki 0040 { 0041 0042 /** 0043 * @brief An image info. 0044 */ 0045 class MEDIAWIKI_EXPORT Revision 0046 { 0047 0048 public: 0049 0050 /** 0051 * @brief Constructs a revision. 0052 */ 0053 Revision(); 0054 0055 /** 0056 * @brief Destructs a revision. 0057 */ 0058 ~Revision(); 0059 0060 /** 0061 * @brief Constructs a revision from an other revision. 0062 * @param other an other revision 0063 */ 0064 Revision(const Revision& other); 0065 0066 /** 0067 * @brief Assingning a revision from an other revision. 0068 * @param other an other revision 0069 */ 0070 Revision& operator=(Revision other); 0071 0072 /** 0073 * @brief Returns true if this instance and other are equal, else false. 0074 * @param other instance to compare 0075 * @return true if there are equal, else false 0076 */ 0077 bool operator==(const Revision& other) const; 0078 0079 /** 0080 * @brief Set the revision ID. 0081 * @param revisionId the revision ID 0082 **/ 0083 void setRevisionId(int revisionId); 0084 0085 /** 0086 * @brief Get the revision ID. 0087 * @return the revision ID 0088 */ 0089 int revisionId() const; 0090 0091 /** 0092 * @brief Set the parent ID. 0093 * @param parentId the parent ID 0094 */ 0095 void setParentId(int parentId); 0096 0097 /** 0098 * @brief Get the parent ID. 0099 * @return the parent ID 0100 */ 0101 int parentId() const; 0102 0103 /** 0104 * @brief Set the size of the revision text in bytes. 0105 * @param size the size of the revision text in bytes 0106 */ 0107 void setSize(int size); 0108 0109 /** 0110 * @brief Get the size of the revision text in bytes. 0111 * @return the size of the revision text in bytes 0112 */ 0113 int size() const; 0114 0115 /** 0116 * @brief Set true if the revsion is minor. 0117 * @param minor true if the revsion is minor 0118 */ 0119 void setMinorRevision(bool minorRevision); 0120 0121 /** 0122 * @brief Get true if the revsion is minor. 0123 * @return true if the revsion is minor 0124 */ 0125 bool minorRevision() const; 0126 0127 /** 0128 * @brief Get the date and time of the revision. 0129 * @return the date and time of the revision 0130 */ 0131 QDateTime timestamp() const; 0132 0133 /** 0134 * @brief Set the date and time of the revision 0135 * @param timestamp the date and time of the revision 0136 */ 0137 void setTimestamp(const QDateTime& timestamp); 0138 0139 /** 0140 * @brief Get the user who made the revision. 0141 * @return the user who made the revision 0142 */ 0143 QString user() const; 0144 0145 /** 0146 * @brief Set the user who made the revision. 0147 * @param user the user who made the revision 0148 */ 0149 void setUser(const QString& user); 0150 0151 /** 0152 * @brief The revision content. 0153 */ 0154 QString content() const; 0155 0156 /** 0157 * @brief Set the revision content. 0158 * @param content the revision content 0159 */ 0160 void setContent(const QString& content); 0161 0162 /** 0163 * @brief Get the edit comment. 0164 * @return the edit comment 0165 */ 0166 QString comment() const; 0167 0168 /** 0169 * @brief Set the edit comment. 0170 * @param comment the edit comment 0171 */ 0172 void setComment(const QString& comment); 0173 0174 /** 0175 * @brief Set the parse tree of the revision content. 0176 * @param parseTree the parse tree of the revision content 0177 */ 0178 void setParseTree(const QString& parseTree); 0179 0180 /** 0181 * @brief Get the parse tree of the revision content. 0182 * @return the parse tree of the revision content 0183 */ 0184 QString parseTree() const; 0185 0186 /** 0187 * @brief Set the rollback token. 0188 * @param rollback the rollback token 0189 */ 0190 void setRollback(const QString& rollback); 0191 0192 /** 0193 * @brief Get the rollback token. 0194 * @return the rollback token 0195 */ 0196 QString rollback() const; 0197 0198 private: 0199 0200 class RevisionPrivate; 0201 RevisionPrivate* const d; 0202 }; 0203 0204 } // namespace mediawiki 0205 0206 #endif // MEDIAWIKI_REVISION_H