first release
[groupsms] / sms / sendsmssession.h
diff --git a/sms/sendsmssession.h b/sms/sendsmssession.h
new file mode 100644 (file)
index 0000000..0074160
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef SENDSMSSESSION_H
+#define SENDSMSSESSION_H
+
+#include <QObject>
+#include <QDebug>
+#include "tpsession/tpsession.h"
+#include "tpsession/tpsessionaccount.h"
+
+class SendSMSSession : public QObject
+{
+    Q_OBJECT
+public:
+    SendSMSSession( bool sync = false, QObject *parent = 0);
+
+    void setSMSToSend( QString addr,QString msg );
+    void setSMSToSend( QStringList addrs,QStringList msgs );
+
+private:
+    void initTpSession();
+    void SendSMS();
+
+private:
+    TpSession *tps;
+
+    QString sender;
+    QStringList addresses;
+    QStringList messages;
+
+    bool syncSend;
+    bool isReady;
+
+Q_SIGNALS:
+    void smsSent( QString msg, QString addr );
+    void smsSent( QString msg );
+
+public Q_SLOTS:
+    void onAccountReady(TpSessionAccount *);
+    void onSMSSent(const Tp::Message &,TpSessionAccount *);
+    void onMessageReceived(const Tp::ReceivedMessage &,TpSessionAccount *);
+
+};
+
+#endif // SENDSMSSESSION_H