add more spacing
[personal-kdebase.git] / apps / konqueror / settings / kio / kmanualproxydlg.h
blobc6fb1cd2a781805d2095de3ee6a7be861e863dae
1 /*
2 kmanualproxydlg.h - Base dialog box for proxy configuration
4 Copyright (C) 2001-2004 Dawit Alemayehu <adawit@kde.org>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public
8 License (GPL) version 2 as published by the Free Software
9 Foundation.
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.
16 You should have received a copy of the GNU 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.
22 #ifndef KMANUALPROXYDLG_H
23 #define KMANUALPROXYDLG_H
25 #include "kproxydlgbase.h"
26 #include "ui_manualproxy.h"
27 class QSpinBox;
28 class KLineEdit;
30 class ManualProxyDlgUI : public QWidget, public Ui::ManualProxyDlgUI
32 public:
33 ManualProxyDlgUI( QWidget *parent ) : QWidget( parent ) {
34 setupUi( this );
39 class KManualProxyDlg : public KProxyDialogBase
41 Q_OBJECT
43 public:
44 explicit KManualProxyDlg( QWidget* parent = 0, const char* name = 0 );
45 ~KManualProxyDlg() {}
47 virtual void setProxyData( const KProxyData &data );
48 virtual const KProxyData data() const;
50 protected:
51 void init();
52 bool validate();
54 protected Q_SLOTS:
55 virtual void slotOk();
57 void copyDown();
58 void sameProxy( bool );
59 void valueChanged (int value);
60 void textChanged (const QString&);
62 void newPressed();
63 void updateButtons();
64 void changePressed();
65 void deletePressed();
66 void deleteAllPressed();
68 private:
69 QString urlFromInput( const KLineEdit* edit, const QSpinBox* spin ) const;
70 bool isValidURL( const QString&, KUrl* = 0 ) const;
71 bool handleDuplicate( const QString& );
72 bool getException ( QString&, const QString&,
73 const QString& value = QString() );
74 void showErrorMsg( const QString& caption = QString(),
75 const QString& message = QString() );
77 private:
78 ManualProxyDlgUI* mDlg;
80 int mOldFtpPort;
81 int mOldHttpsPort;
82 QString mOldFtpText;
83 QString mOldHttpsText;
86 #endif // KMANUALPROXYDLG_H