// NetSDKDemoDlg.h : 头文件
//

#pragma once
#include "WndManager.h"
#include "DevListDlg.h"
#include "SnapDlg.h"
#include "MenuDlg.h"
#include "DevCtrlDlg.h"
#include "UpDownLoad.h"
#include "DevCtrlDlgEx.h"
#include "CodeParamDlg.h"
#include "RecordDlg.h"
#include "RecordEx.h"
#include "DevSearchDlg.h"
#include "LocalRecord.h"
#include "DevConfig.h"
#include "VoiceCtrl.h"
#include "NetSDKLog.h"
#include "PlayCtrl.h"
#include "AlarmEventDlg.h"

#include "afxcmn.h"
#include "afxwin.h"
enum WndID
{
	DEV_LIST_DLG,
	DEV_CTRL_DLG,
	DEV_CTRL_DLGEX,
	UP_DOWN_LOAD,
	DEV_CODE_PARAM,
	DEV_LOG_DLG,
	DEV_FILE_LOAD,
	DEV_LOCAL_RECORD,
	DEV_CONFIG,
	DEV_VOICE_CTRL,
	DEV_SNAP,
	DEV_NET_LOG,
	DEV_PLAY_WND,
	FILE_PLAYBACK_WND
};


#define WM_USR_DEV_STATUS_WND WM_USER+100

// CNetSDKDemoDlg 对话框
class CNetSDKDemoDlg : public CDialog
{
// 构造
public:
	CNetSDKDemoDlg(CWnd* pParent = NULL);	// 标准构造函数
	~CNetSDKDemoDlg()
	{
		
	};
// 对话框数据
	enum { IDD = IDD_NETSDKDEMO_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV 支持


// 实现
protected:
	HICON m_hIcon;

	// 生成的消息映射函数
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg HRESULT OnDevStatus(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()
public:
	void   OpenDigitZoom(BOOL bOpen, int lPlayID);
	WINDOWPLACEMENT m_wndpl;
	BOOL m_bFullScreen;
	CRect m_rcTop;
	CMenuDlg *m_pMenuDlg;
	//Center
	CWndManager *m_pWndManager;
	// Left
	CDevListDlg *m_pWndDevList;
	//Bottom
	CDevSearch *m_pDevSearch;
	CRecordDlg *m_pRecordDlg;
	CAlarmEventDlg *m_pAlarmEvent;
	// Right
	CSnapDlg *m_pSnapDlg;
	CDevCtrlDlg *m_pDevCtrlDlg;
	CDevCtrlDlgEx *m_pDevCtrlDlgEx;
	CUpDownLoad *m_pUpDownLoad;
	CCodeParamDlg *m_pCodeParamDlg;
	CRecordEx *m_pRecordEx;
	CLocalRecord *m_pLocalRecord;
	CVoiceCtrl *m_pVoiceCtrl;
	CDevConfig *m_pDevConfig;
	CPlayCtrl *m_pPlayCtrl;
	CNetSDKLog *m_pNetSDKLog;

	CRect m_rcWndManager;
	CRect m_rcDevListDlg;
	CRect m_rcBottomDlg;
	CRect m_rcRightDlg;
	CRect m_rcMenuDlg;
	CRect m_rcDevCtrlDlg;
	
public:
	void FullScreen();
	void EndFullScreen();
	virtual BOOL DestroyWindow();
	void PresetCtrl(PTZ_PRESET_TYPE PresetCmd, int iPresetNum);
	void PTZCtrl(PTZ_CMD_TYPE PtzCmd, int iPanSpeed, int iTiltSpeed);
	void XMLCtrl(char *pStrXML);
	HWND GetCurSelWnd();

	void SetViewWnd(WndID emWndID, int nCmdShow);
	void SetWndUser(HWND hWnd, LPCTSTR strKey);
	CString GetWndUser(HWND hWnd);
	void ClearWndUser();


public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnClose();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	static LONG __stdcall fStatusEventCallBack(LONG lUser,LONG nStateCode,char *pResponse,void *pUser);
	static LONG __stdcall fAUXResponseCallBack(LONG lUser,LONG nType,char *pResponse,void *pUser);
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	

};


