LP-311 Remove basic/advanced stabilization tab auto-switch (autotune/txpid lock issues)
[librepilot.git] / ground / gcs / src / libs / utils / xmlconfig.h
blob5c01ff27e45893788d8918466d1f47a7ad5a7d70
1 /**
2 ******************************************************************************
3 * @file
4 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
5 * @see The GNU Public License (GPL) Version 3
6 * @addtogroup GCSPlugins GCS Plugins
7 * @{
8 * @addtogroup importexportplugin
9 * @{
10 *****************************************************************************/
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #ifndef XMLCONFIG_H
27 #define XMLCONFIG_H
29 #if defined(QTCREATOR_UTILS_LIB)
30 # define XMLCONFIG_EXPORT Q_DECL_EXPORT
31 #else
32 # define XMLCONFIG_EXPORT Q_DECL_IMPORT
33 #endif
35 #include <QtCore/qglobal.h>
36 #include <QSettings>
37 #include <QDomElement>
38 #include <QObject>
39 #include <QDataStream>
41 class XMLCONFIG_EXPORT XmlConfig : QObject {
42 Q_OBJECT
43 public:
44 static const QSettings::Format XmlSettingsFormat;
46 static bool readXmlFile(QIODevice &device, QSettings::SettingsMap &map);
47 static bool writeXmlFile(QIODevice &device, const QSettings::SettingsMap &map);
49 private:
50 static QString rootName;
52 static void handleNode(QDomElement *node, QSettings::SettingsMap &map, QString path = "");
53 static QSettings::SettingsMap settingsToMap(QSettings & qs);
54 static QString variantToString(const QVariant &v);
55 static QVariant stringToVariant(const QString &s);
56 static QStringList splitArgs(const QString &s, int idx);
59 #endif // XMLCONFIG_H
60 /**
61 * @}
62 * @}