19 #ifndef _MULTILEVELJSONBASE_HPP_ 20 #define _MULTILEVELJSONBASE_HPP_ 22 #include "StelSkyLayer.hpp" 26 #include <QVariantMap> 27 #include <QNetworkReply> 38 friend class JsonLoadThread;
74 void downloadFinished();
76 void jsonLoadFinished();
101 void updatePercent(
int tot,
int numToBeLoaded);
113 static QVariantMap
loadFromJSON(QIODevice& input,
bool qZcompressed=
false,
bool gzCompressed=
false);
117 QString getBaseUrl()
const {
return baseUrl;}
120 class QNetworkReply* httpReply;
125 class JsonLoadThread* loadThread;
128 double timeWhenDeletionScheduled;
131 QVariantMap temporaryResultMap;
137 static class QNetworkAccessManager* networkAccessManager;
139 static QNetworkAccessManager& getNetworkAccessManager();
142 #endif // _MULTILEVELJSONBASE_HPP_ void deleteUnusedSubTiles()
Delete all the subtiles which were not displayed since more than lastDrawTrigger seconds.
void cancelDeletion()
If a deletion was scheduled, cancel it.
bool errorOccured
Set to true if an error occured with this tile and it should not be displayed.
int getLevel() const
Get the depth level in the tree.
QVariantMap toQVariantMap() const
Convert the image informations to a map following the JSON structure.
void initFromUrl(const QString &url)
Init the element from a URL.
Abstract base class for managing multi-level tree objects stored in JSON format.
MultiLevelJsonBase(MultiLevelJsonBase *parent=NULL)
Default constructor.
Main class for Stellarium core processing.
bool downloading
true if the JSON descriptor file is currently downloading
static QVariantMap loadFromJSON(QIODevice &input, bool qZcompressed=false, bool gzCompressed=false)
Load the element information from a JSON file.
bool isDeletionScheduled() const
Return true if a deletion is currently scheduled.
QString baseUrl
Base URL to prefix to relative URL.
~MultiLevelJsonBase()
Destructor.
virtual void loadFromQVariantMap(const QVariantMap &map)=0
Load the element from a valid QVariantMap.
QString shortName
The very short name for this image set to be used in loading bar.
QList< MultiLevelJsonBase * > subTiles
The list of all the created subtiles for this tile.
void initFromQVariantMap(const QVariantMap &map)
Init the element from a QVariantMap.
void scheduleChildsDeletion()
Schedule a deletion for all the childs.
QString contructorUrl
The relative URL passed to the constructor.
bool hasErrorOccured() const
Return true if an error occured while loading the data.
Abstract class defining the API to implement for all sky layer.
QString getShortName() const
Return the short name for this image to be used in the loading bar.