File indexing completed on 2024-07-14 07:17:19

0001 /*
0002     SPDX-FileCopyrightText: 2015 M.S.Adityan <msadityan@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "skycomponent.h"
0010 
0011 class ConstellationsArt;
0012 class CultureList;
0013 
0014 /**
0015  * @class ConstellationArtComponent
0016  * Represents the ConstellationsArt objects.
0017  * For each skyculture there is a separate table in skycultures.sqlite.
0018  * @author M.S.Adityan
0019  * @version 0.1
0020  */
0021 class ConstellationArtComponent : public SkyComponent
0022 {
0023   public:
0024     /** Constructor */
0025     explicit ConstellationArtComponent(SkyComposite *, CultureList *cultures);
0026 
0027     /** Destructor */
0028     ~ConstellationArtComponent() override;
0029 
0030     /**
0031      * @short Read the skycultures.sqlite database file.
0032      * Parse all the data from the skycultures database.Construct a ConstellationsArt object
0033      * from the data, and add it to a QList.
0034      * @return true if data file is successfully read.
0035      */
0036     void loadData();
0037 
0038     /**
0039      * @short deletes all created ConstellationsArt objects.
0040      * Used in KStars Lite to reduce memory consumption if Constellation Art is switched off
0041      */
0042     void deleteData();
0043 
0044     /** @short Shows the details of the constellations selected skyculture */
0045     void showList();
0046 
0047     void draw(SkyPainter *skyp) override;
0048 
0049     QList<ConstellationsArt *> m_ConstList;
0050 
0051   private:
0052     QString cultureName;
0053     int records { 0 };
0054 };