// GenerationReportDlg.h : header file
//
#if !defined(_GENERATIONREPORTDLG_H_)
#define _GENERATIONREPORTDLG_H_

//#include <string>
#include <vector>
#include "IGeneratorListener.h"
#include "cmString.h"

using namespace std;

/////////////////////////////////////////////////////////////////////////////
// CGenerationReportDlg dialog

class CXmlProject;
class CGenerationPrefDlg;

class CGenerationReportDlg : public CDialog,
							 public IGeneratorListener
{
// Construction
public:
	CGenerationReportDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~CGenerationReportDlg();

	void Init(CXmlProject* project, const cmString& currentDir);

	// implementation of IGeneratorListener
	//
	virtual void OnNewTask(const cmString& label);
	virtual void OnTaskUpdate(const cmString& label);
	virtual void OnTaskComplete(const cmString& label);
	virtual void OnTaskFailed(const cmString& label);
	virtual void OnTaskDisabled(const cmString& label);
	
	void OnPrefChildChanged();

// Dialog Data
	//{{AFX_DATA(CGenerationReportDlg)
	enum { IDD = IDD_GENERATION_REPORT };
	CButton	cmdClose_;
	CStatic	lblMsg_;
	CButton	cmdGenerate_;
	CListCtrl	lvwReport_;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGenerationReportDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CGenerationReportDlg)
	virtual BOOL OnInitDialog();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnCmdGenerate();
	afx_msg void OnPaint();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnClose();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP();

	void GenerateAll();

	void AppendItem(const cmString& label, int indent, int image);
	void UpdateItem(const cmString& label, int indent, int image);
	void UpdateGenerationButton();
	BOOL CanGenerate();
	void EnableControls(bool enable);
	void Clear();
	void RedrawChildren();
	void UpdateWindowSize();

	CGenerationPrefDlg* AddCppPrefDialog(const cmString& title);
	CGenerationPrefDlg* AddAtlPrefDialog(const cmString& title);
	CGenerationPrefDlg* AddCSharpPrefDialog(const cmString& title);
	
	bool initialized_;
	
	CXmlProject* project_;
	cmString currentDirectory_;
	CImageList imageList_;

	CBrush bkBrush_;
	CBrush bkTipBrush_;

	vector<CGenerationPrefDlg*> preferences_;
	CGenerationPrefDlg* cppPref_;
	CGenerationPrefDlg* atlPref_;
	CGenerationPrefDlg* cSharpPref_;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(_GENERATIONREPORTDLG_H_)
