File indexing completed on 2024-04-14 14:16:30

0001 // SPDX-FileCopyrightText: 2014 Friedrich W. H. Kossebau <kossebau@kde.org>
0002 // SPDX-License-Identifier: LGPL-2.1-or-later
0003 
0004 
0005 #ifndef _MARBLEGEODATATHUMBNAILER_H_
0006 #define _MARBLEGEODATATHUMBNAILER_H_
0007 
0008 // Marble
0009 #include "MarbleMap.h"
0010 
0011 // KF
0012 #include <KIOWidgets/kio/thumbcreator.h>
0013 
0014 // Qt
0015 #include <QEventLoop>
0016 #include <QTimer>
0017 
0018 namespace Marble
0019 {
0020 
0021 class GeoDataObject;
0022 
0023 
0024 class GeoDataThumbnailer : public QObject, public ThumbCreator
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     GeoDataThumbnailer();
0030     ~GeoDataThumbnailer() override;
0031 
0032 public: // ThumbCreator API
0033     bool create(const QString &path, int width, int height, QImage &image) override;
0034 
0035 private:
0036     void onGeoDataObjectAdded(GeoDataObject *object);
0037 
0038     MarbleMap m_marbleMap;
0039 
0040     QString m_currentFilename;
0041     bool m_loadingCompleted :1;
0042     bool m_hadErrors :1;
0043     QEventLoop m_eventLoop;
0044     QTimer m_outtimer;
0045 };
0046 
0047 }
0048 
0049 #endif