/***************************************************************************
- * Copyright (C) 2005-2018 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 *
#pragma once
+#include "common-export.h"
+
#include <QHostAddress>
#include "syncableobject.h"
* @warning Equality and assignment operators are optimized for use in a settings page
* and do not cover all attributes!
*/
-class DccConfig : public SyncableObject
+class COMMON_EXPORT DccConfig : public SyncableObject
{
Q_OBJECT
SYNCABLE_OBJECT
/**
* Mode for detecting the outgoing IP
*/
- enum class IpDetectionMode : quint8 {
+ enum class IpDetectionMode : quint8
+ {
Automatic, ///< Automatic detection (network socket or USERHOST)
Manual, ///< Manually specified IP
};
/**
* Mode for selecting the port range for DCC
*/
- enum class PortSelectionMode : quint8 {
- Automatic, ///< Automatic port selection
- Manual, ///< Manually specified port range
+ enum class PortSelectionMode : quint8
+ {
+ Automatic, ///< Automatic port selection
+ Manual, ///< Manually specified port range
};
Q_ENUMS(PortSelectionMode)
*
* @param[in] parent QObject parent
*/
- DccConfig(QObject *parent = nullptr);
+ DccConfig(QObject* parent = nullptr);
/**
* Assignment operator.
* @param[in] other Right-hand side instance
* @returns The updated instance
*/
- DccConfig &operator=(const DccConfig &other);
+ DccConfig& operator=(const DccConfig& other);
/**
* Equality operator.
* @param[in] other Right-hand side instance
* @returns Whether the two instances have equal properties
*/
- bool operator==(const DccConfig &other);
+ bool operator==(const DccConfig& other);
/// @name Getters
/// @{
/// @name Setters
/// @{
void setDccEnabled(bool enabled);
- void setOutgoingIp(const QHostAddress &outgoingIp);
+ void setOutgoingIp(const QHostAddress& outgoingIp);
void setIpDetectionMode(DccConfig::IpDetectionMode ipDetectionMode);
void setPortSelectionMode(DccConfig::PortSelectionMode portSelectionMode);
void setMinPort(quint16 port);
private:
// The given values are used as default for both initialization and settings
- bool _dccEnabled {false};
- QHostAddress _outgoingIp {QHostAddress::LocalHost};
- IpDetectionMode _ipDetectionMode {IpDetectionMode::Automatic};
- PortSelectionMode _portSelectionMode {PortSelectionMode::Automatic};
- quint16 _minPort {1024};
- quint16 _maxPort {32767};
- int _chunkSize {16};
- int _sendTimeout {180};
- bool _usePassiveDcc {false};
- bool _useFastSend {false};
+ bool _dccEnabled{false};
+ QHostAddress _outgoingIp{QHostAddress::LocalHost};
+ IpDetectionMode _ipDetectionMode{IpDetectionMode::Automatic};
+ PortSelectionMode _portSelectionMode{PortSelectionMode::Automatic};
+ quint16 _minPort{1024};
+ quint16 _maxPort{32767};
+ int _chunkSize{16};
+ int _sendTimeout{180};
+ bool _usePassiveDcc{false};
+ bool _useFastSend{false};
};