Prepared for merge
[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 "facebookservice/facebookauthentication.h"
31
32 class QLabel;
33 class QStackedWidget;
34
35 /**
36 * @Main Window Class
37 *
38 * @class MainWindow mainwindow.h "src/ui/mainwindow.h"
39 */
40 class MainWindow : public QMainWindow
41 {
42     Q_OBJECT
43
44 public:
45     MainWindow(QWidget *parent = 0);
46     ~MainWindow();
47
48 private:
49     /**
50     * @brief Flag to indicate whether successful login has been done
51     *
52     * @var loggedIn
53     */
54     bool loggedIn;
55
56     /**
57     * @brief Private method to create List and Map views as a stacked widget
58     *
59     * @fn createViews
60     */
61     void createViews();
62     /**
63     * @brief Widget Stack object for the List and Map Views
64     *
65     * @var situareViews
66     */
67     QStackedWidget *situareViews;
68
69     /**
70     * @brief Private method to create the Menu items
71     *
72     * @fn createMenus
73     */
74     void createMenus();
75     QMenu *viewMenu;
76
77     /**
78     * @brief Action item for changing view to List View
79     *
80     * @var toListViewAct
81     */
82     QAction *toListViewAct;
83     /**
84     * @brief Action item for changing view to Map View
85     *
86     * @var toMapViewAct
87     */
88     QAction *toMapViewAct;
89
90     /**
91     * @brief Method used to switch active view.
92     *
93     * @fn switchView
94     * @param int 0 for listview, 1 for mapview
95     */
96     void switchView(int);
97
98 public slots:
99     /**
100     * @brief Public slot, which initiates toListViewAct action to switch view
101     *
102     * @fn toListView
103     */
104     void toListView();
105     /**
106     * @brief Public slot, which initiates toMapViewAct action to switch view
107     *
108     * @fn toMapView
109     */
110     void toMapView();
111
112 private slots:
113     /**
114     * @brief Intercepts signal fom closing login window. Checks login status and exits if necessary
115     *
116     * @fn loginScreenClosed
117     */
118     void loginScreenClosed();
119
120     void loginOK();
121 };
122
123 #endif // MAINWINDOW_H