StelLocationMgr.hpp   StelLocationMgr.hpp 
skipping to change at line 29 skipping to change at line 29
#ifndef _STELLOCATIONMGR_HPP_ #ifndef _STELLOCATIONMGR_HPP_
#define _STELLOCATIONMGR_HPP_ #define _STELLOCATIONMGR_HPP_
#include "StelLocation.hpp" #include "StelLocation.hpp"
#include <QString> #include <QString>
#include <QObject> #include <QObject>
#include <QMetaType> #include <QMetaType>
#include <QMap> #include <QMap>
class QStringListModel; class QStringListModel;
class QNetworkReply;
//! @class StelLocationMgr //! @class StelLocationMgr
//! Manage the list of available location. //! Manage the list of available location.
class StelLocationMgr : public QObject class StelLocationMgr : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
//! Default constructor //! Default constructor
StelLocationMgr(); StelLocationMgr();
//! Destructor //! Destructor
~StelLocationMgr(); ~StelLocationMgr();
//! Return the model containing all the city //! Return the model containing all the city
QStringListModel* getModelAll() {return modelAllLocation;} QStringListModel* getModelAll() {return modelAllLocation;}
//! Return the model containing picked (nearby) cities or cities fro
m a single country, or other preselection.
QStringListModel* getModelPicked() {return modelPickedLocation;}
//! Return the list of all loaded locations //! Return the list of all loaded locations
QList<StelLocation> getAll() const {return locations.values();} QList<StelLocation> getAll() const {return locations.values();}
//! Return the StelLocation for a given string //! Return the StelLocation for a given string
//! Can match location name, or coordinates //! Can match location name, or coordinates
const StelLocation locationForString(const QString& s) const; const StelLocation locationForString(const QString& s) const;
//! Return a valid location when no valid one was found. //! Return a valid location when no valid one was found.
const StelLocation& getLastResortLocation() const {return lastResort Location;} const StelLocation& getLastResortLocation() const {return lastResort Location;}
skipping to change at line 73 skipping to change at line 76
//! Get whether a location can be deleted from the list of user loca tions //! Get whether a location can be deleted from the list of user loca tions
//! If the location comes from the base read only list, it cannot be deleted //! If the location comes from the base read only list, it cannot be deleted
//! @param id the location ID //! @param id the location ID
bool canDeleteUserLocation(const QString& id) const; bool canDeleteUserLocation(const QString& id) const;
//! Delete permanently the given location from the list of user loca tions //! Delete permanently the given location from the list of user loca tions
//! If the location comes from the base read only list, it cannot be deleted and false is returned //! If the location comes from the base read only list, it cannot be deleted and false is returned
//! @param id the location ID //! @param id the location ID
bool deleteUserLocation(const QString& id); bool deleteUserLocation(const QString& id);
//! Find location via online lookup of IP address
void locationFromIP();
//! Preselect list of locations within @param radiusDegrees of selec
ted (usually screen-clicked) coordinates.
//! The list can be retrieved by calling @name getModelPicked().
void pickLocationsNearby(const QString planetName, const float longi
tude, const float latitude, const float radiusDegrees);
//! Preselect list of locations in a particular country only.
//! The list can be retrieved by calling @name getModelPicked().
void pickLocationsInCountry(const QString country);
public slots:
//! Process answer from online lookup of IP address
void changeLocationFromNetworkLookup();
private: private:
void generateBinaryLocationFile(const QString& txtFile, bool isUserL ocation, const QString& binFile) const; void generateBinaryLocationFile(const QString& txtFile, bool isUserL ocation, const QString& binFile) const;
//! Load cities from a file //! Load cities from a file
QMap<QString, StelLocation> loadCities(const QString& fileName, bool isUserLocation) const; QMap<QString, StelLocation> loadCities(const QString& fileName, bool isUserLocation) const;
QMap<QString, StelLocation> loadCitiesBin(const QString& fileName) c onst; QMap<QString, StelLocation> loadCitiesBin(const QString& fileName) c onst;
//! Model containing all the city information //! Model containing all the city information
QStringListModel* modelAllLocation; QStringListModel* modelAllLocation;
//! Model containing selected city information
QStringListModel* modelPickedLocation;
//! The list of all loaded locations //! The list of all loaded locations
QMap<QString, StelLocation> locations; QMap<QString, StelLocation> locations;
//! A list of locations generated on-the-fly by filtering from @name
locations
QMap<QString, StelLocation> pickedLocations;
StelLocation lastResortLocation; StelLocation lastResortLocation;
//! For IP-based location lookup
QNetworkReply *networkReply;
}; };
#endif // _STELLOCATIONMGR_HPP_ #endif // _STELLOCATIONMGR_HPP_
 End of changes. 6 change blocks. 
0 lines changed or deleted 29 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/