Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure

core/StelLocationMgr.hpp

00001 /*
00002  * Copyright (C) 2008 Fabien Chereau
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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_

Generated on Mon Feb 2 17:23:47 2009 for Stellarium by  doxygen 1.5.5