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