summaryrefslogtreecommitdiff
path: root/tests/auto/qgeoareamonitor/logfilepositionsource.h
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2013-08-26 09:35:01 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-17 11:38:14 +0200
commit0ed9f7496656fa0ea52d703c7fddff26c2192857 (patch)
treeec0d4d7dc638e8018a8896a0b62cc91840c9c23d /tests/auto/qgeoareamonitor/logfilepositionsource.h
parent87ce030b7b7336e561779dc9516d5ae2242a5d5f (diff)
downloadqtlocation-0ed9f7496656fa0ea52d703c7fddff26c2192857.tar.gz
Improve area monitoring API.
1.) QGeoAreaMonitor renamed to QGeoAreaMonitorSource 2.) Add new QGeoAreaMonitorInfo data type encpsulating individual areas to be monitored 3.) Port positionpoll plug-in to new features 4.) Make positionpoll monitor thread safe 4.) Extend and fix the QGeoAreaMonitor unit test 5.) Fix documentation. Task-number: QTBUG-31711 Change-Id: Icfc982de4753d2f43cb4d15c234eb7b7c039a0c4 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'tests/auto/qgeoareamonitor/logfilepositionsource.h')
-rw-r--r--tests/auto/qgeoareamonitor/logfilepositionsource.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/auto/qgeoareamonitor/logfilepositionsource.h b/tests/auto/qgeoareamonitor/logfilepositionsource.h
new file mode 100644
index 00000000..966b2540
--- /dev/null
+++ b/tests/auto/qgeoareamonitor/logfilepositionsource.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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, Digia gives you certain additional
+** rights. These rights are described in the Digia 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.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LOGFILEPOSITIONSOURCE_H
+#define LOGFILEPOSITIONSOURCE_H
+
+#include <qgeopositioninfosource.h>
+
+QT_BEGIN_NAMESPACE
+class QFile;
+class QTimer;
+QT_END_NAMESPACE
+
+class LogFilePositionSource : public QGeoPositionInfoSource
+{
+ Q_OBJECT
+public:
+ LogFilePositionSource(QObject *parent = 0);
+
+ QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const;
+
+ PositioningMethods supportedPositioningMethods() const;
+ int minimumUpdateInterval() const;
+ Error error() const;
+
+public slots:
+ virtual void startUpdates();
+ virtual void stopUpdates();
+
+ virtual void requestUpdate(int timeout = 5000);
+
+private slots:
+ void readNextPosition();
+
+private:
+ QFile *logFile;
+ QTimer *timer;
+ QGeoPositionInfo lastPosition;
+};
+
+#endif