QXmpp Version:0.7.6

- Main Page
- Modules
- Classes
- Files

- File List

All Classes Functions Variables Enumerations Enumerator Properties Groups
QXmppOutgoingServer.h
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
24 #ifndef QXMPPOUTGOINGSERVER_H
25 #define QXMPPOUTGOINGSERVER_H
26
27 #include <QAbstractSocket>
28
29 #include "QXmppStream.h"
30
31 class QSslError;
32 class QXmppDialback;
33 class QXmppOutgoingServer;
34 class QXmppOutgoingServerPrivate;
35
39
40 class QXMPP_EXPORT QXmppOutgoingServer : public QXmppStream
41 {
42 Q_OBJECT
43
44 public:
45 QXmppOutgoingServer(const QString &domain, QObject *parent);
46 ~QXmppOutgoingServer();
47
48 bool isConnected() const;
49
50 QString localStreamKey() const;
51 void setLocalStreamKey(const QString &key);
52 void setVerify(const QString &id, const QString &key);
53
54 QString remoteDomain() const;
55
56 signals:
58 void dialbackResponseReceived(const QXmppDialback &response);
59
60 protected:
62 void handleStart();
63 void handleStream(const QDomElement &streamElement);
64 void handleStanza(const QDomElement &stanzaElement);
66
67 public slots:
68 void connectToHost(const QString &domain);
69 void queueData(const QByteArray &data);
70
71 private slots:
72 void _q_dnsLookupFinished();
73 void _q_socketDisconnected();
74 void sendDialback();
75 void slotSslErrors(const QList<QSslError> &errors);
76 void socketError(QAbstractSocket::SocketError error);
77
78 private:
79 Q_DISABLE_COPY(QXmppOutgoingServer)
80 QXmppOutgoingServerPrivate* const d;
81 };
82
83 #endif