Merge branch 'master' of https://vcs.maemo.org/git/situare
[situare] / src / ui / mainwindow.h
index 46f6997..331d149 100644 (file)
 /*
-    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
 #define MAINWINDOW_H
 
 #include <QtGui/QMainWindow>
 #include <QWidget>
+#include <QDebug>
+#include <QObject>
+#include "facebookservice/facebookauthentication.h"
+#include "situareservice/situareservice.h"
+#include <QNetworkAccessManager>
+#include "engine/engine.h"
+#include "listviewscreen.h"
+#include "mapviewscreen.h"
+#include "updatelocation/updatelocationdialog.h"
 
-class QMenu;
-class QAction;
-class QStackedWidget;
 class QLabel;
+class QStackedWidget;
 
+/**
+* @brief Main Window Class
+*
+* @class MainWindow mainwindow.h "src/ui/mainwindow.h"
+*/
 class MainWindow : public QMainWindow
 {
     Q_OBJECT
 
 public:
+    /**
+    * @brief Constructor
+    *
+    * @param parent Parent
+    */
     MainWindow(QWidget *parent = 0);
+
+    /**
+    * @brief Destructor
+    */
     ~MainWindow();
 
+/*******************************************************************************
+ * MEMBER FUNCTIONS AND SLOTS
+ ******************************************************************************/
+public slots:
+    /**
+    * @brief Public slot, which open settings dialog
+    */
+     void openSettingsDialog();
+
+    /**
+    * @brief Public slot, which initiates toListViewAct action to switch view
+    */
+    void toListView();
+
+    /**
+    * @brief Public slot, which initiates toMapViewAct action to switch view
+    */
+    void toMapView();
+
 private:
+    /**
+    * @brief Private method to create the Menu items
+    */
     void createMenus();
-    void createViews();
 
-    QMenu *viewMenu;
-    QAction *toListViewAct;
-    QAction *toMapViewAct;
-    QStackedWidget *situareViews;
+    /**
+    * @brief Private method to create List and Map views as a stacked widget
+    */
+    void createViews();
 
-    QLabel *infoLabel;
+    /**
+    * @brief Method used to switch active view.
+    *
+    * @paraDaily scrum 2010-03-26m nextIndex 0 for listview, 1 for mapview
+    */
+    void switchView(int);
 
 private slots:
-    void toListView();
-    void toMapView();
-};
+    void openLocationUpdateDialog();
+/*******************************************************************************
+ * DATA MEMBERS
+ ******************************************************************************/
 
-class SituareListView : public QWidget
-{
-public:
-    SituareListView(QWidget *parent = 0);
-};
+private:
+    SituareEngine *m_situareEngine;
 
-class SituareMapView : public QWidget
-{
-public:
-    SituareMapView(QWidget *parent = 0);
+    ListViewScreen *m_listViewScreen;
+    MapViewScreen *m_mapViewScreen;
+    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
+    QAction *m_toSettingsAct; ///< Action to trigger switch to settings dialog
+    QMenu *m_viewMenu; ///< Object that hold the view menu items
+
+    UpdateLocationDialog *m_locationDialog; ///< Message dialog
 };
 
 #endif // MAINWINDOW_H