//this file is part of NeoMule
//Copyright (C)2006 David Xanatos ( Xanatos@Lycos.at / http://neomule.sourceforge.net )
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either
//version 2 of the License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


#pragma once
#include "Sion\GUI\CP\TreeOptionsCtrl.h" // MOD - [TreeControl] <-- Loulach --

class CPPgNetwork : public CPropertyPage
{
	DECLARE_DYNAMIC(CPPgNetwork)

public:
	CPPgNetwork();
	virtual ~CPPgNetwork();

// Dialog Data
	enum { IDD = IDD_PPG_NETWORK };

protected:
	CTreeOptionsCtrl m_ctrlTreeOptions; // MOD - [TreeControl] <-- Loulach --
	bool m_bInitializedTreeOpts;

		// MOD: RIC - [ReaskOnIDChange]
		HTREEITEM m_htiOnIDChange;
			HTREEITEM m_htiCheckIPChange;
			HTREEITEM m_htiInformOnIPChange;
			HTREEITEM m_htiReAskOnIPChange;
			HTREEITEM m_htiQuickStartOnIPChange; // MOD: QS - [QuickStart]
			HTREEITEM m_htiCheckL2HIDChange;
			HTREEITEM m_htiReconnectKadOnIPChange;
			HTREEITEM m_htiRebindSocketsOnIPChange;
		// MOD: RIC END
		// MOD: QS - [QuickStart]
		HTREEITEM m_htiQuickStart;
			HTREEITEM m_htiQuickStartEnable;
			HTREEITEM m_htiQuickStartTime;
			HTREEITEM m_htiQuickStartTimePerFile;
			HTREEITEM m_htiQuickMaxConperFive;
			HTREEITEM m_htiQuickMaxHalfOpen;
			HTREEITEM m_htiQuickMaxConnections;
		// MOD: QS END
		// MOD: IFWS - [ICSFirewall]
		HTREEITEM m_htiICSFirewall;
			HTREEITEM m_htiICFSupport;
			HTREEITEM m_htiICFClearOnClose;
		// MOD: IFWS END
#ifdef UPNPNAT // MOD: UPNP - [UPnPNat]
		HTREEITEM m_htiUPnPNatSupport;
			HTREEITEM m_htiUPnPNat;
			HTREEITEM m_htiUPnPClearOnClose;

			HTREEITEM m_htiUPnPVerboseLog;
			HTREEITEM m_htiUPnPPort;
			HTREEITEM m_htiUPnPLimitToFirstConnection;
#endif // UPNPNAT // MOD: UPNP END

#ifdef ISPBYPASS // MOD: SCC - [SecureClinetConnection]
		HTREEITEM m_htiSupportISPBypass;
			HTREEITEM m_htiNeedISPBypass;
			HTREEITEM m_htiEncryptedPorts;
#endif // ISPBYPASS // MOD: SCC END

	// MOD: RIC - [ReaskOnIDChange]
	UINT	m_uCheckIPChange;
	bool	m_bInformOnIPChange;
	bool	m_bReAskOnIPChange;
	bool	m_bQuickStartOnIPChange; // MOD: QS - [QuickStart]
	bool	m_bCheckL2HIDChange;
	bool	m_bReconnectKadOnIPChange;
	bool	m_bRebindSocketsOnIPChange;
	// MOD: RIC END
	// MOD: QS - [QuickStart]
	bool	m_bQuickStart;
	int		m_iQuickStartTime;
	int		m_iQuickStartTimePerFile;
	int		m_iQuickMaxConperFive;
	int		m_iQuickMaxHalfOpen;
	int		m_iQuickMaxConnections;
	// MOD: QS END
	// MOD: IFWS - [ICSFirewall]
	UINT	m_uICFSupport;
	bool	m_bICFClearOnClose;
	// MOD: IFWS END
#ifdef UPNPNAT // MOD: UPNP - [UPnPNat]
	UINT	m_uUPnPNat;
	bool	m_bUPnPClearOnClose;

	bool	m_bUPnPVerboseLog;
	int		m_iUPnPPort;
	bool	m_bUPnPLimitToFirstConnection;
#endif // UPNPNAT // MOD: UPNP END

#ifdef ISPBYPASS // MOD: SCC - [SecureClinetConnection]
	UINT	m_uSupportISPBypass;
	CString m_strEncryptedPorts;
	UINT	m_uNeedISPBypass;
#endif // ISPBYPASS // MOD: SCC END

//----------------------------------------------------
	void ClearAllMembers();

	//void Localize();
	void LoadSettings();

	virtual BOOL OnInitDialog();
	virtual BOOL OnApply();
	virtual BOOL OnKillActive();
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);

	DECLARE_MESSAGE_MAP()
	afx_msg void OnDestroy();
	afx_msg LRESULT OnTreeOptsCtrlNotify(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT DrawTreeItemHelp(WPARAM wParam, LPARAM lParam);
	afx_msg void OnHelp();
	afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
	afx_msg void OnSettingsChange()			{ SetModified(); }
};
