1/****************************************************************************
2**
3** Copyright (C) 2005-2010 Ralf Habacker. All rights reserved.
4**
5** This file is part of the KDE installer for windows
6**
7** This library is free software; you can redistribute it and/or
8** modify it under the terms of the GNU Library General Public
9** License version 2 as published by the Free Software Foundation.
10**
11** This library 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 GNU
14** Library General Public License for more details.
15**
16** You should have received a copy of the GNU Library General Public License
17** along with this library; see the file COPYING.LIB. If not, write to
18** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19** Boston, MA 02110-1301, USA.
20**
21****************************************************************************/
22
23#ifndef PROXYSETTINGS_H
24#define PROXYSETTINGS_H
25
26#include <QString>
27
28/**
29 holds system related proxy settings
30*/
31class ProxySettings
32{
33public:
34 typedef enum {None = 0, InternetExplorer, FireFox, Environment, Manual, AutoDetect} ProxyMode;
35 ProxySettings();
36
37 /// read in proxy settings depending on mode and url based
38 bool from(ProxyMode mode, const QString &url=QString());
39
40 /// save settings
41 bool save();
42
43 /// convert to cleartext output
44 QString toString();
45
46 QString hostname;
47 int port;
48 QString user;
49 QString password;
50 ProxyMode mode;
51
52protected:
53#ifdef Q_OS_WIN32
54 bool fromInternetExplorer(const QString &url);
55#endif
56 bool fromFireFox(const QString &url);
57 bool fromEnvironment(const QString &url);
58 bool fromAutoDetect(const QString &url);
59
60};
61
62#endif // PROXYSETTINGS_H
63