1 /* 2 SPDX-FileCopyrightText: 2005 Jason Harris <kstars@30doradus.org> 3 4 SPDX-License-Identifier: GPL-2.0-or-later 5 */ 6 7 #pragma once 8 9 #include "ksparser.h" 10 #include "solarsystemlistcomponent.h" 11 #include "filedownloader.h" 12 13 #include <QList> 14 #include <QPointer> 15 16 class SkyLabeler; 17 18 /** 19 * @class CometsComponent 20 * 21 * This class encapsulates the Comets 22 * 23 * @author Jason Harris 24 * @version 0.1 25 */ 26 class CometsComponent : public QObject, public SolarSystemListComponent 27 { 28 Q_OBJECT 29 30 public: 31 /** 32 * @short Default constructor. 33 * 34 * @p parent pointer to the parent SolarSystemComposite 35 */ 36 explicit CometsComponent(SolarSystemComposite *parent); 37 38 virtual ~CometsComponent() override = default; 39 40 bool selected() override; 41 void draw(SkyPainter *skyp) override; 42 void updateDataFile(bool isAutoUpdate = false); 43 44 protected slots: 45 void downloadReady(); 46 void downloadError(const QString &errorString); 47 48 private: 49 void loadData(); 50 51 QPointer<FileDownloader> downloadJob; 52 }; 53