QXmpp  Version:0.4.92
 All Classes Functions Enumerations Enumerator Properties Groups
QXmppTransferManager_p.h
1 /*
2  * Copyright (C) 2008-2011 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 
24 #ifndef QXMPPTRANSFERMANAGER_P_H
25 #define QXMPPTRANSFERMANAGER_P_H
26 
27 #include "QXmppByteStreamIq.h"
28 #include "QXmppTransferManager.h"
29 
30 //
31 // W A R N I N G
32 // -------------
33 //
34 // This file is not part of the QXmpp API. It exists for the convenience
35 // of the QXmppTransferManager class. This header file may change from
36 // version to version without notice, or even be removed.
37 //
38 // We mean it.
39 //
40 
41 class QTimer;
42 class QXmppSocksClient;
43 
44 class QXmppTransferIncomingJob : public QXmppTransferJob
45 {
46  Q_OBJECT
47 
48 public:
49  QXmppTransferIncomingJob(const QString &jid, QXmppClient *client, QObject *parent);
50  void checkData();
51  void connectToHosts(const QXmppByteStreamIq &iq);
52  bool writeData(const QByteArray &data);
53 
54 private slots:
55  void _q_candidateDisconnected();
56  void _q_candidateReady();
57  void _q_disconnected();
58  void _q_receiveData();
59 
60 private:
61  void connectToNextHost();
62 
63  QXmppByteStreamIq::StreamHost m_candidateHost;
64  QXmppSocksClient *m_candidateClient;
65  QTimer *m_candidateTimer;
66  QList<QXmppByteStreamIq::StreamHost> m_streamCandidates;
67  QString m_streamOfferId;
68  QString m_streamOfferFrom;
69 };
70 
71 class QXmppTransferOutgoingJob : public QXmppTransferJob
72 {
73  Q_OBJECT
74 
75 public:
76  QXmppTransferOutgoingJob(const QString &jid, QXmppClient *client, QObject *parent);
77  void connectToProxy();
78  void startSending();
79 
80 private slots:
81  void _q_disconnected();
82  void _q_proxyReady();
83  void _q_sendData();
84 };
85 
86 #endif