00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _STELLOCATIONMGR_HPP_
00020 #define _STELLOCATIONMGR_HPP_
00021
00022 #include "StelLocation.hpp"
00023 #include <QString>
00024 #include <QObject>
00025 #include <QMetaType>
00026 #include <QMap>
00027
00028 class QStringListModel;
00029
00032 class StelLocationMgr : public QObject
00033 {
00034 Q_OBJECT
00035
00036 public:
00038 StelLocationMgr();
00040 ~StelLocationMgr();
00041
00043 QStringListModel* getModelAll() {return modelAllLocation;}
00044
00046 const StelLocation locationForSmallString(const QString& s) const;
00047
00050 bool canSaveUserLocation(const StelLocation& loc) const;
00051
00054 bool saveUserLocation(const StelLocation& loc);
00055
00059 bool canDeleteUserLocation(const QString& id) const;
00060
00064 bool deleteUserLocation(const QString& id);
00065
00066 private:
00068 void loadCities(const QString& fileName, bool isUserLocation);
00069
00071 QStringListModel* modelAllLocation;
00072
00074 QMap<QString, StelLocation> locations;
00075 };
00076
00077 #endif // _STELLOCATIONMGR_HPP_