22 #include "StelObjectModule.hpp"
23 #include "StelObject.hpp"
27 #include <QVariantMap>
30 #include <QSharedPointer>
34 class QNetworkAccessManager;
62 typedef QSharedPointer<Quasar> QuasarP;
72 Q_PROPERTY(
bool quasarsVisible READ getFlagShowQuasars WRITE setFlagShowQuasars)
90 virtual void deinit();
91 virtual void update(
double) {;}
94 virtual double getCallOrder(StelModuleActionName actionName)
const;
103 virtual QList<StelObjectP>
searchAround(
const Vec3d& v,
double limitFov,
const StelCore* core)
const;
118 virtual QStringList
listMatchingObjectsI18n(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false)
const;
125 virtual QStringList
listMatchingObjects(
const QString& objPrefix,
int maxNbItem=5,
bool useStartOfWords=
false)
const;
127 virtual QStringList listAllObjects(
bool inEnglish)
const;
128 virtual QStringList listAllObjectsByType(
const QString& objType,
bool inEnglish)
const { Q_UNUSED(objType) Q_UNUSED(inEnglish) return QStringList(); }
130 virtual QString getName()
const {
return "Quasars"; }
133 QuasarP
getByID(
const QString&
id);
158 bool getDisplayMode(
void);
159 void setDisplayMode(
bool b);
160 QString getMarkerColor(
void);
161 void setMarkerColor(QString c);
162 void setEnableAtStartup(
bool b) { enableAtStartup=b; }
163 bool getEnableAtStartup(
void) {
return enableAtStartup; }
170 void setUpdateFrequencyDays(
int days) {updateFrequencyDays = days;}
193 void setFlagShowQuasars(
bool b) { flagShowQuasars=b; }
194 bool getFlagShowQuasars(
void) {
return flagShowQuasars; }
198 bool getFlagShowQuasarsButton(
void) {
return flagShowQuasarsButton; }
201 void displayMessage(
const QString& message,
const QString hexColor=
"#999999");
202 void messageTimeout(
void);
209 void restoreDefaultConfigIni(
void);
212 void upgradeConfigIni(
void);
215 void restoreDefaultJsonFile(
void);
218 void readJsonFile(
void);
223 bool backupJsonFile(
bool deleteOriginal=
false);
227 int getJsonFileFormatVersion(
void);
231 bool checkJsonFileFormat(
void);
234 QVariantMap loadQSOMap(QString path=QString());
237 void setQSOMap(
const QVariantMap& map);
239 QString catalogJsonPath;
248 QNetworkAccessManager* downloadMgr;
251 QTimer* messageTimer;
252 QList<int> messageIDs;
254 QDateTime lastUpdate;
255 int updateFrequencyDays;
256 bool enableAtStartup;
262 bool flagShowQuasars;
263 bool flagShowQuasarsButton;
274 void checkForUpdate(
void);
275 void updateDownloadComplete(QNetworkReply* reply);
282 #include "StelPluginInterface.hpp"
288 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
void readSettingsFromConfig(void)
Read (or re-read) settings from the main config file.
UpdateState
Used for keeping for track of the download/update status.
void setFlagShowQuasarsButton(bool b)
Define whether the button toggling quasars should be visible.
QuasarP getByID(const QString &id)
get a Quasar object by identifier
int getCountQuasars(void)
Get count of quasars from catalog.
virtual bool configureGui(bool show=true)
Implement this to tell the main Stellarium GUI that there is a GUI element to configure this plugin...
void jsonUpdateComplete(void)
emitted after a JSON update has run.
virtual StelObjectP searchByNameI18n(const QString &nameI18n) const
Return the matching satellite object's pointer if exists or NULL.
void setUpdatesEnabled(bool b)
set whether or not the plugin will try to update catalog data from the internet
virtual StelObjectP searchByName(const QString &name) const
Return the matching satellite if exists or NULL.
Update completed, there we no updates.
void displayMessage(const QString &message, const QString hexColor="#999999")
Display a message. This is used for plugin-specific warnings and such.
int getSecondsToUpdate(void)
get the number of seconds till the next update
void saveSettingsToConfig(void)
Save the settings to the main configuration file.
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.
void restoreDefaults(void)
Set up the plugin with default values.
Update completed, there were updates.
void updateStateChanged(Quasars::UpdateState state)
Main class of the Quasars plugin.
virtual QStringList listMatchingObjects(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const
Find and return the list of at most maxNbItem objects auto-completing the passed object English name...
bool getUpdatesEnabled(void)
get whether or not the plugin will try to update catalog data from the internet
UpdateState getUpdateState(void)
Get the current updateState.
virtual QStringList listMatchingObjectsI18n(const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const
Find and return the list of at most maxNbItem objects auto-completing the passed object I18n name...
void updateJSON(void)
Download JSON from web recources described in the module section of the module.ini file and update th...
QSharedPointer< StelTexture > StelTextureSP
Error during download phase.
QDateTime getLastUpdate(void)
get the date and time the TLE elements were updated
int getUpdateFrequencyDays(void)
get the update frequency in days