LocationMgr.hpp   StelLocationMgr.hpp 
skipping to change at line 19 skipping to change at line 19
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _LOCATION_MGR_HPP_ #ifndef _STELLOCATIONMGR_HPP_
#define _LOCATION_MGR_HPP_ #define _STELLOCATIONMGR_HPP_
#include "Location.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 LocationMgr //! @class StelLocationMgr
//! Manage the list of available location. //! Manage the list of available location.
class LocationMgr : public QObject class StelLocationMgr : public QObject
{ {
Q_OBJECT; Q_OBJECT
public: public:
//! Default constructor //! Default constructor
LocationMgr(); StelLocationMgr();
//! Destructor //! Destructor
~LocationMgr(); ~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 Location for the given row (match modelAllLocation in //! Return the StelLocation for the given row (match modelAllLocatio
dex row) n index row)
const Location locationForSmallString(const QString& s) const; const StelLocation locationForSmallString(const QString& s) const;
//! Get whether a location can be permanently added to the list of u ser locations //! Get whether a location can be permanently added to the list of u ser locations
//! The main constraint is that the small string must be unique //! The main constraint is that the small string must be unique
bool canSaveUserLocation(const Location& loc) const; bool canSaveUserLocation(const StelLocation& loc) const;
//! Add permanently a location to the list of user locations //! Add permanently a location to the list of user locations
//! It is later identified by its small string //! It is later identified by its small string
bool saveUserLocation(const Location& loc); bool saveUserLocation(const StelLocation& loc);
//! 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);
private: private:
//! Load cities from a file //! Load cities from a file
void loadCities(const QString& fileName, bool isUserLocation); void loadCities(const QString& fileName, bool isUserLocation);
//! Model containing all the city information //! Model containing all the city information
QStringListModel* modelAllLocation; QStringListModel* modelAllLocation;
//! The list of all loaded locations //! The list of all loaded locations
QMap<QString, Location> locations; QMap<QString, StelLocation> locations;
}; };
#endif // _LOCATION_MGR_HPP_ #endif // _STELLOCATIONMGR_HPP_
 End of changes. 12 change blocks. 
14 lines changed or deleted 14 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/