Merged map to master
[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     /**
48     * @brief Public method to get current index of the view. Used for Unit testing
49     *
50     * @fn getViewIndex
51     */
52     int getViewIndex();
53
54 private:
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     * @brief Method used to switch active view.
91     *
92     * @fn switchView
93     * @param int 0 for listview, 1 for mapview
94     */
95     void switchView(int);
96
97 public slots:
98     /**
99     * @brief Public slot, which initiates toListViewAct action to switch view
100     *
101     * @fn toListView
102     */
103     void toListView();
104     /**
105     * @brief Public slot, which initiates toMapViewAct action to switch view
106     *
107     * @fn toMapView
108     */
109     void toMapView();
110 };
111
112 #endif // MAINWINDOW_H