source: flair-src/trunk/tools/FlairGCS/src/mapwidget.h @ 15

Last change on this file since 15 was 15, checked in by Bayard Gildas, 5 years ago

sources reformatted with flair-format-dir script

File size: 3.4 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5/****************************************************************************
6**
7** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
8** All rights reserved.
9** Contact: Nokia Corporation (qt-info@nokia.com)
10**
11** This file is part of the documentation of Qt. It was originally
12** published as part of Qt Quarterly.
13**
14** $QT_BEGIN_LICENSE:LGPL$
15** Commercial Usage
16** Licensees holding valid Qt Commercial licenses may use this file in
17** accordance with the Qt Commercial License Agreement provided with the
18** Software or, alternatively, in accordance with the terms contained in
19** a written agreement between you and Nokia.
20**
21** GNU Lesser General Public License Usage
22** Alternatively, this file may be used under the terms of the GNU Lesser
23** General Public License version 2.1 as published by the Free Software
24** Foundation and appearing in the file LICENSE.LGPL included in the
25** packaging of this file.  Please review the following information to
26** ensure the GNU Lesser General Public License version 2.1 requirements
27** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
28**
29** In addition, as a special exception, Nokia gives you certain additional
30** rights.  These rights are described in the Nokia Qt LGPL Exception
31** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
32**
33** GNU General Public License Usage
34** Alternatively, this file may be used under the terms of the GNU
35** General Public License version 3.0 as published by the Free Software
36** Foundation and appearing in the file LICENSE.GPL included in the
37** packaging of this file.  Please review the following information to
38** ensure the GNU General Public License version 3.0 requirements will be
39** met: http://www.gnu.org/copyleft/gpl.html.
40**
41** If you have questions regarding the use of this file, please contact
42** Nokia at qt-info@nokia.com.
43** $QT_END_LICENSE$
44**
45****************************************************************************/
46
47#ifndef MAPWIDGET_H
48#define MAPWIDGET_H
49
50#include <QGraphicsView>
51#include <QGraphicsGeoMap>
52
53class QGraphicsScene;
54class Map;
55class Landmark;
56
57using namespace QtMobility;
58
59class MapWidget : public QGraphicsView {
60  Q_OBJECT
61
62public:
63  MapWidget(Map *map, QWidget *parent = 0);
64  void setMap(QtMobility::QGraphicsGeoMap *geoMap);
65  QGraphicsScene *scene() const;
66  bool IsUptodate(void);
67  void SetUptodate(void);
68  void Reset(void);
69  QList<Landmark *> *Landmarks(void);
70  bool LandmarkToSend(int index);
71  void AddLandmark(const QGeoCoordinate &coordinate);
72  void RemoveLandmarks(void);
73  void AddLandmarks(QGraphicsGeoMap *geoMap);
74  void AddPoint(QString name);
75
76signals:
77  void positionChanged(const QGeoCoordinate &coordinate);
78
79protected:
80  void mousePressEvent(QMouseEvent *event);
81  void mouseMoveEvent(QMouseEvent *event);
82  void mouseReleaseEvent(QMouseEvent *event);
83  void resizeEvent(QResizeEvent *event);
84  void wheelEvent(QWheelEvent *event);
85  void mouseDoubleClickEvent(QMouseEvent *event);
86
87private slots:
88  void initDrag();
89
90private:
91  QGraphicsGeoMap *geoMap;
92  bool dragging;
93  QPoint dragStartPosition;
94  bool pressed;
95  bool is_uptodate;
96
97  QGraphicsScene *m_scene;
98  QList<Landmark *> *landmarks;
99  QList<Landmark *> *landmarks_old;
100  QList<QString> points;
101  Landmark *landmark_match;
102  Map *map;
103};
104
105#endif
Note: See TracBrowser for help on using the repository browser.