QXmpp  Version:0.4.91
 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 QXmppSocksClient;
42 
43 class QXmppTransferIncomingJob : public QXmppTransferJob
44 {
45  Q_OBJECT
46 
47 public:
48  QXmppTransferIncomingJob(const QString &jid, QXmppClient *client, QObject *parent);
49  void checkData();
50  void connectToHosts(const QXmppByteStreamIq &iq);
51  bool writeData(const QByteArray &data);
52 
53 private slots:
54  void _q_candidateDisconnected();
55  void _q_candidateReady();
56  void _q_disconnected();
57  void _q_receiveData();
58 
59 private:
60  void connectToNextHost();
61 
62  QXmppByteStreamIq::StreamHost m_candidateHost;
63  QXmppSocksClient *m_candidateClient;
64  QList<QXmppByteStreamIq::StreamHost> m_streamCandidates;
65  QString m_streamOfferId;
66  QString m_streamOfferFrom;
67 };
68 
69 class QXmppTransferOutgoingJob : public QXmppTransferJob
70 {
71  Q_OBJECT
72 
73 public:
74  QXmppTransferOutgoingJob(const QString &jid, QXmppClient *client, QObject *parent);
75  void connectToProxy();
76  void startSending();
77 
78 private slots:
79  void _q_disconnected();
80  void _q_proxyReady();
81  void _q_sendData();
82 };
83 
84 #endif