/*
- Situare - A location system for Facebook
- Copyright (C) 2010 Ixonos Plc. Authors:
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
- Henri Lampela - henri.lampela@ixonos.com
- Kaj Wallin - kaj.wallin@ixonos.com
+ Henri Lampela - henri.lampela@ixonos.com
+ Kaj Wallin - kaj.wallin@ixonos.com
- Situare is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- version 2 as published by the Free Software Foundation.
+ Situare is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
- Situare is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with Situare; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA.
- */
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+*/
#ifndef MAINWINDOW_H
#include <QtGui/QMainWindow>
#include <QWidget>
+#include <QDebug>
+#include "facebookservice/facebookauthentication.h"
+#include "situareservice/situareservice.h"
+#include <QNetworkAccessManager>
-class QMenu;
-class QAction;
-class QTabBar;
class QLabel;
class QStackedWidget;
/**
-* @Main Window Class
+* @brief Main Window Class
*
* @class MainWindow mainwindow.h "src/ui/mainwindow.h"
*/
Q_OBJECT
public:
+ /**
+ * @brief Constructor
+ *
+ * @param parent Parent
+ */
MainWindow(QWidget *parent = 0);
+
+ /**
+ * @brief Destructor
+ */
~MainWindow();
+public slots:
/**
- * @brief Private method to create List and Map views as a stacked widget
- *
- * @fn createViews
+ * @brief Public slot, which initiates toListViewAct action to switch view
*/
- void createViews();
+ void toListView();
- QAction *toMapViewAct;
/**
- * @brief Widget Stack object for the List and Map Views
- *
- * @var situareViews
+ * @brief Public slot, which initiates toMapViewAct action to switch view
*/
- QStackedWidget *situareViews;
+ void toMapView();
- QTabBar *situareTabs;
- QLabel *tabFieldLabel;
+private:
+ /**
+ * @brief Private method to create the Menu items w.show();
+ */
+ void createMenus();
+
+ /**
+ * @brief Private method to create List and Map views as a stacked widget
+ */
+ void createViews();
/**
- * @brief DUMMY LABEL, REMOVE WHEN BOTH VIEWS ARE COMPLETE
+ * @brief Method used to switch active view.
*
- * @var infoLabel
- * @todo REMOVE THIS
+ * @param nextIndex 0 for listview, 1 for mapview
+ */
+ void switchView(int);
+
+private:
+ FacebookAuthentication *m_facebookAuthenticator; ///< Instance for facebook authenticator
+ QNetworkAccessManager *m_networkManager; ///< NetworkManager that is passed on to SituareService
+ SituareService *m_situareService; ///< Instance of the situare server communication service
+ bool m_loggedIn; ///< Boolean value to indicate whether login has been successfull or not
+ QStackedWidget *m_situareViews; ///< Stacked widget that hold both view widgets
+ QAction *m_toListViewAct; ///< Action to trigger switch to list view
+ QAction *m_toMapViewAct; ///< Action to trigger switch to map view
+ QMenu *m_viewMenu; ///< Object that hold the view menu items
+
+private slots:
+ /**
+ * @brief Slot to change value of m_loggedIn to true
*/
- QLabel *infoLabel;
+ void loginOK();
-public slots:
- void updateTabLabel();
+ /**
+ * @brief Slot to check login status and exits if necessary
+ */
+ void loginScreenClosed();
};
#endif // MAINWINDOW_H