File indexing completed on 2025-01-05 03:53:35
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 Ludovic Delfau <ludovicdelfau at gmail dot com> 0011 * 0012 * SPDX-License-Identifier: GPL-2.0-or-later 0013 * 0014 * ============================================================ */ 0015 0016 #ifndef DIGIKAM_MEDIAWIKI_IMAGEINFO_H 0017 #define DIGIKAM_MEDIAWIKI_IMAGEINFO_H 0018 0019 // Qt includes 0020 0021 #include <QDateTime> 0022 #include <QHash> 0023 #include <QString> 0024 #include <QUrl> 0025 #include <QVariant> 0026 0027 namespace MediaWiki 0028 { 0029 0030 /** 0031 * @brief An image info. 0032 */ 0033 class Imageinfo 0034 { 0035 public: 0036 0037 /** 0038 * @brief Constructs an image info. 0039 */ 0040 Imageinfo(); 0041 0042 /** 0043 * @brief Constructs an image info from an other image info. 0044 * @param other an other image info 0045 */ 0046 Imageinfo(const Imageinfo& other); 0047 0048 /** 0049 * @brief Destructs an image info. 0050 */ 0051 ~Imageinfo(); 0052 0053 /** 0054 * @brief Assigning an image info from an other image info. 0055 * @param other an other image info 0056 */ 0057 Imageinfo& operator=(const Imageinfo& other); 0058 0059 /** 0060 * @brief Returns true if this instance and other are equal, else false. 0061 * @param other instance to compare 0062 * @return true if there are equal, else false 0063 */ 0064 bool operator==(const Imageinfo& other) const; 0065 0066 /** 0067 * @brief Get the time and date of the revision. 0068 * @return the time and date of the revision 0069 */ 0070 QDateTime timestamp() const; 0071 0072 /** 0073 * @brief Set the time and date of the revision. 0074 * @param timestamp the time and date of the revision 0075 */ 0076 void setTimestamp(const QDateTime& timestamp); 0077 0078 /** 0079 * @brief Get the user who made the revision. 0080 * @return the user who made the revision 0081 */ 0082 QString user() const; 0083 0084 /** 0085 * @brief Set the user who made the revision. 0086 * @param user the user who made the revision 0087 */ 0088 void setUser(const QString& user); 0089 0090 /** 0091 * @brief Get the edit comment. 0092 * @return the edit comment 0093 */ 0094 QString comment() const; 0095 0096 /** 0097 * @brief Set the edit comment. 0098 * @param comment the edit comment 0099 */ 0100 void setComment(const QString& comment); 0101 0102 /** 0103 * @brief Get the URL of the image. 0104 * @return the URL of the image 0105 */ 0106 QUrl url() const; 0107 0108 /** 0109 * @brief Set the URL of the image. 0110 * @param url the URL of the image 0111 */ 0112 void setUrl(const QUrl& url); 0113 0114 /** 0115 * @brief Get the description URL of the image. 0116 * @return the description URL of the image 0117 */ 0118 QUrl descriptionUrl() const; 0119 0120 /** 0121 * @brief Set the description URL of the image. 0122 * @param descriptionUrl the description URL of the image 0123 */ 0124 void setDescriptionUrl(const QUrl& descriptionUrl); 0125 0126 /** 0127 * @brief Get the thumb URL of the image. 0128 * @return the thumb URL of the image 0129 */ 0130 QUrl thumbUrl() const; 0131 0132 /** 0133 * @brief Get the thumb URL of the image. 0134 * @param thumbUrl the thumb URL of the image 0135 */ 0136 void setThumbUrl(const QUrl& thumbUrl); 0137 0138 /** 0139 * @brief Get the thumb width of the image. 0140 * @return the thumb width of the image 0141 */ 0142 qint64 thumbWidth() const; 0143 0144 /** 0145 * @brief Set the thumb width of the image. 0146 * @param thumbWidth the thumb width of the image 0147 */ 0148 void setThumbWidth(qint64 thumbWidth); 0149 0150 /** 0151 * @brief Get the thumb height of the image. 0152 * @return the thumb height of the image 0153 */ 0154 qint64 thumbHeight() const; 0155 0156 /** 0157 * @brief Set the thumb height of the image. 0158 * @param thumbHeight the thumb height of the image 0159 */ 0160 void setThumbHeight(qint64 thumbHeight); 0161 0162 /** 0163 * @brief Get the image's size in bytes. 0164 * @return the image's size in bytes 0165 */ 0166 qint64 size() const; 0167 0168 /** 0169 * @brief Set the image's size in bytes. 0170 * @param size the image's size in bytes 0171 */ 0172 void setSize(qint64 size); 0173 0174 /** 0175 * @brief Get the image's width. 0176 * @return the image's width 0177 */ 0178 qint64 width() const; 0179 0180 /** 0181 * @brief Set the image's width. 0182 * @param width the image's width 0183 */ 0184 void setWidth(qint64 width); 0185 0186 /** 0187 * @brief Get the image's height. 0188 * @return the image's height 0189 */ 0190 qint64 height() const; 0191 0192 /** 0193 * @brief Set the image's height. 0194 * @param height the image's height 0195 */ 0196 void setHeight(qint64 height); 0197 0198 /** 0199 * @brief Get the image's SHA-1 hash. 0200 * @return the image's SHA-1 hash 0201 */ 0202 QString sha1() const; 0203 0204 /** 0205 * @brief Set the image's SHA-1 hash. 0206 * @param sha1 the image's SHA-1 hash 0207 */ 0208 void setSha1(const QString& sha1); 0209 0210 /** 0211 * @brief Get the image's MIME type. 0212 * @return the image's MIME type 0213 */ 0214 QString mime() const; 0215 0216 /** 0217 * @brief Set the image's MIME type. 0218 * @param mime the image's MIME type 0219 */ 0220 void setMime(const QString& mime); 0221 0222 /** 0223 * @brief Get image metadata. 0224 * @return image metadata 0225 */ 0226 const QHash<QString, QVariant>& metadata() const; 0227 0228 /** 0229 * @brief Get image metadata. 0230 * @return image metadata 0231 */ 0232 QHash<QString, QVariant>& metadata(); 0233 0234 /** 0235 * @brief Set image metadata. 0236 * @param metadata image metadata 0237 */ 0238 void setMetadata(const QHash<QString, QVariant>& metadata); 0239 0240 private: 0241 0242 class Private; 0243 Private* const d; 0244 }; 0245 0246 } // namespace MediaWiki 0247 0248 #endif // DIGIKAM_MEDIAWIKI_IMAGEINFO_H