Merge commit '0.0.2'
[vncallhistory] / mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 /*
5 Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 2 of the License, or
10 (at your option) any later version.
11
12 This program 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 this program.  If not, see <http://www.gnu.org/licenses/>
19 */
20
21 #include <QtGui/QMainWindow>
22
23 #include "elv1db.h"
24
25 #include <QListWidget>
26
27 class QTableWidget;
28 class QTableWidgetItem;
29 class QListWidget;
30
31 class MainWindow : public QMainWindow
32 {
33     Q_OBJECT
34 public:
35     enum ScreenOrientation {
36         ScreenOrientationLockPortrait,
37         ScreenOrientationLockLandscape,
38         ScreenOrientationAuto
39     };
40
41     explicit MainWindow(QWidget *parent = 0);
42     virtual ~MainWindow();
43
44     // Note that this will only have an effect on Symbian and Fremantle.
45     void setOrientation(ScreenOrientation orientation);
46
47     void showExpanded();
48
49 private slots:
50     void dlgAbout();
51     void clearLog();
52     void dlgOptions();
53     void elv1db_finised();
54
55     void start_indicator();
56     void stop_indicator();
57
58     void elv1db_detail_finised();
59
60     void cellClicked(int, int);
61
62     void detail_start_indicator();
63
64     void select_gsm_calls();
65     void select_all_call();
66
67     void select_all_typecall();
68     void select_incoming_calls();
69     void select_outgoing_calls();
70     void select_missed_calls();
71
72     void dlgSearch();
73     void noSearch();
74
75 private:
76     QTableWidget *m_contacts_widget;
77     QListWidget *m_contact_detail;
78
79     QMainWindow *dlg_options;
80
81     void setup_menu();
82     void setup_menu_detail();
83
84     void doSearch(QString val);
85
86     elv1db *m_elv1db;
87     uint m_type_query_temp;
88     bool m_in_search;
89     QAction *m_no_search;
90
91     QMainWindow *detail_dlg;
92
93     void me_indicator(QMainWindow*, bool);
94 };
95
96 #endif // MAINWINDOW_H