Marble

HttpDownloadManager.h
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2007 Torsten Rahn <[email protected]>
9 // Copyright 2007 Inge Wallin <[email protected]>
10 // Copyright 2009 Jens-Michael Hoffmann <[email protected]>
11 //
12 
13 //
14 // The HttpDownloadManager manages http downloads.
15 //
16 
17 #ifndef MARBLE_HTTPDOWNLOADMANAGER_H
18 #define MARBLE_HTTPDOWNLOADMANAGER_H
19 
20 #include <QObject>
21 
22 #include "MarbleGlobal.h"
23 #include "marble_export.h"
24 
25 class QUrl;
26 
27 namespace Marble
28 {
29 
30 class DownloadPolicy;
31 class StoragePolicy;
32 
43 class MARBLE_EXPORT HttpDownloadManager : public QObject
44 {
45  Q_OBJECT
46 
47  public:
55  explicit HttpDownloadManager( StoragePolicy *policy );
56 
60  ~HttpDownloadManager() override;
61 
65  void setDownloadEnabled( const bool enable );
66  void addDownloadPolicy( const DownloadPolicy& );
67 
68  static QByteArray userAgent(const QString &platform, const QString &plugin);
69 
70  public Q_SLOTS:
71 
75  void addJob( const QUrl& sourceUrl, const QString& destFilename, const QString &id,
76  const DownloadUsage usage );
77 
78 
79  Q_SIGNALS:
80  void downloadComplete( const QString&, const QString& );
81 
87  void downloadComplete( const QByteArray &data, const QString& initiatorId );
88 
92  void jobAdded();
93 
98  void jobRemoved();
99 
103  void progressChanged( int active, int queued );
104 
105  private:
106  Q_DISABLE_COPY( HttpDownloadManager )
107 
108  class Private;
109  Private * const d;
110 
111  Q_PRIVATE_SLOT( d, void finishJob( const QByteArray&, const QString&, const QString& id ) )
112  Q_PRIVATE_SLOT( d, void requeue() )
113  Q_PRIVATE_SLOT( d, void startRetryTimer() )
114 };
115 
116 }
117 
118 #endif // MARBLE_HTTPDOWNLOADMANAGER_H
DownloadUsage
This enum is used to describe the type of download.
Definition: MarbleGlobal.h:152
Binds a QML item to a specific geodetic location in screen coordinates.
This class manages scheduled downloads.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun May 24 2020 22:38:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.