messagesender.h 872 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef MESSAGESENDER_H
  2. #define MESSAGESENDER_H
  3. #include <QObject>
  4. #include <QUrl>
  5. #include <QNetworkAccessManager>
  6. #include <QNetworkRequest>
  7. #include <QNetworkReply>
  8. #include <QTimer>
  9. #include <QList>
  10. #include <QTime>
  11. #include "Msg.h"
  12. #include "QReplyTimeout.h"
  13. class MessageSender : public QObject
  14. {
  15. Q_OBJECT
  16. public:
  17. explicit MessageSender(QObject *parent = 0, QString serverPath="", QString key="", QString id="");
  18. void appendMsg(Msg msg);
  19. signals:
  20. void sent(QString id);
  21. public slots:
  22. void time_out();
  23. void query_finishedSlot(QNetworkReply *reply);
  24. void beep_finishedSlot(QNetworkReply *reply);
  25. void reply_timeout();
  26. private:
  27. bool waitting;
  28. QString ServerPath,UKey,SID;
  29. QList<Msg> msgList;
  30. QTimer *timer;
  31. QNetworkAccessManager *queryManager, *beepManager;
  32. int hour,minutes;
  33. };
  34. #endif // MESSAGESENDER_H