19 #ifndef _STELLOCATIONMGR_HPP_
20 #define _STELLOCATIONMGR_HPP_
22 #include "StelLocation.hpp"
28 class QStringListModel;
48 QList<StelLocation>
getAll()
const {
return locations.values();}
83 void pickLocationsNearby(
const QString planetName,
const float longitude,
const float latitude,
const float radiusDegrees);
86 void pickLocationsInCountry(
const QString country);
93 void generateBinaryLocationFile(
const QString& txtFile,
bool isUserLocation,
const QString& binFile)
const;
96 QMap<QString, StelLocation> loadCities(
const QString& fileName,
bool isUserLocation)
const;
97 QMap<QString, StelLocation> loadCitiesBin(
const QString& fileName)
const;
100 QStringListModel* modelAllLocation;
102 QStringListModel* modelPickedLocation;
105 QMap<QString, StelLocation> locations;
107 QMap<QString, StelLocation> pickedLocations;
112 #endif // _STELLOCATIONMGR_HPP_
const StelLocation locationForString(const QString &s) const
Return the StelLocation for a given string Can match location name, or coordinates.
Store the informations for a location on a planet.
~StelLocationMgr()
Destructor.
QList< StelLocation > getAll() const
Return the list of all loaded locations.
QStringListModel * getModelAll()
Return the model containing all the city.
StelLocationMgr()
Default constructor.
Manage the list of available location.
const StelLocation locationFromCLI() const
Return the StelLocation from a CLI.
bool saveUserLocation(const StelLocation &loc)
Add permanently a location to the list of user locations It is later identified by its small string...
QStringListModel * getModelPicked()
Return the model containing picked (nearby) cities or cities from a single country, or other preselection.
void changeLocationFromNetworkLookup()
Process answer from online lookup of IP address.
const StelLocation & getLastResortLocation() const
Return a valid location when no valid one was found.
bool deleteUserLocation(const QString &id)
Delete permanently the given location from the list of user locations If the location comes from the ...
bool canDeleteUserLocation(const QString &id) const
Get whether a location can be deleted from the list of user locations If the location comes from the ...
void locationFromIP()
Find location via online lookup of IP address.
bool canSaveUserLocation(const StelLocation &loc) const
Get whether a location can be permanently added to the list of user locations The main constraint is ...