compile
[kdegraphics.git] / gwenview / lib / imagemetainfomodel.h
blobd1ae5fc1988427d17f241ef37e6803f1a85b5213
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 IMAGEMETAINFO_H
22 #define IMAGEMETAINFO_H
24 #include <lib/gwenviewlib_export.h>
26 // Qt
27 #include <QAbstractItemModel>
29 // KDE
31 // Local
33 class KFileItem;
35 namespace Exiv2 { class Image; }
37 namespace Gwenview {
40 class ImageMetaInfoModelPrivate;
41 class GWENVIEWLIB_EXPORT ImageMetaInfoModel : public QAbstractItemModel {
42 Q_OBJECT
43 public:
44 ImageMetaInfoModel();
45 ~ImageMetaInfoModel();
47 void setFileItem(const KFileItem&);
48 void setImageSize(const QSize&);
49 void setExiv2Image(const Exiv2::Image*);
51 QString keyForIndex(const QModelIndex&) const;
52 void getInfoForKey(const QString& key, QString* label, QString* value) const;
53 QString getValueForKey(const QString& key) const;
55 virtual QModelIndex index(int row, int col, const QModelIndex& parent = QModelIndex()) const;
56 virtual QModelIndex parent(const QModelIndex&) const;
57 virtual int rowCount(const QModelIndex& = QModelIndex()) const;
58 virtual int columnCount(const QModelIndex& = QModelIndex()) const;
59 virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
60 virtual QVariant data(const QModelIndex&, int role = Qt::DisplayRole) const;
62 private:
63 ImageMetaInfoModelPrivate* const d;
64 friend class ImageMetaInfoModelPrivate;
68 } // namespace
70 #endif /* IMAGEMETAINFO_H */