File indexing completed on 2024-05-05 16:13:56
0001 /* 0002 kproxydlg.h - Proxy configuration dialog 0003 SPDX-FileCopyrightText: 2001, 2011 Dawit Alemayehu <adawit@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-only 0006 */ 0007 0008 #ifndef KPROXYDLG_H 0009 #define KPROXYDLG_H 0010 0011 #include "ui_kproxydlg.h" 0012 #include <KCModule> 0013 0014 class KProxyDialog : public KCModule 0015 { 0016 Q_OBJECT 0017 0018 public: 0019 enum DisplayUrlFlag { 0020 HideNone = 0x00, 0021 HideHttpUrlScheme = 0x01, 0022 HideHttpsUrlScheme = 0x02, 0023 HideFtpUrlScheme = 0x04, 0024 HideSocksUrlScheme = 0x08, 0025 }; 0026 Q_DECLARE_FLAGS(DisplayUrlFlags, DisplayUrlFlag) 0027 0028 KProxyDialog(QWidget *parent, const QVariantList &args); 0029 ~KProxyDialog() override; 0030 0031 void load() override; 0032 void save() override; 0033 void defaults() override; 0034 QString quickHelp() const override; 0035 0036 private Q_SLOTS: 0037 void autoDetect(); 0038 void showEnvValue(bool); 0039 void setUseSameProxy(bool); 0040 void syncProxies(const QString &); 0041 void syncProxyPorts(int); 0042 0043 void slotChanged(); 0044 0045 private: 0046 bool autoDetectSystemProxy(QLineEdit *edit, const QString &envVarStr, bool showValue); 0047 0048 Ui::ProxyDialogUI mUi; 0049 QStringList mNoProxyForList; 0050 QMap<QString, QString> mProxyMap; 0051 }; 0052 0053 Q_DECLARE_OPERATORS_FOR_FLAGS(KProxyDialog::DisplayUrlFlags) 0054 0055 #endif // KPROXYDLG_H