/* * Copyright 2008 Ben Boeckel * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #ifndef SIGNET_CONNECTIONHANDLER #define SIGNET_CONNECTIONHANDLER // Protocol includes #include "protocol/ChallengeMediator.h" // Signet includes #include "Global.h" // Qt includes #include #include // Forward declarations class QHostAddress; class QTcpSocket; namespace Signet { class Client; class SIGNET_EXPORT ConnectionHandler : public QObject { Q_OBJECT public: ConnectionHandler(QObject* parent); virtual QString type() const = 0; virtual QString name() const = 0; public slots: bool addClient(Client* socket); bool removeClient(Client* socket); signals: void dataReceived(const QByteArray& data); protected: virtual QByteArray secretForHost(const QByteArray& id) const; protected slots: void sendData(Client* client, const QByteArray& data); private: QList m_clients; }; } #endif