#if !defined(AFX_SETTINGSSHEET_H__3B16967D_5736_432E_A398_2FE0117D093C__INCLUDED_)
#define AFX_SETTINGSSHEET_H__3B16967D_5736_432E_A398_2FE0117D093C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SettingsSheet.h : header file
//
#define CONCTRL_ELAPSE_DL         23
#define CONCTRL_ELAPSE_FLASH      25
#define MAX_FILE_COUNT	        20
#define MAX_BUF_SIZE            2048

/////////////////////////////////////////////////////////////////////////////
// CSettingsSheet
#include "MainPage.h"
#include "ModeSettingsPage.h"
#include "CalibrationPage.h"
#include "NandFlashSettings.h"
#include "PageMultiLang.h"
#include "BMAGlobal.h"
#include "FlashOptPage.h"

class CSettingsSheet : public CPropertySheet
{
	DECLARE_DYNAMIC(CSettingsSheet)

// Construction
public:
	CSettingsSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	CSettingsSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);

    BOOL LoadSettings(LPCTSTR pFileName);
    BOOL SaveSettings(LPCTSTR pFileName);
	BOOL LoadPacket(LPCTSTR pFileName);
    
    CString GetCurProduct()
    {
        return m_pageMain.m_strCurProduct;
    }

public:
    int		GetBaudRate();
    int		GetComPort();
    int		GetDownloadFile( CStringArray& aryDownloadFile );    

    BOOL	GetCmdBootFlag();
    DWORD	GetWaitTimeForNextChip();
    DWORD	GetWaitTimeForBootMode();
    int		GetRepartitionFlag();
    int		GetFlashPageType();
	int		GetNvNewBasePosition();
	int		GetFileInfo(LPCTSTR lpszFileID, LPDWORD ppFileInfo);
	CString GetDownloadFilePath(LPCTSTR lpszFileID);
	int		GetNvBkpItemCount();	
	BOOL	GetFlashBaseIndex(const DWORD dwFlashType, DWORD &dwIndex);
	PNV_BACKUP_ITEM_T GetNvBkpItemInfo(int nIndex);

	BOOL	IsNandFlash();  // if NAND return true, NOR return false
	BOOL	IsProdDualMode(); 
	BOOL	IsDualMode();		//judge if one or both of GSM and TD is/are omitted	
	BOOL	IsMainPageInit();
	BOOL	IsBackupNV();         //for NV page
	BOOL	IsNvBaseChange();
	BOOL	IsUseFlashType();
	BOOL    IsUseFlashSpec();
	BOOL	IsReadFlashInFDL2();
	
	BOOL    IsNVSaveToLocal();
	CString GetNVSavePath();

	void	Resize( int nChangeWidth, int nChangeHeight );

	BOOL    IsBackupLang();
	BOOL    IsHasLang();
	WORD    GetLangNVItemID();
	
	BOOL    IsNVOrgDownload();
	int     GetNVOrgBasePosition();
	
	BOOL    IsOmaDM();

	int     GetFlashOprFileInfo(CUIntArray &agFlashOpr);
	
	BOOL    IsEnableChipDspMap();

    CFont				m_fntPage; 
	CCalibrationPage    m_pageCalibration;
	CPageMultiLang		m_pageMultiLang;

// Attributes
protected:
	CMainPage           m_pageMain;
    CModeSettingsPage   m_pageMode;    
    CNandFlashSettings  m_pageNandFlash;
	CFlashOptPage       m_pageFlashOpt;

// Operations
public:
    RECT m_rctPage;
    
// Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CSettingsSheet)
	public:
    virtual BOOL OnInitDialog();
	protected:
    virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
    virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL
    
// Implementation
public:
    virtual ~CSettingsSheet();
    
// Generated message map functions
protected:
    virtual void BuildPropPageArray ();
    //{{AFX_MSG(CSettingsSheet)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//}}AFX_MSG
    afx_msg LONG OnResizePage (UINT, LONG);
//	afx_msg void OnPressButton(int nButtion);
	afx_msg void OnApply();
    DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_SETTINGSSHEET_H__3B16967D_5736_432E_A398_2FE0117D093C__INCLUDED_)
