QXmppTransferManager_p.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (C) 2008-2012 The QXmpp developers
  3. *
  4. * Author:
  5. * Jeremy Lainé
  6. *
  7. * Source:
  8. * http://code.google.com/p/qxmpp
  9. *
  10. * This file is a part of QXmpp library.
  11. *
  12. * This library is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU Lesser General Public
  14. * License as published by the Free Software Foundation; either
  15. * version 2.1 of the License, or (at your option) any later version.
  16. *
  17. * This library is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. * Lesser General Public License for more details.
  21. *
  22. */
  23. #ifndef QXMPPTRANSFERMANAGER_P_H
  24. #define QXMPPTRANSFERMANAGER_P_H
  25. #include "QXmppByteStreamIq.h"
  26. #include "QXmppTransferManager.h"
  27. //
  28. // W A R N I N G
  29. // -------------
  30. //
  31. // This file is not part of the QXmpp API. It exists for the convenience
  32. // of the QXmppTransferManager class. This header file may change from
  33. // version to version without notice, or even be removed.
  34. //
  35. // We mean it.
  36. //
  37. class QTimer;
  38. class QXmppSocksClient;
  39. class QXmppTransferIncomingJob : public QXmppTransferJob
  40. {
  41. Q_OBJECT
  42. public:
  43. QXmppTransferIncomingJob(const QString &jid, QXmppClient *client, QObject *parent);
  44. void checkData();
  45. void connectToHosts(const QXmppByteStreamIq &iq);
  46. bool writeData(const QByteArray &data);
  47. private slots:
  48. void _q_candidateDisconnected();
  49. void _q_candidateReady();
  50. void _q_disconnected();
  51. void _q_receiveData();
  52. private:
  53. void connectToNextHost();
  54. QXmppByteStreamIq::StreamHost m_candidateHost;
  55. QXmppSocksClient *m_candidateClient;
  56. QTimer *m_candidateTimer;
  57. QList<QXmppByteStreamIq::StreamHost> m_streamCandidates;
  58. QString m_streamOfferId;
  59. QString m_streamOfferFrom;
  60. };
  61. class QXmppTransferOutgoingJob : public QXmppTransferJob
  62. {
  63. Q_OBJECT
  64. public:
  65. QXmppTransferOutgoingJob(const QString &jid, QXmppClient *client, QObject *parent);
  66. void connectToProxy();
  67. void startSending();
  68. private slots:
  69. void _q_disconnected();
  70. void _q_proxyReady();
  71. void _q_sendData();
  72. };
  73. #endif