2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Henri Lampela - henri.lampela@ixonos.com
6 Kaj Wallin - kaj.wallin@ixonos.com
8 Situare is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 version 2 as published by the Free Software Foundation.
12 Situare is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Situare; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
27 #include <QtGui/QMainWindow>
31 #include "facebookservice/facebookauthentication.h"
32 #include "situareservice/situareservice.h"
33 #include <QNetworkAccessManager>
34 #include "listviewscreen.h"
35 #include "mapviewscreen.h"
36 #include "updatelocation/updatelocationdialog.h"
37 #include "ui/mainwindow.h"
43 * @brief Main Window Class
45 * @class MainWindow mainwindow.h "src/ui/mainwindow.h"
47 class MainWindow : public QMainWindow
55 * @param parent Parent
57 MainWindow(QWidget *parent = 0);
64 /*******************************************************************************
65 * MEMBER FUNCTIONS AND SLOTS
66 ******************************************************************************/
70 * @brief Slot for auto centering enabling.
72 * @param checked true if button state is checked, false otherwise
74 void autoCenteringToggled(bool checked);
77 * @brief Public slot, which open settings dialog
79 void openSettingsDialog();
82 * @brief Public slot, which initiates toListViewAct action to switch view
87 * @brief Public slot, which initiates toMapViewAct action to switch view
92 * @brief Toggle progress indicator.
94 * @param state true if progress indicator should be shown, false otherwise
96 void toggleProgressIndicator(bool state);
100 * @brief Private method to create the Menu items
105 * @brief Private method to create List and Map views as a stacked widget
110 * @brief Method used to switch active view.
112 * @param nextIndex 0 for listview, 1 for mapview
114 void switchView(int);
116 void showMaemoInformationBox(const QString &message);
120 * @brief Private slot, which starts UpdateLocationDialog
123 void openLocationUpdateDialog();
126 * @brief Slot for gps enabling.
128 * @param checked true if button state is checked, false otherwise
130 void gpsActionToggled(bool checked);
133 * @brief Slot for gps timeout.
135 * Called when request timeout occurs.
140 * @brief Slot for gps error.
142 * @param message error message
144 void gpsError(const QString &message);
146 /*******************************************************************************
148 ******************************************************************************/
151 * @brief Signal for requesting reverseGeo from SituareEngine
154 void requestReverseGeo();
157 * @brief Signals, when address data is ready
159 * @param address Street address
161 void reverseGeoReady(const QString &address);
164 * @brief Signal for requestLocationUpdate from SituareEngine
166 * @param status Status message
167 * @param publish Publish on Facebook
169 void statusUpdate(const QString &status, const bool &publish);
172 * @brief Signal for use location ready.
174 * @param user User object
176 void userLocationReady(User *user);
179 * @brief Signal for friend location ready.
183 void friendsLocationsReady(QList<User *> &friendsList);
186 * @brief Signal for refreshing user data.
189 void refreshUserData();
192 * @brief Signal for gps position.
194 * @param position longitude and latitude values
196 void positionReceived(QPointF position);
199 * @brief Signal for gps enabling.
201 * @param enabled true if gps should be enabled
203 void enableGPS(bool enabled);
206 * @brief Signal for map auto centering
208 * @param enabled true if map should auto center to gps location
210 void enableAutoCentering(bool enabled);
212 /*******************************************************************************
214 ******************************************************************************/
216 ListViewScreen *m_listViewScreen; ///< Instance of the list view
217 UpdateLocationDialog *m_locationDialog; ///< Message dialog
218 MapViewScreen *m_mapViewScreen; ///< Instance of the map view
219 QStackedWidget *m_situareViews; ///< Stacked widget that hold both view widgets
220 QAction *m_autoCenteringAct; ///< Action to auto center map using gps position
221 QAction *m_gpsToggleAct; ///< Action to trigger gps toggle
222 QAction *m_toListViewAct; ///< Action to trigger switch to list view
223 QAction *m_toMapViewAct; ///< Action to trigger switch to map view
224 QAction *m_toSettingsAct; ///< Action to trigger switch to settings dialog
225 QMenu *m_viewMenu; ///< Object that hold the view menu items
228 #endif // MAINWINDOW_H