first release
[groupsms] / sms / mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <QMainWindow>
5 #include <QToolButton>
6 #include <QToolBox>
7 #include <QHBoxLayout>
8
9 #include "contactpage.h"
10 #include "xmlcontroler.h"
11 #include "contactwidgetitem.h"
12
13 #ifdef ONLY_FOR_TELEPATHYQT4
14 #include "sendsmssession.h"
15 #endif
16
17 namespace Ui {
18     class MainWindow;
19 }
20
21 class MainWindow : public QMainWindow
22 {
23     Q_OBJECT
24
25 public:
26     static MainWindow* getInstance();
27     ~MainWindow();
28
29 public Q_SLOTS:
30     void send_to_clicked();
31     void cancel_clicked();
32     void send_message_clicked();
33     void send_message_enabled();
34     void sync_contacts();
35     void new_group();
36     void add_contact_to_group();
37     void removeSelectedContact();
38     void tab_changed(int index);
39
40     void onSMSSent( QString msg );
41
42     void onValidRecyele(bool valid);
43
44 protected:    
45     void changeEvent(QEvent *e);
46     void init();
47
48 private:
49     static MainWindow* instance;
50     MainWindow(QWidget *parent = 0);
51
52     void setSendToText(QVector<ContactWidgetItem*>* contacts);
53
54 private:
55     Ui::MainWindow *ui;
56
57     QHBoxLayout *hbox_layout;
58
59     QToolButton *btn_new_group;
60     QToolButton *btn_add_contact_to_group;
61     QToolButton *btn_delete_contact;
62     QToolButton *btn_delete_group;
63     QToolButton *btn_sync_contacts;
64
65     ContactPage *contactPage;
66
67 #ifdef ONLY_FOR_TELEPATHYQT4
68     SendSMSSession *sendSMS;
69 #endif
70
71     QStringList name_list;
72 };
73
74 #endif // MAINWINDOW_H