/***************************************************************************
- * Copyright (C) 2005-2014 by the Quassel Project *
+ * Copyright (C) 2005-2019 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef PEERFACTORY_H
-#define PEERFACTORY_H
+#pragma once
+
+#include "common-export.h"
#include <QPair>
+#include "compressor.h"
#include "protocol.h"
class QObject;
class AuthHandler;
class RemotePeer;
-class PeerFactory
+class COMMON_EXPORT PeerFactory
{
-
public:
// second value is the protocol-specific features
- typedef QPair<Protocol::Type, quint16> ProtoDescriptor;
-
- static RemotePeer *createPeer(const ProtoDescriptor &protocol, AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0);
- static RemotePeer *createPeer(const QVector<ProtoDescriptor> &protocols, AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0);
+ using ProtoDescriptor = QPair<Protocol::Type, quint16>;
+ using ProtoList = QVector<ProtoDescriptor>;
+
+ static ProtoList supportedProtocols();
+
+ static RemotePeer* createPeer(const ProtoDescriptor& protocol,
+ AuthHandler* authHandler,
+ QTcpSocket* socket,
+ Compressor::CompressionLevel level,
+ QObject* parent = nullptr);
+ static RemotePeer* createPeer(const ProtoList& protocols,
+ AuthHandler* authHandler,
+ QTcpSocket* socket,
+ Compressor::CompressionLevel level,
+ QObject* parent = nullptr);
};
-
-#endif