1
/** ===========================================================
4
* This file is a part of KDE project
5
* <a href="https://projects.kde.org/projects/extragear/libs/libmediawiki">libmediawiki</a>
8
* @brief a MediaWiki C++ interface for KDE
10
* @author Copyright (C) 2011-2012 by Gilles Caulier
11
* <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
12
* @author Copyright (C) 2010 by Ludovic Delfau
13
* <a href="mailto:ludovicdelfau at gmail dot com">ludovicdelfau at gmail dot com</a>
15
* This program is free software; you can redistribute it
16
* and/or modify it under the terms of the GNU General
17
* Public License as published by the Free Software Foundation;
18
* either version 2, or (at your option)
21
* This program is distributed in the hope that it will be useful,
22
* but WITHOUT ANY WARRANTY; without even the implied warranty of
23
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
* GNU General Public License for more details.
26
* ============================================================ */
28
#ifndef MEDIAWIKI_IMAGEINFO_H
29
#define MEDIAWIKI_IMAGEINFO_H
33
#include <QtCore/QDateTime>
34
#include <QtCore/QHash>
35
#include <QtCore/QString>
36
#include <QtCore/QUrl>
37
#include <QtCore/QVariant>
41
#include "mediawiki_export.h"
47
* @brief An image info.
49
class MEDIAWIKI_EXPORT Imageinfo
54
* @brief Constructs an image info.
59
* @brief Constructs an image info from an other image info.
60
* @param other an other image info
62
Imageinfo(const Imageinfo& other);
65
* @brief Destructs an image info.
70
* @brief Assingning an image info from an other image info.
71
* @param other an other image info
73
Imageinfo& operator=(Imageinfo other);
76
* @brief Returns true if this instance and other are equal, else false.
77
* @param other instance to compare
78
* @return true if there are equal, else false
80
bool operator==(const Imageinfo& other) const;
83
* @brief Get the time and date of the revision.
84
* @return the time and date of the revision
86
QDateTime timestamp() const;
89
* @brief Set the time and date of the revision.
90
* @param timestamp the time and date of the revision
92
void setTimestamp(const QDateTime& timestamp);
95
* @brief Get the user who made the revision.
96
* @return the user who made the revision
101
* @brief Set the user who made the revision.
102
* @param user the user who made the revision
104
void setUser(const QString& user);
107
* @brief Get the edit comment.
108
* @return the edit comment
110
QString comment() const;
113
* @brief Set the edit comment.
114
* @param comment the edit comment
116
void setComment(const QString& comment);
119
* @brief Get the URL of the image.
120
* @return the URL of the image
125
* @brief Set the URL of the image.
126
* @param url the URL of the image
128
void setUrl(const QUrl& url);
131
* @brief Get the description URL of the image.
132
* @return the description URL of the image
134
QUrl descriptionUrl() const;
137
* @brief Set the description URL of the image.
138
* @param descriptionUrl the description URL of the image
140
void setDescriptionUrl(const QUrl& descriptionUrl);
143
* @brief Get the thumb URL of the image.
144
* @return the thumb URL of the image
146
QUrl thumbUrl() const;
149
* @brief Get the thumb URL of the image.
150
* @param thumbUrl the thumb URL of the image
152
void setThumbUrl(const QUrl& thumbUrl);
155
* @brief Get the thumb width of the image.
156
* @return the thumb width of the image
158
qint64 thumbWidth() const;
161
* @brief Set the thumb width of the image.
162
* @param thumbWidth the thumb width of the image
164
void setThumbWidth(qint64 thumbWidth);
167
* @brief Get the thumb height of the image.
168
* @return the thumb height of the image
170
qint64 thumbHeight() const;
173
* @brief Set the thumb height of the image.
174
* @param thumbHeight the thumb height of the image
176
void setThumbHeight(qint64 thumbHeight);
179
* @brief Get the image's size in bytes.
180
* @return the image's size in bytes
185
* @brief Set the image's size in bytes.
186
* @param size the image's size in bytes
188
void setSize(qint64 size);
191
* @brief Get the image's width.
192
* @return the image's width
194
qint64 width() const;
197
* @brief Set the image's width.
198
* @param width the image's width
200
void setWidth(qint64 width);
203
* @brief Get the image's height.
204
* @return the image's height
206
qint64 height() const;
209
* @brief Set the image's height.
210
* @param height the image's height
212
void setHeight(qint64 height);
215
* @brief Get the image's SHA-1 hash.
216
* @return the image's SHA-1 hash
218
QString sha1() const;
221
* @brief Set the image's SHA-1 hash.
222
* @param sha1 the image's SHA-1 hash
224
void setSha1(const QString& sha1);
227
* @brief Get the image's MIME type.
228
* @return the image's MIME type
230
QString mime() const;
233
* @brief Set the image's MIME type.
234
* @param mime the image's MIME type
236
void setMime(const QString& mime);
239
* @brief Get image metadata.
240
* @return image metadata
242
const QHash<QString, QVariant>& metadata() const;
245
* @brief Get image metadata.
246
* @return image metadata
248
QHash<QString, QVariant>& metadata();
251
* @brief Set image metadata.
252
* @param metadata image metadata
254
void setMetadata(const QHash<QString, QVariant>& metadata);
258
class ImageinfoPrivate;
259
ImageinfoPrivate* const d;
262
} // namespace mediawiki
264
#endif // MEDIAWIKI_IMAGEINFO_H