File indexing completed on 2024-04-14 04:01:45

0001 
0002 /***************************************************************************
0003                    jabberconnector.cpp  -  Socket Connector for Jabber
0004                              -------------------
0005     begin                : Wed Jul 7 2004
0006     copyright            : (C) 2004 by Till Gerken <till@tantalo.net>
0007 
0008                Kopete (C) 2004 Kopete developers <kopete-devel@kde.org>
0009  ***************************************************************************/
0010 
0011 /***************************************************************************
0012  *                                                                         *
0013  *   This program is free software; you can redistribute it and/or modify  *
0014  *   it under the terms of the GNU Lesser General Public License as        *
0015  *   published by the Free Software Foundation; either either version 2
0016    of the License, or (at your option) any later version.1 of the  *
0017  *   License, or (at your option) any later version.                       *
0018  *                                                                         *
0019  ***************************************************************************/
0020 
0021 #ifndef JABBERCONNECTOR_H
0022 #define JABBERCONNECTOR_H
0023 
0024 #include <xmpp.h>
0025 #include "jabberbytestream.h"
0026 
0027 class ByteStream;
0028 
0029 /**
0030 @author Till Gerken
0031 */
0032 class JabberConnector : public XMPP::Connector
0033 {
0034 
0035 Q_OBJECT
0036 
0037 public:
0038     JabberConnector ( QObject *parent = nullptr );
0039 
0040     ~JabberConnector () override;
0041 
0042     void connectToServer ( const QString &server ) override;
0043     ByteStream *stream () const override;
0044     void done () override;
0045 
0046     void setOptHostPort ( const QString &host, quint16 port );
0047     void setOptSSL ( bool );
0048     void setOptProbe ( bool );
0049 
0050     int errorCode ();
0051 
0052 private slots:
0053     void slotConnected ();
0054     void slotError ( int );
0055 
0056 private:
0057     QString mHost;
0058     quint16 mPort;
0059     int mErrorCode;
0060 
0061     JabberByteStream *mByteStream;
0062 
0063 };
0064 
0065 #endif