qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
icoresettings.h
Go to the documentation of this file.
1 /*
2  Copyright © 2019 by The qTox Project Contributors
3 
4  This file is part of qTox, a Qt-based graphical interface for Tox.
5 
6  qTox is libre software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  qTox is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with qTox. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include "util/interface.h"
23 
24 #include <QList>
25 #include <QNetworkProxy>
26 #include <QString>
27 
29 public:
30  enum class ProxyType
31  {
32  // If changed, don't forget to update Settings::fixInvalidProxyType
33  ptNone = 0,
34  ptSOCKS5 = 1,
35  ptHTTP = 2
36  };
37  ICoreSettings() = default;
38  virtual ~ICoreSettings();
39  ICoreSettings(const ICoreSettings&) = default;
40  ICoreSettings& operator=(const ICoreSettings&) = default;
41  ICoreSettings(ICoreSettings&&) = default;
43 
44  virtual bool getEnableIPv6() const = 0;
45  virtual void setEnableIPv6(bool enable) = 0;
46 
47  virtual bool getForceTCP() const = 0;
48  virtual void setForceTCP(bool enable) = 0;
49 
50  virtual bool getEnableLanDiscovery() const = 0;
51  virtual void setEnableLanDiscovery(bool enable) = 0;
52 
53  virtual QString getProxyAddr() const = 0;
54  virtual void setProxyAddr(const QString& address) = 0;
55 
56  virtual ProxyType getProxyType() const = 0;
57  virtual void setProxyType(ProxyType type) = 0;
58 
59  virtual quint16 getProxyPort() const = 0;
60  virtual void setProxyPort(quint16 port) = 0;
61 
62  virtual QNetworkProxy getProxy() const = 0;
63 
64  DECLARE_SIGNAL(enableIPv6Changed, bool enabled);
65  DECLARE_SIGNAL(forceTCPChanged, bool enabled);
66  DECLARE_SIGNAL(enableLanDiscoveryChanged, bool enabled);
67  DECLARE_SIGNAL(proxyTypeChanged, ICoreSettings::ProxyType type);
68  DECLARE_SIGNAL(proxyAddressChanged, const QString& address);
69  DECLARE_SIGNAL(proxyPortChanged, quint16 port);
70 };
ICoreSettings::getEnableLanDiscovery
virtual bool getEnableLanDiscovery() const =0
ICoreSettings::ProxyType
ProxyType
Definition: icoresettings.h:30
ICoreSettings::setEnableLanDiscovery
virtual void setEnableLanDiscovery(bool enable)=0
ICoreSettings::operator=
ICoreSettings & operator=(const ICoreSettings &)=default
ICoreSettings::getEnableIPv6
virtual bool getEnableIPv6() const =0
ICoreSettings::DECLARE_SIGNAL
DECLARE_SIGNAL(enableIPv6Changed, bool enabled)
ICoreSettings::ICoreSettings
ICoreSettings()=default
ICoreSettings::getForceTCP
virtual bool getForceTCP() const =0
ICoreSettings::getProxyType
virtual ProxyType getProxyType() const =0
ICoreSettings::setProxyType
virtual void setProxyType(ProxyType type)=0
ICoreSettings::getProxy
virtual QNetworkProxy getProxy() const =0
ICoreSettings::setProxyAddr
virtual void setProxyAddr(const QString &address)=0
ICoreSettings::getProxyAddr
virtual QString getProxyAddr() const =0
ICoreSettings::ProxyType::ptHTTP
@ ptHTTP
ICoreSettings::ProxyType::ptNone
@ ptNone
ICoreSettings::~ICoreSettings
virtual ~ICoreSettings()
ICoreSettings::ProxyType::ptSOCKS5
@ ptSOCKS5
ICoreSettings::setEnableIPv6
virtual void setEnableIPv6(bool enable)=0
ICoreSettings
Definition: icoresettings.h:28
ICoreSettings::setForceTCP
virtual void setForceTCP(bool enable)=0
ICoreSettings::setProxyPort
virtual void setProxyPort(quint16 port)=0
ICoreSettings::getProxyPort
virtual quint16 getProxyPort() const =0