libkipi from trunk (KDE 4.3) : add support of kipi host settings "file timestamp...
[kdegraphics.git] / gwenview / lib / jpegcontent.h
blob203c97f641ca67109850810c1a678dd7d232ca42
1 // vim: set tabstop=4 shiftwidth=4 noexpandtab
2 /*
3 Gwenview: an image viewer
4 Copyright 2007 Aurélien Gâteau <aurelien.gateau@free.fr>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef JPEGCONTENT_H
22 #define JPEGCONTENT_H
24 // Local
25 #include <lib/orientation.h>
26 #include <lib/gwenviewlib_export.h>
28 class QImage;
29 class QSize;
30 class QString;
31 class QIODevice;
33 namespace Exiv2 { class Image; }
35 namespace Gwenview {
38 class GWENVIEWLIB_EXPORT JpegContent {
39 public:
40 JpegContent();
41 ~JpegContent();
43 Orientation orientation() const;
44 void resetOrientation();
46 int dotsPerMeterX() const;
47 int dotsPerMeterY() const;
49 QSize size() const;
51 QString comment() const;
52 void setComment(const QString&);
54 void transform(Orientation);
56 QImage thumbnail() const;
57 void setThumbnail(const QImage&);
59 bool load(const QString& file);
60 bool loadFromData(const QByteArray& rawData);
61 /**
62 * Use this version of loadFromData if you already have an Exiv2::Image*
64 bool loadFromData(const QByteArray& rawData, Exiv2::Image*);
65 bool save(const QString& file);
66 bool save(QIODevice*);
68 QByteArray rawData() const;
70 QString errorString() const;
72 private:
73 struct Private;
74 Private *d;
76 JpegContent(const JpegContent&);
77 void operator=(const JpegContent&);
78 void applyPendingTransformation();
79 int dotsPerMeter(const QString& keyName) const;
83 } // namespace
86 #endif /* JPEGCONTENT_H */