dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
languagetype.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 LANGUAGETYPE_H
28 #define LANGUAGETYPE_H
29 
30 #include <QString>
31 #include <QMetaObject>
32 #include <QMetaEnum>
33 #include <QStringList>
34 #include "corecommon.h"
35 
36 namespace core {
37  class TLMAPWIDGET_EXPORT LanguageType:public QObject
38  {
39  Q_OBJECT
40  Q_ENUMS(Types)
41  public:
42  enum Types
43  {
44  Arabic,
45  Bulgarian,
46  Bengali,
47  Catalan,
48  Czech,
49  Danish,
50  German,
51  Greek,
52  English,
53  EnglishAustralian,
54  EnglishGreatBritain,
55  Spanish,
56  Basque,
57  Finnish,
58  Filipino,
59  French,
60  Galician,
61  Gujarati,
62  Hindi,
63  Croatian,
64  Hungarian,
65  Indonesian,
66  Italian,
67  Hebrew,
68  Japanese,
69  Kannada,
70  Korean,
71  Lithuanian,
72  Latvian,
73  Malayalam,
74  Marathi,
75  Dutch,
76  NorwegianNynorsk,
77  Norwegian,
78  Oriya,
79  Polish,
80  Portuguese,
81  PortugueseBrazil,
82  PortuguesePortugal,
83  Romansch,
84  Romanian,
85  Russian,
86  Slovak,
87  Slovenian,
88  Serbian,
89  Swedish,
90  Tamil,
91  Telugu,
92  Thai,
93  Turkish,
94  Ukrainian,
95  Vietnamese,
96  ChineseSimplified,
97  ChineseTraditional,
98  autoDetect
99  };
100 
101  static QString StrByType(Types const& value)
102  {
103  QMetaObject metaObject = LanguageType().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 = LanguageType().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 = LanguageType().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  QString toShortString(Types type);
127  LanguageType();
128  ~LanguageType();
129  private:
130  QStringList list;
131  };
132 
133 }
134 #endif // LANGUAGETYPE_H
x
Definition: OPPlots.m:100