Quasars.hpp   Quasars.hpp 
skipping to change at line 24 skipping to change at line 24
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _QUASARS_HPP_ #ifndef _QUASARS_HPP_
#define _QUASARS_HPP_ #define _QUASARS_HPP_
#include "StelObjectModule.hpp" #include "StelObjectModule.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelTextureTypes.hpp"
#include "Quasar.hpp" #include "Quasar.hpp"
#include <QFont> #include <QFont>
#include <QVariantMap> #include <QVariantMap>
#include <QDateTime> #include <QDateTime>
#include <QList> #include <QList>
#include <QSharedPointer> #include <QSharedPointer>
class StelPainter;
class QNetworkAccessManager; class QNetworkAccessManager;
class QNetworkReply; class QNetworkReply;
class QProgressBar;
class QSettings; class QSettings;
class QTimer; class QTimer;
class QPixmap; class QPixmap;
class StelButton; class StelButton;
class QuasarsDialog; class QuasarsDialog;
typedef QSharedPointer<Quasar> QuasarP; typedef QSharedPointer<Quasar> QuasarP;
//! This is an example of a plug-in which can be dynamically loaded into st ellarium //! This is an example of a plug-in which can be dynamically loaded into st ellarium
class Quasars : public StelObjectModule class Quasars : public StelObjectModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool quasarsVisible READ getFlagShowQuasars WRITE setFlag ShowQuasars)
public: public:
//! @enum UpdateState //! @enum UpdateState
//! Used for keeping for track of the download/update status //! Used for keeping for track of the download/update status
enum UpdateState { enum UpdateState {
Updating, //!< Update in progress Updating, //!< Update in progress
CompleteNoUpdates, //!< Update completed, there we no u pdates CompleteNoUpdates, //!< Update completed, there we no u pdates
CompleteUpdates, //!< Update completed, there were up dates CompleteUpdates, //!< Update completed, there were up dates
DownloadError, //!< Error during download phase DownloadError, //!< Error during download phase
OtherError //!< Other error OtherError //!< Other error
}; };
Quasars(); Quasars();
virtual ~Quasars(); virtual ~Quasars();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
virtual void init(); virtual void init();
virtual void deinit(); virtual void deinit();
virtual void update(double) {;} virtual void update(double) {;}
virtual void draw(StelCore* core, class StelRenderer* renderer); virtual void draw(StelCore* core);
virtual void drawPointer(StelCore* core, class StelRenderer* rendere virtual void drawPointer(StelCore* core, StelPainter& painter);
r, StelProjectorP projector);
virtual double getCallOrder(StelModuleActionName actionName) const; virtual double getCallOrder(StelModuleActionName actionName) const;
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in StelObjectManager class // Methods defined in StelObjectManager class
//! Used to get a list of objects which are near to some position. //! Used to get a list of objects which are near to some position.
//! @param v a vector representing the position in th sky around whi ch to search for nebulae. //! @param v a vector representing the position in th sky around whi ch to search for nebulae.
//! @param limitFov the field of view around the position v in which to search for satellites. //! @param limitFov the field of view around the position v in which to search for satellites.
//! @param core the StelCore to use for computations. //! @param core the StelCore to use for computations.
//! @return an list containing the satellites located inside the lim itFov circle around position v. //! @return an list containing the satellites located inside the lim itFov circle around position v.
virtual QList<StelObjectP> searchAround(const Vec3d& v, double limit Fov, const StelCore* core) const; virtual QList<StelObjectP> searchAround(const Vec3d& v, double limit Fov, const StelCore* core) const;
skipping to change at line 129 skipping to change at line 132
//! Save the settings to the main configuration file. //! Save the settings to the main configuration file.
void saveSettingsToConfig(void); void saveSettingsToConfig(void);
//! get whether or not the plugin will try to update catalog data fr om the internet //! get whether or not the plugin will try to update catalog data fr om the internet
//! @return true if updates are set to be done, false otherwise //! @return true if updates are set to be done, false otherwise
bool getUpdatesEnabled(void) {return updatesEnabled;} bool getUpdatesEnabled(void) {return updatesEnabled;}
//! set whether or not the plugin will try to update catalog data fr om the internet //! set whether or not the plugin will try to update catalog data fr om the internet
//! @param b if true, updates will be enabled, else they will be dis abled //! @param b if true, updates will be enabled, else they will be dis abled
void setUpdatesEnabled(bool b) {updatesEnabled=b;} void setUpdatesEnabled(bool b) {updatesEnabled=b;}
bool getDisplayMode(void) {return distributionEnabled;} bool getDisplayMode(void);
void setDisplayMode(bool b) {distributionEnabled=b;} void setDisplayMode(bool b);
QString getMarkerColor(void);
void setMarkerColor(QString c);
void setEnableAtStartup(bool b) { enableAtStartup=b; } void setEnableAtStartup(bool b) { enableAtStartup=b; }
bool getEnableAtStartup(void) { return enableAtStartup; } bool getEnableAtStartup(void) { return enableAtStartup; }
//! get the date and time the TLE elements were updated //! get the date and time the TLE elements were updated
QDateTime getLastUpdate(void) {return lastUpdate;} QDateTime getLastUpdate(void) {return lastUpdate;}
//! get the update frequency in days //! get the update frequency in days
int getUpdateFrequencyDays(void) {return updateFrequencyDays;} int getUpdateFrequencyDays(void) {return updateFrequencyDays;}
void setUpdateFrequencyDays(int days) {updateFrequencyDays = days;} void setUpdateFrequencyDays(int days) {updateFrequencyDays = days;}
//! get the number of seconds till the next update //! get the number of seconds till the next update
int getSecondsToUpdate(void); int getSecondsToUpdate(void);
//! Get the current updateState //! Get the current updateState
UpdateState getUpdateState(void) {return updateState;} UpdateState getUpdateState(void) {return updateState;}
//! Get count of quasars from catalog
int getCountQuasars(void) {return QsrCount;}
signals: signals:
//! @param state the new update state. //! @param state the new update state.
void updateStateChanged(Quasars::UpdateState state); void updateStateChanged(Quasars::UpdateState state);
//! emitted after a JSON update has run. //! emitted after a JSON update has run.
void jsonUpdateComplete(void); void jsonUpdateComplete(void);
public slots: public slots:
//! Download JSON from web recources described in the module section of the //! Download JSON from web recources described in the module section of the
//! module.ini file and update the local JSON file. //! module.ini file and update the local JSON file.
skipping to change at line 207 skipping to change at line 215
bool checkJsonFileFormat(void); bool checkJsonFileFormat(void);
//! parse JSON file and load quasars to map //! parse JSON file and load quasars to map
QVariantMap loadQSOMap(QString path=QString()); QVariantMap loadQSOMap(QString path=QString());
//! set items for list of struct from data map //! set items for list of struct from data map
void setQSOMap(const QVariantMap& map); void setQSOMap(const QVariantMap& map);
QString catalogJsonPath; QString catalogJsonPath;
class StelTextureNew* texPointer; int QsrCount;
class StelTextureNew* markerTexture;
StelTextureSP texPointer;
QList<QuasarP> QSO; QList<QuasarP> QSO;
// variables and functions for the updater // variables and functions for the updater
UpdateState updateState; UpdateState updateState;
QNetworkAccessManager* downloadMgr; QNetworkAccessManager* downloadMgr;
QString updateUrl; QString updateUrl;
QTimer* updateTimer; QTimer* updateTimer;
QTimer* messageTimer; QTimer* messageTimer;
QList<int> messageIDs; QList<int> messageIDs;
bool updatesEnabled; bool updatesEnabled;
QDateTime lastUpdate; QDateTime lastUpdate;
int updateFrequencyDays; int updateFrequencyDays;
bool distributionEnabled;
bool enableAtStartup; bool enableAtStartup;
QSettings* conf; QSettings* conf;
// GUI // GUI
QuasarsDialog* configDialog; QuasarsDialog* configDialog;
bool flagShowQuasars; bool flagShowQuasars;
bool flagShowQuasarsButton; bool flagShowQuasarsButton;
QPixmap* OnIcon; QPixmap* OnIcon;
QPixmap* OffIcon; QPixmap* OffIcon;
QPixmap* GlowIcon; QPixmap* GlowIcon;
StelButton* toolbarButton; StelButton* toolbarButton;
QProgressBar* progressBar; class StelProgressController* progressBar;
private slots: private slots:
//! check to see if an update is required. This is called periodica lly by a timer //! check to see if an update is required. This is called periodica lly by a timer
//! if the last update was longer than updateFrequencyHours ago then the update is //! if the last update was longer than updateFrequencyHours ago then the update is
//! done. //! done.
void checkForUpdate(void); void checkForUpdate(void);
void updateDownloadComplete(QNetworkReply* reply); void updateDownloadComplete(QNetworkReply* reply);
}; };
#include "fixx11h.h"
#include <QObject> #include <QObject>
#include "StelPluginInterface.hpp" #include "StelPluginInterface.hpp"
//! This class is used by Qt to manage a plug-in interface //! This class is used by Qt to manage a plug-in interface
class QuasarsStelPluginInterface : public QObject, public StelPluginInterfa ce class QuasarsStelPluginInterface : public QObject, public StelPluginInterfa ce
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "stellarium.StelGuiPluginInterface/1.0")
Q_INTERFACES(StelPluginInterface) Q_INTERFACES(StelPluginInterface)
public: public:
virtual StelModule* getStelModule() const; virtual StelModule* getStelModule() const;
virtual StelPluginInfo getPluginInfo() const; virtual StelPluginInfo getPluginInfo() const;
}; };
#endif /*_QUASARS_HPP_*/ #endif /*_QUASARS_HPP_*/
 End of changes. 12 change blocks. 
11 lines changed or deleted 18 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/