File indexing completed on 2025-01-05 03:59:36
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2014 Abhinav Gangwar <abhgang@gmail.com> 0004 // 0005 0006 #ifndef MARBLE_REMOTEICONLOADER_H 0007 #define MARBLE_REMOTEICONLOADER_H 0008 0009 #include <QObject> 0010 0011 class QString; 0012 class QByteArray; 0013 class QImage; 0014 class QUrl; 0015 0016 namespace Marble 0017 { 0018 class RemoteIconLoaderPrivate; 0019 0020 class RemoteIconLoader : public QObject 0021 { 0022 Q_OBJECT; 0023 public: 0024 explicit RemoteIconLoader( QObject *parent = nullptr ); 0025 ~RemoteIconLoader() override; 0026 0027 /** 0028 * Handles the icon request for passed url( whether icon is available 0029 * in cache or on disk or it should gor for a download 0030 */ 0031 QImage load( const QUrl& url ); 0032 0033 Q_SIGNALS: 0034 /** 0035 * Signal to indicate that image has been downloaded 0036 * and is ready to be display now 0037 */ 0038 void iconReady(); 0039 0040 private Q_SLOTS: 0041 void storeIcon( const QByteArray&, const QString& ); 0042 0043 private: 0044 RemoteIconLoaderPrivate *d; 0045 }; 0046 0047 } 0048 0049 #endif // MARBLE_REMOTEICONLOADER_H