1 #ifndef _OPTW_PROXY_H_
2 #define _OPTW_PROXY_H_
3 //=============================================================================
4 //
5 //   File : OptionsWidget_proxy.h
6 //   Creation date : Mon Jun 24 2000 21:58:25 by Szymon Stefanek
7 //
8 //   This file is part of the KVIrc IRC client distribution
9 //   Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 //   This program is FREE software. You can redistribute it and/or
12 //   modify it under the terms of the GNU General Public License
13 //   as published by the Free Software Foundation; either version 2
14 //   of the License, or (at your option) any later version.
15 //
16 //   This program is distributed in the HOPE that it will be USEFUL,
17 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
18 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 //   See the GNU General Public License for more details.
20 //
21 //   You should have received a copy of the GNU General Public License
22 //   along with this program. If not, write to the Free Software Foundation,
23 //   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #include "KviOptionsWidget.h"
28 #include "KviIconManager.h"
29 
30 #include <QTreeWidget>
31 #include <QCheckBox>
32 
33 class QLabel;
34 class QLineEdit;
35 class QComboBox;
36 class KviIpEditor;
37 class QMenu;
38 class KviProxy;
39 class KviProxyDataBase;
40 class KviBoolSelector;
41 
42 extern KVIRC_API KviProxyDataBase * g_pProxyDataBase;
43 
44 class ProxyOptionsTreeWidgetItem : public QTreeWidgetItem
45 {
46 public:
47 	ProxyOptionsTreeWidgetItem(QTreeWidget * parent, const QPixmap & pm, KviProxy * prx);
48 	~ProxyOptionsTreeWidgetItem();
49 
50 public:
51 	KviProxy * m_pProxyData;
52 };
53 
54 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_proxy KviIconManager::Proxy
55 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_proxy __tr2qs_no_lookup("Proxy Hosts")
56 #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_proxy OptionsWidget_connection
57 #define KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_proxy __tr2qs_no_lookup("connection,servers")
58 #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_proxy 70000
59 
60 class OptionsWidget_proxy : public KviOptionsWidget
61 {
62 	Q_OBJECT
63 public:
64 	OptionsWidget_proxy(QWidget * parent);
65 
66 protected:
67 	QTreeWidget * m_pTreeWidget;
68 	QLabel * m_pProxyLabel;
69 	QLineEdit * m_pProxyEdit;
70 	QLabel * m_pIpLabel;
71 	KviIpEditor * m_pIpEditor;
72 	QLabel * m_pUserLabel;
73 	QLineEdit * m_pUserEdit;
74 	QLabel * m_pPassLabel;
75 	QLineEdit * m_pPassEdit;
76 	QLabel * m_pPortLabel;
77 	QLineEdit * m_pPortEdit;
78 	QLabel * m_pProtocolLabel;
79 	QComboBox * m_pProtocolBox;
80 	QMenu * m_pContextPopup;
81 	QCheckBox * m_pIPv6Check;
82 	KviBoolSelector * m_pUseProxySelector;
83 	ProxyOptionsTreeWidgetItem * m_pLastEditedItem;
84 
85 private:
86 	void fillProxyList();
87 	void saveLastItem();
88 	void enableDisableUseProxySelector();
89 protected slots:
90 	void currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem * prev);
91 	void customContextMenuRequested(const QPoint & pnt);
92 	void newProxy();
93 	void removeCurrent();
94 	void ipV6CheckToggled(bool bEnabled);
95 
96 public:
97 	virtual void commit();
98 };
99 
100 #endif //!_OPTW_PROXY_H_
101