Commit description:Changed list and map views to pointers for easy
[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
38 class QLabel;
39 class QStackedWidget;
40
41 /**
42 * @brief Main Window Class
43 *
44 * @class MainWindow mainwindow.h "src/ui/mainwindow.h"
45 */
46 class MainWindow : public QMainWindow
47 {
48     Q_OBJECT
49
50 public:
51     /**
52     * @brief Constructor
53     *
54     * @param parent Parent
55     */
56     MainWindow(QWidget *parent = 0);
57
58     /**
59     * @brief Destructor
60     */
61     ~MainWindow();
62
63 /*******************************************************************************
64  * MEMBER FUNCTIONS AND SLOTS
65  ******************************************************************************/
66 public slots:
67     /**
68     * @brief Public slot, which initiates toListViewAct action to switch view
69     */
70     void toListView();
71
72     /**
73     * @brief Public slot, which initiates toMapViewAct action to switch view
74     */
75     void toMapView();
76
77 private:
78     /**
79     * @brief Private method to create the Menu items
80     */
81     void createMenus();
82
83     /**
84     * @brief Private method to create List and Map views as a stacked widget
85     */
86     void createViews();
87
88     /**
89     * @brief Method used to switch active view.
90     *
91     * @paraDaily scrum 2010-03-26m nextIndex 0 for listview, 1 for mapview
92     */
93     void switchView(int);
94
95 private slots:
96
97 /*******************************************************************************
98  * DATA MEMBERS
99  ******************************************************************************/
100
101 private:
102     SituareEngine *m_situareEngine;
103
104     ListViewScreen *m_listViewScreen;
105     MapViewScreen *m_mapViewScreen;
106     QStackedWidget *m_situareViews; ///< Stacked widget that hold both view widgets
107     QAction *m_toListViewAct; ///< Action to trigger switch to list view
108     QAction *m_toMapViewAct; ///< Action to trigger switch to map view
109     QMenu *m_viewMenu; ///< Object that hold the view menu items
110 };
111
112 #endif // MAINWINDOW_H