first release
[groupsms] / sms / mainwindow.h
diff --git a/sms/mainwindow.h b/sms/mainwindow.h
new file mode 100644 (file)
index 0000000..cc6ca92
--- /dev/null
@@ -0,0 +1,74 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QMainWindow>
+#include <QToolButton>
+#include <QToolBox>
+#include <QHBoxLayout>
+
+#include "contactpage.h"
+#include "xmlcontroler.h"
+#include "contactwidgetitem.h"
+
+#ifdef ONLY_FOR_TELEPATHYQT4
+#include "sendsmssession.h"
+#endif
+
+namespace Ui {
+    class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    static MainWindow* getInstance();
+    ~MainWindow();
+
+public Q_SLOTS:
+    void send_to_clicked();
+    void cancel_clicked();
+    void send_message_clicked();
+    void send_message_enabled();
+    void sync_contacts();
+    void new_group();
+    void add_contact_to_group();
+    void removeSelectedContact();
+    void tab_changed(int index);
+
+    void onSMSSent( QString msg );
+
+    void onValidRecyele(bool valid);
+
+protected:    
+    void changeEvent(QEvent *e);
+    void init();
+
+private:
+    static MainWindow* instance;
+    MainWindow(QWidget *parent = 0);
+
+    void setSendToText(QVector<ContactWidgetItem*>* contacts);
+
+private:
+    Ui::MainWindow *ui;
+
+    QHBoxLayout *hbox_layout;
+
+    QToolButton *btn_new_group;
+    QToolButton *btn_add_contact_to_group;
+    QToolButton *btn_delete_contact;
+    QToolButton *btn_delete_group;
+    QToolButton *btn_sync_contacts;
+
+    ContactPage *contactPage;
+
+#ifdef ONLY_FOR_TELEPATHYQT4
+    SendSMSSession *sendSMS;
+#endif
+
+    QStringList name_list;
+};
+
+#endif // MAINWINDOW_H