Updated some changes to userinfo
[situare] / src / ui / mapviewscreen.h
1  /*
2     Situare - A location system for Facebook
3     Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Kaj Wallin - kaj.wallin@ixonos.com
6
7     Situare is free software; you can redistribute it and/or
8     modify it under the terms of the GNU General Public License
9     version 2 as published by the Free Software Foundation.
10
11     Situare is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with Situare; if not, write to the Free Software
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
19     USA.
20  */
21
22
23 #ifndef MAPVIEWTAB_H
24 #define MAPVIEWTAB_H
25
26 #include <QtGui>
27
28 #include "map/mapengine.h"
29 #include "friendlistpanel.h"
30 #include "userpanel.h"
31 #include "zoombuttonpanel.h"
32
33 /**
34 * @brief Map View class. Used to display Map
35 *
36 * @class MapViewScreen mainwindow.h "src/ui/mainwindow.h"
37 */
38 class MapViewScreen : public QWidget
39 {
40     Q_OBJECT
41
42 public:
43     /**
44     * @brief Constructor
45     *
46     * @param parent Parent
47     */
48     MapViewScreen(QWidget *parent = 0);
49
50 /*******************************************************************************
51  * MEMBER FUNCTIONS AND SLOTS
52  ******************************************************************************/
53 private slots:
54     /**
55     * @brief Slot for enabling auto centering.
56     *
57     * @param enabled true if map should center to GPS position, false otherwise
58     */
59     void enableAutoCentering(bool enabled);
60
61     /**
62     * @brief Slot for drawing the Open Street Map license text
63     *
64     * @param width Width of the viewport
65     * @param height Height of the viewport
66     */
67     void drawOsmLicense(int width, int height);
68
69     /**
70     * @brief Slot for map location change.
71     */
72     void locationChanged();
73
74     /**
75     * @brief Slot for GPS position.
76     *
77     * @param position latitude and longitude values
78     * @param accuracy coordinate accuracy in metres
79     */
80     void positionReceived(QPointF position, qreal accuracy);
81
82 /*******************************************************************************
83  * SIGNALS
84  ******************************************************************************/
85 signals:
86     /**
87     * @brief Signal when friend list locations are fetched
88     *
89     * Forwarded to map engine and friends list panel
90     *
91     * @param friendsList Friends list data
92     */
93     void friendsLocationsReady(QList<User *> &friendsList);
94
95         /**
96     * @brief Signal for map location change.
97     */
98     void mapLocationChanged();  
99
100     /**
101     * @brief Signal when user location is fetched
102     *
103     * @param user User data
104     */
105     void userLocationReady(User *user);  
106
107     /**
108       * @brief Signal for HW increase button
109       */
110     void zoomInKeyPressed();
111
112     /**
113       * @brief Signal for HW decrease button
114       */
115     void zoomOutKeyPressed();
116
117     void requestReverseGeo();
118
119     /**
120     * @brief Signals, when address data is ready
121     *
122     * @param address Street address
123     */
124     void reverseGeoReady(const QString &address);
125
126     /**
127     * @brief Signal Signal for requestLocationUpdate from SituareEngine via MainWindow class
128     *
129     * @param status Status message
130     * @param publish Publish on Facebook
131     */
132     void statusUpdate(const QString &status, const bool &publish);
133
134     void refreshUserData();
135
136 /*******************************************************************************
137  * DATA MEMBERS
138  ******************************************************************************/
139 private:
140     MapEngine *m_mapEngine;                 ///< MapEngine
141     UserInfoPanel *m_userPanel;             ///< Instance of the user information panel
142     FriendListPanel *m_friendsListPanel;    ///< Instance of friends list panel
143     ZoomButtonPanel *m_zoomButtonPanel;     ///< Instance of zoom button panel
144     QLabel *m_osmLicense;                   ///< Label for Open Street Map license
145     bool m_autoCenteringEnabled;            ///< Enable
146 };
147
148 #endif // MAPVIEWTAB_H