summaryrefslogtreecommitdiff
path: root/src/plugins/position/simulator/qgeosatelliteinfosource_simulator_p.h
diff options
context:
space:
mode:
authorAlex Wilson <alex.wilson@nokia.com>2012-03-07 16:38:50 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-12 03:25:51 +0100
commit369fa99b132f8c1425da8a41f1436b8d86aaa50e (patch)
treea13d675390d1590df27c70a4ee47b6490cc58800 /src/plugins/position/simulator/qgeosatelliteinfosource_simulator_p.h
parentc435861528161ee931287034f41023c11dfb7ba3 (diff)
downloadqtlocation-369fa99b132f8c1425da8a41f1436b8d86aaa50e.tar.gz
Update positioning sources to use new plugin style
Notably, also splits the default sources that were previously compiled into the library, out into their own plugins. This follows a similar pattern to the geoservices change. We also drop the "plugin whitelisting" feature in favour of a simple Priority value in the plugin JSON -- the whitelist provides no additional security over this solution on any of our platforms. Task-number: QTBUG-24331 Change-Id: I62a9c940157ad2e33a9a575fa09633b98656b276 Reviewed-by: Alex <alex.blasche@nokia.com>
Diffstat (limited to 'src/plugins/position/simulator/qgeosatelliteinfosource_simulator_p.h')
-rw-r--r--src/plugins/position/simulator/qgeosatelliteinfosource_simulator_p.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/plugins/position/simulator/qgeosatelliteinfosource_simulator_p.h b/src/plugins/position/simulator/qgeosatelliteinfosource_simulator_p.h
new file mode 100644
index 00000000..0d76a375
--- /dev/null
+++ b/src/plugins/position/simulator/qgeosatelliteinfosource_simulator_p.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtLocation module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGEOSATELLITEINFOSOURCE_SIMULATOR_H
+#define QGEOSATELLITEINFOSOURCE_SIMULATOR_H
+
+#include <QTimer>
+#include "qgeosatelliteinfosource.h"
+#include "qgeosatelliteinfo.h"
+
+#define MINIMUM_UPDATE_INTERVAL 1000
+#define DEFAULT_UPDATE_INTERVAL 5000
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+class QGeoSatelliteInfoSourceSimulator : public QGeoSatelliteInfoSource
+{
+ Q_OBJECT
+
+public:
+ explicit QGeoSatelliteInfoSourceSimulator(QObject *parent = 0);
+
+ virtual void setUpdateInterval(int msec);
+ virtual int minimumUpdateInterval() const;
+
+ // Default implementation for error()
+ Error error() const { return QGeoSatelliteInfoSource::UnknownSourceError; }
+public slots:
+ virtual void startUpdates();
+ virtual void stopUpdates();
+ virtual void requestUpdate(int timeout = 5000);
+
+private slots:
+ void updateData();
+
+private:
+ Q_DISABLE_COPY(QGeoSatelliteInfoSourceSimulator)
+ QTimer *timer;
+ QTimer *requestTimer;
+};
+
+QT_END_NAMESPACE
+
+#endif // QGEOSATELLITEINFOSOURCE_SIMULATOR_H
+