map2d_widget
maptype.h
Go to the documentation of this file.
1 
12 /*
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 */
27 #ifndef MAPTYPE_H
28 #define MAPTYPE_H
29 #include <QMetaObject>
30 #include <QMetaEnum>
31 #include <QStringList>
32 
33 namespace core {
34  class MapType:public QObject
35  {
36  Q_OBJECT
37  Q_ENUMS(Types)
38  public:
39  enum Types
40  {
46 
52 
57 
62 
63  BingMap=444,
66 
71 
72  // use these numbers to clean up old stuff
73  //ArcGIS_MapsLT_Map_Old= 877,
74  //ArcGIS_MapsLT_OrtoFoto_Old = 888,
75  //ArcGIS_MapsLT_Map_Labels_Old = 890,
76  //ArcGIS_MapsLT_Map_Hybrid_Old = 899,
77  //ArcGIS_MapsLT_Map=977,
78  //ArcGIS_MapsLT_OrtoFoto=988,
79  //ArcGIS_MapsLT_Map_Labels=990,
80  //ArcGIS_MapsLT_Map_Hybrid=999,
81  //ArcGIS_MapsLT_Map=978,
82  //ArcGIS_MapsLT_OrtoFoto=989,
83  //ArcGIS_MapsLT_Map_Labels=991,
84  //ArcGIS_MapsLT_Map_Hybrid=998,
85 
90 
93 
98 
99  YandexMapRu = 5000
100  };
101  static QString StrByType(Types const& value)
102  {
103  QMetaObject metaObject = MapType().staticMetaObject;
104  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
105  QString s=metaEnum.valueToKey(value);
106  return s;
107  }
108  static Types TypeByStr(QString const& value)
109  {
110  QMetaObject metaObject = MapType().staticMetaObject;
111  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
112  Types s=(Types)metaEnum.keyToValue(value.toLatin1());
113  return s;
114  }
115  static QStringList TypesList()
116  {
117  QStringList ret;
118  QMetaObject metaObject = MapType().staticMetaObject;
119  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
120  for(int x=0;x<metaEnum.keyCount();++x)
121  {
122  ret.append(metaEnum.key(x));
123  }
124  return ret;
125  }
126  };
127 
128 }
129 #endif // MAPTYPE_H
Definition: maptype.h:63
Definition: maptype.h:44
Definition: maptype.h:68
Definition: maptype.h:45
Definition: maptype.h:55
Definition: maptype.h:49
Types
Definition: maptype.h:39
Definition: maptype.h:67
Definition: accessmode.h:35
Definition: maptype.h:65
Definition: maptype.h:48
Definition: maptype.h:41
Definition: maptype.h:64
Definition: maptype.h:51
Definition: maptype.h:95
Definition: maptype.h:58
Definition: maptype.h:91
Definition: maptype.h:53
static Types TypeByStr(QString const &value)
Definition: maptype.h:108
static QString StrByType(Types const &value)
Definition: maptype.h:101
Definition: maptype.h:59
Definition: maptype.h:34
Definition: maptype.h:70
static QStringList TypesList()
Definition: maptype.h:115
Definition: maptype.h:60
Definition: maptype.h:97
Definition: maptype.h:94
Definition: maptype.h:54
Definition: maptype.h:92
Definition: maptype.h:99
Definition: maptype.h:69
Definition: maptype.h:47
Definition: maptype.h:50
Definition: maptype.h:61
Definition: maptype.h:96
Definition: maptype.h:86
Definition: maptype.h:42
Definition: maptype.h:43