Commit description: Rewrote the architecture, engine loads first now
[situare] / src / ui / mainwindow.h
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5       Henri Lampela - henri.lampela@ixonos.com
6       Kaj Wallin - kaj.wallin@ixonos.com
7
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.
11
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.
16
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,
20    USA.
21 */
22
23
24 #ifndef MAINWINDOW_H
25 #define MAINWINDOW_H
26
27 #include <QtGui/QMainWindow>
28 #include <QWidget>
29 #include <QDebug>
30 #include <QObject>
31 #include "facebookservice/facebookauthentication.h"
32 #include "situareservice/situareservice.h"
33 #include <QNetworkAccessManager>
34 //#include "engine/engine.h"
35 #include "listviewscreen.h"
36 #include "mapviewscreen.h"
37 #include "updatelocation/updatelocationdialog.h"
38 #include "ui/mainwindow.h"
39
40 class QLabel;
41 class QStackedWidget;
42
43 /**
44 * @brief Main Window Class
45 *
46 * @class MainWindow mainwindow.h "src/ui/mainwindow.h"
47 */
48 class MainWindow : public QMainWindow
49 {
50     Q_OBJECT
51
52 public:
53     /**
54     * @brief Constructor
55     *
56     * @param parent Parent
57     */
58     MainWindow(QWidget *parent = 0);
59
60     /**
61     * @brief Destructor
62     */
63     ~MainWindow();
64
65 /*******************************************************************************
66  * MEMBER FUNCTIONS AND SLOTS
67  ******************************************************************************/
68 public slots:
69     /**
70     * @brief Public slot, which initiates toListViewAct action to switch view
71     */
72     void toListView();
73
74     /**
75     * @brief Public slot, which initiates toMapViewAct action to switch view
76     */
77     void toMapView();
78
79 private:
80     /**
81     * @brief Private method to create the Menu items
82     */
83     void createMenus();
84
85     /**
86     * @brief Private method to create List and Map views as a stacked widget
87     */
88     void createViews();
89
90     /**
91     * @brief Method used to switch active view.
92     *
93     * @paraDaily scrum 2010-03-26m nextIndex 0 for listview, 1 for mapview
94     */
95     void switchView(int);
96
97 private slots:
98     void openLocationUpdateDialog();
99 /*******************************************************************************
100  * DATA MEMBERS
101  ******************************************************************************/
102
103 private:
104 //    SituareEngine *m_situareEngine;
105
106     ListViewScreen *m_listViewScreen;
107     MapViewScreen *m_mapViewScreen;
108     QStackedWidget *m_situareViews; ///< Stacked widget that hold both view widgets
109     QAction *m_toListViewAct; ///< Action to trigger switch to list view
110     QAction *m_toMapViewAct; ///< Action to trigger switch to map view
111     QMenu *m_viewMenu; ///< Object that hold the view menu items
112
113     UpdateLocationDialog *m_locationDialog; ///< Message dialog
114 };
115
116 #endif // MAINWINDOW_H