dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
geodecoderstatus.h
Go to the documentation of this file.
1 
13 /*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, see <http://www.gnu.org/licenses/>
26 */
27 #ifndef GEODECODERSTATUS_H
28 #define GEODECODERSTATUS_H
29 
30 #include <QObject>
31 #include <QMetaObject>
32 #include <QMetaEnum>
33 #include <QStringList>
34 #include "corecommon.h"
35 
36 namespace core {
37  class TLMAPWIDGET_EXPORT GeoCoderStatusCode:public QObject
38  {
39  Q_OBJECT
40  Q_ENUMS(Types)
41  public:
42  enum Types
43  {
47  UNKNOWN_ERROR = -1,
48 
52  OK,
53 
58  REQUEST_DENIED,
59 
63  INVALID_REQUEST=500,
64 
69  ZERO_RESULTS,
70 
75  OVER_QUERY_LIMIT
76 
77  };
78  static QString StrByType(Types const& value)
79  {
80  QMetaObject metaObject = GeoCoderStatusCode().staticMetaObject;
81  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
82  QString s=metaEnum.valueToKey(value);
83  return s;
84  }
85  static Types TypeByStr(QString const& value)
86  {
87  QMetaObject metaObject = GeoCoderStatusCode().staticMetaObject;
88  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
89  Types s=(Types)metaEnum.keyToValue(value.toLatin1());
90  return s;
91  }
92  static QStringList TypesList()
93  {
94  QStringList ret;
95  QMetaObject metaObject = GeoCoderStatusCode().staticMetaObject;
96  QMetaEnum metaEnum= metaObject.enumerator( metaObject.indexOfEnumerator("Types"));
97  for(int x=0;x<metaEnum.keyCount();++x)
98  {
99  ret.append(metaEnum.key(x));
100  }
101  return ret;
102  }
103 
104  };
105 }
106 #endif // GEODECODERSTATUS_H
x
Definition: OPPlots.m:100