first release
[groupsms] / sms / sendsmssession.h
1 #ifndef SENDSMSSESSION_H
2 #define SENDSMSSESSION_H
3
4 #include <QObject>
5 #include <QDebug>
6 #include "tpsession/tpsession.h"
7 #include "tpsession/tpsessionaccount.h"
8
9 class SendSMSSession : public QObject
10 {
11     Q_OBJECT
12 public:
13     SendSMSSession( bool sync = false, QObject *parent = 0);
14
15     void setSMSToSend( QString addr,QString msg );
16     void setSMSToSend( QStringList addrs,QStringList msgs );
17
18 private:
19     void initTpSession();
20     void SendSMS();
21
22 private:
23     TpSession *tps;
24
25     QString sender;
26     QStringList addresses;
27     QStringList messages;
28
29     bool syncSend;
30     bool isReady;
31
32 Q_SIGNALS:
33     void smsSent( QString msg, QString addr );
34     void smsSent( QString msg );
35
36 public Q_SLOTS:
37     void onAccountReady(TpSessionAccount *);
38     void onSMSSent(const Tp::Message &,TpSessionAccount *);
39     void onMessageReceived(const Tp::ReceivedMessage &,TpSessionAccount *);
40
41 };
42
43 #endif // SENDSMSSESSION_H