22 #include "StelObjectModule.hpp" 23 #include "StelObject.hpp" 24 #include "StelFader.hpp" 28 #include <QVariantMap> 31 #include <QSharedPointer> 34 class QNetworkAccessManager;
60 typedef QSharedPointer<Nova> NovaP;
111 return qSharedPointerCast<StelObject>(
getByID(
id));
119 virtual QStringList
listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false,
bool inEnglish=
false)
const;
121 virtual QString
getName()
const {
return "Bright Novae"; }
125 NovaP
getByID(
const QString&
id)
const;
155 void setUpdateFrequencyDays(
int days) {updateFrequencyDays = days;}
187 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
188 void messageTimeout(
void)
const;
190 void reloadCatalog(
void);
197 void restoreDefaultConfigIni(
void);
200 void restoreDefaultJsonFile(
void);
203 void readJsonFile(
void);
208 bool backupJsonFile(
bool deleteOriginal=
false);
212 int getJsonFileVersion(
void)
const;
216 bool checkJsonFileFormat(
void)
const;
219 QVariantMap loadNovaeMap(QString path=QString());
222 void setNovaeMap(
const QVariantMap& map);
224 QString novaeJsonPath;
230 QHash<QString, double> novalist;
234 QNetworkAccessManager* downloadMgr;
238 QTimer* messageTimer;
239 QList<int> messageIDs;
241 QDateTime lastUpdate;
242 int updateFrequencyDays;
253 void checkForUpdate(
void);
254 void updateDownloadComplete(QNetworkReply* reply);
260 #include "StelPluginInterface.hpp" 266 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
void setUpdatesEnabled(bool b)
Set whether or not the plugin will try to update catalog data from the internet.
Define the interface to implement when creating a plugin.
Update completed, there were updates.
QString getNovaeList()
Get list of novae.
void restoreDefaults(void)
Set up the plugin with default values.
virtual double getCallOrder(StelModuleActionName actionName) const
Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.
void jsonUpdateComplete(void)
Emitted after a JSON update has run.
Define the StelTextureSP type.
Main class of the Bright Novae plugin.
virtual QObjectList getExtensionList() const
A mechanism to provide abitrary QObjects to the StelModuleMgr.
void displayMessage(const QString &message, const QString hexColor="#999999")
Display a message. This is used for plugin-specific warnings and such.
int getCountNovae(void) const
Get count of novae from catalog.
float getLowerLimitBrightness()
Get lower limit of brightness for displayed novae.
Main class for Stellarium core processing.
QDateTime getLastUpdate(void) const
Get the date and time the novae were updated.
virtual QList< StelObjectP > searchAround(const Vec3d &v, double limitFov, const StelCore *core) const
Used to get a list of objects which are near to some position.
virtual StelObjectP searchByName(const QString &name) const
Return the matching satellite if exists or Q_NULLPTR.
void updateJSON(void)
Download JSON from web recources described in the module section of the module.ini file and update th...
void updateStateChanged(Novae::UpdateState state)
void saveSettingsToConfig(void)
Save the settings to the main configuration file.
virtual StelObjectP searchByNameI18n(const QString &nameI18n) const
Return the matching satellite object's pointer if exists or Q_NULLPTR.
Specialization of StelModule which manages a collection of StelObject.
virtual QString getName() const
Gets a user-displayable name of the object category.
virtual bool configureGui(bool show=true)
Implement this to tell the main Stellarium GUI that there is a GUI element to configure this plugin...
virtual QString getStelObjectType() const
Returns the name that will be returned by StelObject::getType() for the objects this module manages...
virtual QStringList listAllObjects(bool inEnglish) const
List all StelObjects.
int getSecondsToUpdate(void)
Get the number of seconds till the next update.
Error during download phase.
Provides functions for performing openGL drawing operations.
virtual void update(double)
Update the module with respect to the time.
void readSettingsFromConfig(void)
Read (or re-read) settings from the main config file.
This class is used by Qt to manage a plug-in interface.
virtual StelObjectP searchByID(const QString &id) const
Return the StelObject with the given ID if exists or the empty StelObject if not found.
StelModuleActionName
Define the possible action for which an order is defined.
bool getUpdatesEnabled(void)
Get whether or not the plugin will try to update catalog data from the internet.
Maintain the state of a progress bar.
NovaP getByID(const QString &id) const
get a nova object by identifier
UpdateState
Used for keeping for track of the download/update status.
Update completed, there we no updates.
QSharedPointer< StelTexture > StelTextureSP
Use shared pointer to simplify memory managment.
int getUpdateFrequencyDays(void) const
Get the update frequency in days.
virtual QStringList listMatchingObjects(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false, bool inEnglish=false) const
Find and return the list of at most maxNbItem objects auto-completing the passed object name...
This is the common base class for all the main components of stellarium.
UpdateState getUpdateState(void) const
Get the current updateState.
virtual void init()
Initialize itself.
Contains information about a Stellarium plugin.