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 "mapviewscreen.h"
35 #include "updatelocation/updatelocationdialog.h"
36 #include "ui/mainwindow.h"
41 * @brief Main Window Class
43 * @class MainWindow mainwindow.h "src/ui/mainwindow.h"
45 class MainWindow : public QMainWindow
53 * @param parent Parent
55 MainWindow(QWidget *parent = 0);
57 /*******************************************************************************
58 * MEMBER FUNCTIONS AND SLOTS
59 ******************************************************************************/
62 * @brief Slot for auto centering enabling.
64 * @param checked true if button state is checked, false otherwise
66 void autoCenteringToggled(bool checked);
69 * @brief Slot for map location change.
71 void mapLocationChanged();
74 * @brief Public slot, which open settings dialog
76 void openSettingsDialog();
79 * @brief Toggle progress indicator.
81 * @param state true if progress indicator should be shown, false otherwise
83 void toggleProgressIndicator(bool state);
87 * @brief Private method to create the Menu items
92 * @brief Show Maemo information box with message.
94 * @brief message information message
96 void showMaemoInformationBox(const QString &message);
100 * @brief Slot for gps enabling.
102 * @param checked true if button state is checked, false otherwise
104 void gpsActionToggled(bool checked);
107 * @brief Slot for gps timeout.
109 * Called when request timeout occurs.
114 * @brief Slot for gps error.
116 * @param message error message
118 void gpsError(const QString &message);
121 * @brief Private slot, which starts UpdateLocationDialog
124 void openLocationUpdateDialog();
126 /*******************************************************************************
128 ******************************************************************************/
131 * @brief Signal for map auto centering
133 * @param enabled true if map should auto center to gps location
135 void enableAutoCentering(bool enabled);
138 * @brief Signal for gps enabling.
140 * @param enabled true if gps should be enabled
142 void enableGPS(bool enabled);
145 * @brief Signal for friend location ready.
149 void friendsLocationsReady(QList<User *> &friendsList);
152 * @brief Signal for gps position.
154 * @param position longitude and latitude values
156 void positionReceived(QPointF position);
159 * @brief Signal for refreshing user data.
162 void refreshUserData();
165 * @brief Signal for requesting reverseGeo from SituareEngine
168 void requestReverseGeo();
171 * @brief Signals, when address data is ready
173 * @param address Street address
175 void reverseGeoReady(const QString &address);
178 * @brief Signal for requestLocationUpdate from SituareEngine
180 * @param status Status message
181 * @param publish Publish on Facebook
183 void statusUpdate(const QString &status, const bool &publish);
186 * @brief Signal for use location ready.
188 * @param user User object
190 void userLocationReady(User *user);
192 /*******************************************************************************
194 ******************************************************************************/
196 UpdateLocationDialog *m_locationDialog; ///< Message dialog
197 MapViewScreen *m_mapViewScreen; ///< Instance of the map view
198 QAction *m_autoCenteringAct; ///< Action to auto center map using gps position
199 QAction *m_gpsToggleAct; ///< Action to trigger gps toggle
200 QAction *m_toSettingsAct; ///< Action to trigger switch to settings dialog
201 QMenu *m_viewMenu; ///< Object that hold the view menu items
204 #endif // MAINWINDOW_H