File indexing completed on 2024-04-21 14:46:34

0001 /*
0002     SPDX-FileCopyrightText: 2005 Jason Harris <kstars@30doradus.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "ksparser.h"
0010 #include "solarsystemlistcomponent.h"
0011 #include "filedownloader.h"
0012 
0013 #include <QList>
0014 #include <QPointer>
0015 
0016 class SkyLabeler;
0017 
0018 /**
0019  * @class CometsComponent
0020  *
0021  * This class encapsulates the Comets
0022  *
0023  * @author Jason Harris
0024  * @version 0.1
0025  */
0026 class CometsComponent : public QObject, public SolarSystemListComponent
0027 {
0028         Q_OBJECT
0029 
0030     public:
0031         /**
0032          * @short Default constructor.
0033          *
0034          * @p parent pointer to the parent SolarSystemComposite
0035          */
0036         explicit CometsComponent(SolarSystemComposite *parent);
0037 
0038         virtual ~CometsComponent() override = default;
0039 
0040         bool selected() override;
0041         void draw(SkyPainter *skyp) override;
0042         void updateDataFile(bool isAutoUpdate = false);
0043 
0044     protected slots:
0045         void downloadReady();
0046         void downloadError(const QString &errorString);
0047 
0048     private:
0049         void loadData();
0050 
0051         QPointer<FileDownloader> downloadJob;
0052 };