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 ******************************************************************************/
69 * @brief Public slot, which open settings dialog
71 void openSettingsDialog();
74 * @brief Public slot, which initiates toListViewAct action to switch view
79 * @brief Public slot, which initiates toMapViewAct action to switch view
85 * @brief Private method to create the Menu items
90 * @brief Private method to create List and Map views as a stacked widget
95 * @brief Method used to switch active view.
97 * @param nextIndex 0 for listview, 1 for mapview
103 * @brief Slot to change value of m_loggedIn to true
108 * @brief Slot to check login status and exits if necessary
110 void loginScreenClosed();
113 * @brief Private slot, which starts UpdateLocationDialog
116 void openLocationUpdateDialog();
118 /*******************************************************************************
120 ******************************************************************************/
125 * @brief Signal for requesting reverseGeo from SituareEngine
128 void requestReverseGeo();
131 * @brief Signals, when address data is ready
133 * @param address Street address
135 void reverseGeoReady(const QString &address);
138 * @brief Signal for requestLocationUpdate from SituareEngine
140 * @param status Status message
141 * @param publish Publish on Facebook
143 void statusUpdate(const QString &status, const bool &publish);
145 /*******************************************************************************
147 ******************************************************************************/
150 ListViewScreen *m_listViewScreen;
151 UpdateLocationDialog *m_locationDialog; ///< Message dialog
152 MapViewScreen *m_mapViewScreen;
153 FacebookAuthentication *m_facebookAuthenticator; ///< Instance for facebook authenticator
154 QNetworkAccessManager *m_networkManager; ///< NetworkManager that is passed on to SituareService
155 SituareService *m_situareService; ///< Instance of the situare server communication service
156 bool m_loggedIn; ///< Boolean value to indicate whether login has been successfull or not
157 QStackedWidget *m_situareViews; ///< Stacked widget that hold both view widgets
158 QAction *m_toListViewAct; ///< Action to trigger switch to list view
159 QAction *m_toMapViewAct; ///< Action to trigger switch to map view
160 QAction *m_toSettingsAct; ///< Action to trigger switch to settings dialog
161 QMenu *m_viewMenu; ///< Object that hold the view menu items
164 #endif // MAINWINDOW_H