2 qcatlshandler.cpp - Kopete Groupwise Protocol
4 Copyright (c) 2006 Novell, Inc http://www.opensuse.org
5 Copyright (c) 2004 SUSE Linux AG http://www.suse.com
7 Based on Iris, Copyright (C) 2003 Justin Karneges <justin@affinix.com>
9 Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
11 *************************************************************************
13 * This library is free software; you can redistribute it and/or *
14 * modify it under the terms of the GNU Lesser General Public *
15 * License as published by the Free Software Foundation; either *
16 * version 2 of the License, or (at your option) any later version. *
18 *************************************************************************
25 #include "qcatlshandler.h"
27 class QCATLSHandler::Private
34 QCATLSHandler::QCATLSHandler(QCA::TLS
*parent
)
35 :TLSHandler(parent
), d(new Private())
38 connect(d
->tls
, SIGNAL(handshaken()), SLOT(tls_handshaken()));
39 connect(d
->tls
, SIGNAL(readyRead()), SLOT(tls_readyRead()));
40 connect(d
->tls
, SIGNAL(readyReadOutgoing()), SLOT(tls_readyReadOutgoing()));
41 connect(d
->tls
, SIGNAL(closed()), SLOT(tls_closed()));
42 connect(d
->tls
, SIGNAL(error()), SLOT(tls_error()));
47 QCATLSHandler::~QCATLSHandler()
52 QCA::TLS
*QCATLSHandler::tls() const
57 int QCATLSHandler::tlsError() const
62 void QCATLSHandler::reset()
68 void QCATLSHandler::startClient(const QString
&host
)
72 d
->tls
->startClient(host
);
75 void QCATLSHandler::write(const QByteArray
&a
)
80 void QCATLSHandler::writeIncoming(const QByteArray
&a
)
82 d
->tls
->writeIncoming(a
);
85 void QCATLSHandler::continueAfterHandshake()
88 d
->tls
->continueAfterStep();
94 void QCATLSHandler::tls_handshaken()
100 void QCATLSHandler::tls_readyRead()
102 readyRead(d
->tls
->read());
105 void QCATLSHandler::tls_readyReadOutgoing()
108 QByteArray buf
= d
->tls
->readOutgoing(&plainBytes
);
109 readyReadOutgoing(buf
, plainBytes
);
112 void QCATLSHandler::tls_closed()
117 void QCATLSHandler::tls_error()
119 d
->err
= d
->tls
->errorCode();
124 #include "qcatlshandler.moc"