digiKam
metaengine_previews.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2006-09-15
7  * Description : Exiv2 library interface.
8  * Embedded preview loading.
9  *
10  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2006-2013 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef META_ENGINE_PREVIEWS_H
27 #define META_ENGINE_PREVIEWS_H
28 
29 // Qt includes
30 
31 #include <QByteArray>
32 #include <QSize>
33 #include <QString>
34 #include <QImage>
35 
36 // Local includes
37 
38 #include "digikam_export.h"
39 
40 namespace Digikam
41 {
42 
43 class DIGIKAM_EXPORT MetaEnginePreviews
44 {
45 public:
46 
50  explicit MetaEnginePreviews(const QString& filePath);
51 
55  explicit MetaEnginePreviews(const QByteArray& imgData);
57 
59  QSize originalSize() const;
60 
62  QString originalMimeType() const;
63 
65  bool isEmpty();
66 
68  int count() const;
69  int size() const;
70 
78  int dataSize(int index = 0);
79  int width(int index = 0);
80  int height(int index = 0);
81  QString mimeType(int index = 0);
82  QString fileExtension(int index = 0);
83 
87  QByteArray data(int index = 0);
88 
93  QImage image(int index = 0);
94 
95 private:
96 
97  // Disable
98  MetaEnginePreviews(const MetaEnginePreviews&) = delete;
99  MetaEnginePreviews& operator=(const MetaEnginePreviews&) = delete;
100 
101 private:
102 
103  class Private;
104  Private* const d;
105 };
106 
107 } // namespace Digikam
108 
109 #endif // META_ENGINE_PREVIEWS_H
Definition: metaengine_previews.h:44
Definition: datefolderview.cpp:43