//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 "Neo\GUI\CP\TreeOptionsCtrl.h" // NEO - [TreeControl] <-- Xanatos --

struct tNeoButton
{
	HTREEITEM m_htiButton;
	HTREEITEM m_htiGroups[4];
};

class CPPgInterface : public CPropertyPage
{
	DECLARE_DYNAMIC(CPPgInterface)

public:
	CPPgInterface();
	virtual ~CPPgInterface();

// Dialog Data
	enum { IDD = IDD_PPG_MOD };

protected:
	CTreeOptionsCtrl m_ctrlTreeOptions; // NEO - [TreeControl] <-- Xanatos --
	bool m_bInitializedTreeOpts;
	// NEO: NXC - [NewExtendedCategories]
	HTREEITEM m_htiMorphCats;
		HTREEITEM m_htiShowCatNames;
		HTREEITEM m_htiShowCategoryFlags;
		HTREEITEM m_htiActiveCatDefault;
		HTREEITEM m_htiSelCatOnAdd;
		HTREEITEM m_htiAutoSetResumeOrder;
		HTREEITEM m_htiSmallFileDLPush;
		HTREEITEM m_htiStartDLInEmptyCats;
		HTREEITEM m_htiUseAutoCat;
		HTREEITEM m_htiCheckAlreadyDownloaded;
		HTREEITEM m_htiStartNextFileByPriority;
	// NEO: NXC END
	// NEO: NTB - [NeoToolbarButtons]
	HTREEITEM m_htiNeoToolbar;
		tNeoButton *m_htiNeoToolbarButtons; // !!
		int			m_cntNeoToolbarButtons; // we must cache this value
	// NEO: NTB END
	HTREEITEM m_htiShowBanner; // NEO: NPB - [PrefsBanner]
	HTREEITEM m_htiCollorShareFiles; // NEO: NSC - [NeoSharedCategories]
	HTREEITEM m_htiSmoothStatisticsGraphs; // NEO: NBC - [NeoBandwidthControl] 
	HTREEITEM m_htiDisableAutoSort; // NEO: SE - [SortExtension]


	// NEO: NXC - [NewExtendedCategories]
	bool	m_bShowCatNames;
	UINT	m_uShowCategoryFlags;
	bool	m_bActiveCatDefault;
	bool	m_bSelCatOnAdd;
	bool	m_bAutoSetResumeOrder;
	bool	m_bSmallFileDLPush;
	int		m_iSmallFileDLPush;
	bool	m_bStartDLInEmptyCats;
	int		m_iStartDLInEmptyCats;
	bool	m_bUseAutoCat;
	bool	m_bCheckAlreadyDownloaded;
	bool	m_bStartNextFileByPriority;
	// NEO: NXC END
	// NEO: NTB - [NeoToolbarButtons]
	UINT	m_uNeoToolbar;
	int		m_iNeoToolbarButtonCount;
	CArray<UINT> m_NeoToolbarButtons;
	// NEO: NTB END
	bool	m_bShowBanner; // NEO: NPB - [PrefsBanner]
	bool	m_bCollorShareFiles; // NEO: NSC - [NeoSharedCategories]
	bool	m_bSmoothStatisticsGraphs; // NEO: NBC - [NeoBandwidthControl] 
	UINT	m_uDisableAutoSort; // NEO: SE - [SortExtension]

	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);

	// NEO: NTB - [NeoToolbarButtons]
	void ClearNeoToolbarMembers(bool bTree = false);
	void CreateNeoToolbarMembers(int *iImgNeoBtn);
	// NEO: NTB END

};
