// MCSDlg.h : header file
//

#if !defined(AFX_MCSDLG_H__D1988D65_EB7D_4998_8CA9_CFA2BC54D5B1__INCLUDED_)
#define AFX_MCSDLG_H__D1988D65_EB7D_4998_8CA9_CFA2BC54D5B1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "HalSIS.h"
#include "DlgLanguSelect.h"
#include "DlgDriveSelect.h"

/////////////////////////////////////////////////////////////////////////////
// CMCSDlg dialog

#define NO_COLUMN 40
#define FILE_NAME_COLUMN 200
#define LANGUAGE_COLUMN 70
#define TYPE_COLUMN 40
#define OPTION_COLUMN 60
#define COMPRESSED_SIZE_COLUMN 60
#define ORIGINAL_SIZE_COLUMN 60
#define OFFSET_COLUMN 50



#define MCS_UNZIP_BUF_SIZE 1024


class CMCSDlg : public CDialog
{
// Construction
public:
	int getNumOfDirFromDisFileName(char *aDistFileName);
	CMCSDlg(CWnd* pParent = NULL);	// standard constructor

	// --- For Thread Control ---
	static UINT ThreadFuncDownload(LPVOID pParam);
	unsigned char m_headerBuffer[SIS_HEADER_SIZE];

	void kickCMSBody();
	void MCSFilter();
	void makeCMSList(int fileCount, HalSISPackage *pkg);
	void displayHeaderTable(CHalSIS *pParams);

	CDlgLanguSelect m_DlgLanguSelect;
	CDlgDriveSelect m_DlgDriveSelect;

// Dialog Data
	//{{AFX_DATA(CMCSDlg)
	enum { IDD = IDD_MCS_DIALOG };
	CProgressCtrl m_wndProgressCtrl;
	CListCtrl	m_List1;
	CRect m_r;
	int m_driveSetting;

	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMCSDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	//}}AFX_VIRTUAL

	// File Handling
	int m_fh;
	char m_fileNameBuf[512];
	char m_windowText[1024];

// Implementation
protected:
	// --- For Thread Contorl ---
	BOOL m_bThread;
	CWinThread* m_pThread;

	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CMCSDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnStop();
	afx_msg void OnTest();
	afx_msg void OnDropFiles(HDROP hDropInfo);
	afx_msg void OnCheck1();
	afx_msg void OnCheck2();
	afx_msg void OnMcsFileOpen();
	afx_msg void OnMcsEditCopy();
	afx_msg void OnMcsFileClose();
	afx_msg void OnMcsHelpAbout();
	afx_msg void OnRadio1();
	afx_msg void OnRadio2();
	afx_msg void OnMenuitemListclear();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_MCSDLG_H__D1988D65_EB7D_4998_8CA9_CFA2BC54D5B1__INCLUDED_)
