--- /dev/null
+/*
+ * I Am Here(iamhere) - an application to find user's location
+ * address.
+ * Copyright (C) 2010 Vytarani Mathane <vytarani.mathane@gmail.com>.
+ *
+ * This file is part of I Am Here.
+ *
+ * I Am Here is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * I Am Here is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with I Am Here. If not, see <http://www.gnu.org/licenses/>.
+ */
+#include <QtGui>
+#include <QMainWindow>
+
+#include <QWidget>
+#include <QGeoSearchManager>
+#include <QGeoServiceProvider>
+#include <QGeoPositionInfoSource>
+#include <QDebug>
+#include <QTimer>
+
+ QTM_USE_NAMESPACE
+ class Window:public QMainWindow {
+ Q_OBJECT
+ public:
+ Window(QWidget * parent);
+
+ private slots:
+ void positionUpdated(const QGeoPositionInfo & info);
+ void updateTimeout() {
+ // Current location could not be retrieved within the specified timeout of 5 seconds.
+ qWarning("Failed to retrieve current position.");
+ }
+ void advance();
+
+ public slots: void handlePressed();
+ void handlePressedClose();
+ void replyFinished(QGeoSearchReply * reply);
+ void resultsError(QGeoSearchReply * reply,
+ QGeoSearchReply::Error errorCode,
+ QString errorString);
+ private:
+ QGeoSearchManager * m_searchManager;
+ QGeoServiceProvider *m_serviceProvider;
+ QGeoPositionInfoSource *m_source;
+ QGeoCoordinate m_coord;
+ QLabel *m_imagelabel;
+ QLabel *m_textlabel;
+ QTimer *m_timer;
+ int m_flag;
+};