File indexing completed on 2024-04-21 15:32:06

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