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