DtkNetworkManager
NetworkManager DBus interface binding for Qt
dsystemproxy.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DSYSTEMPROXY_H
6#define DSYSTEMPROXY_H
7
9#include <QUrl>
10#include <DExpected>
11
12DNETWORKMANAGER_BEGIN_NAMESPACE
13
14using DCORE_NAMESPACE::DExpected;
15
16class DSystemProxyPrivate;
17
18class DSystemProxy : public QObject
19{
20 Q_OBJECT
21public:
22 explicit DSystemProxy(QObject *parent = nullptr);
23 ~DSystemProxy() override;
24
25public Q_SLOTS:
26 DExpected<QString> autoProxy() const;
27 DExpected<SystemProxyAddr> proxy(const ProxyType method) const;
28 DExpected<QString> proxyIgnoreHosts() const;
29 DExpected<SystemProxyMethod> proxyMethod() const;
30 DExpected<void> setAutoProxy(const QUrl &pac) const;
31 DExpected<void> setProxy(const ProxyType type, const SystemProxyAddr &addr) const;
32 DExpected<void> setProxyIgnoreHosts(const QString &hosts) const;
33 DExpected<void> setProxyMethod(const SystemProxyMethod method) const;
34
35private:
36 QScopedPointer<DSystemProxyPrivate> d_ptr;
37 Q_DECLARE_PRIVATE(DSystemProxy)
38};
39
40DNETWORKMANAGER_END_NAMESPACE
41
42#endif
连接配置管理的方法的封装
Definition: dsystemproxy.h:19
DExpected< void > setAutoProxy(const QUrl &pac) const
设置自动代理地址
DExpected< void > setProxy(const ProxyType type, const SystemProxyAddr &addr) const
设置代理属性
DExpected< QString > proxyIgnoreHosts() const
获取代理中的忽略列表
DExpected< QString > autoProxy() const
获取自动代理的地址
DExpected< void > setProxyIgnoreHosts(const QString &hosts) const
设置代理忽略列表
DExpected< SystemProxyAddr > proxy(const ProxyType method) const
获取对应代理类型的地址
DExpected< void > setProxyMethod(const SystemProxyMethod method) const
设置代理方法
DExpected< SystemProxyMethod > proxyMethod() const
获取代理方法
SystemProxyMethod
Definition: dnetworkmanagertypes.h:88
ProxyType
代理类型
Definition: dnetworkmanagertypes.h:86
系统代理的地址
Definition: dnetworkmanagertypes.h:270