
#pragma once

#include "afxcmn.h"

#include "..\..\..\..\Source\Common\wclPowerEvents.h"
#include "..\..\..\..\Source\WiFi\wclWiFi.h"

using namespace wclWiFi;

// CWiFiEventsDlg dialog
class CWiFiEventsDlg : public CDialog
{
// Construction
public:
	CWiFiEventsDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_WIFIEVENTS_DIALOG };

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


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()

private:
	CwclWiFiEvents wclWiFiEvents;
	CwclPowerEventsMonitor FPowerMonitor;

	CListCtrl lvEvents;

	void TraceEvent(const GUID* const Iface, const CString& EventName, 
		const CString& ParamName, const CString& ParamValue);
	void TraceAcmConnectionEvent(const GUID& IfaceId, const CString& EventName,
		const wclWiFiAcmConnectionEventData& Data);
	void TraceMsmConnectionEvent(const GUID& IfaceId, const CString& EventName,
		const wclWiFiMsmConnectionEventData& Data);

	void EventsAfterOpen(void* Sender);
	void EventsBeforeClose(void* Sender);

	void AcmAdHocNetworkStateChange(void* Sender, const GUID& IfaceId, 
		const wclWiFiAdHocNetworkState State);
	void AcmAutoconfDisabled(void* Sender, const GUID& IfaceId);
	void AcmAutoconfEnabled(void* Sender, const GUID& IfaceId);
	void AcmBackgroundScanDisabled(void* Sender, const GUID& IfaceId);
	void AcmBackgroundScanEnabled(void* Sender, const GUID& IfaceId);
	void AcmConnectionAttemptFail(void* Sender, const GUID& IfaceId, 
		const wclWiFiAcmConnectionEventData& Data);
	void AcmBssTypeChange(void* Sender, const GUID& IfaceId, const wclWiFiBssType BssType);
	void AcmConnectionComplete(void* Sender, const GUID& IfaceId, 
		const wclWiFiAcmConnectionEventData& Data);
	void AcmConnectionStart(void* Sender, const GUID& IfaceId, 
		const wclWiFiAcmConnectionEventData& Data);
	void AcmDisconnected(void* Sender, const GUID& IfaceId, 
		const wclWiFiAcmConnectionEventData& Data);
	void AcmDisconnecting(void* Sender, const GUID& IfaceId, 
		const wclWiFiAcmConnectionEventData& Data);
	void AcmFilterListChange(void* Sender, const GUID& IfaceId);
	void AcmInterfaceArrival(void* Sender, const GUID& IfaceId);
	void AcmInterfaceRemoval(void* Sender, const GUID& IfaceId);
	void AcmNetworkAvailable(void* Sender, const GUID& IfaceId);
	void AcmNetworkNotAvailable(void* Sender, const GUID& IfaceId);
	void AcmOperationalStateChange(void* Sender, const GUID& IfaceId);
	void AcmPowerSettingChange(void* Sender, const GUID& IfaceId, 
		const wclWiFiPowerSetting Setting);
	void AcmProfileBlocked(void* Sender, const GUID& IfaceId);
	void AcmProfileChange(void* Sender, const GUID& IfaceId);
	void AcmProfileNameChange(void* Sender, const GUID& IfaceId, 
		const tstring& OldName, const tstring& NewName);
	void AcmProfilesExhausted(void* Sender, const GUID& IfaceId);
	void AcmProfileUnblocked(void* Sender, const GUID& IfaceId);
	void AcmScanComplete(void* Sender, const GUID& IfaceId);
	void AcmScanFail(void* Sender, const GUID& IfaceId, const int Reason);
	void AcmScanListRefresh(void* Sender, const GUID& IfaceId);
	void AcmScreenPowerChange(void* Sender, const GUID& IfaceId, 
		const bool SwitchedOn);

	void HostedNetworkPeerStateChange(void* Sender, const GUID& IfaceId,
		const wclWiFiHostedNetworkPeerState& OldState, 
		const wclWiFiHostedNetworkPeerState& NewState, const int Reason);
	void HostedNetworkRadioStateChange(void* Sender, const GUID& IfaceId,
		const wclWiFiRadioState SoftwareState, const wclWiFiRadioState HardwareState);
	void HostedNetworkStateChange(void* Sender, const GUID& IfaceId,
		const wclWiFiHostedNetworkState OldState, const wclWiFiHostedNetworkState NewState,
		const int Reason);

	void MsmAdapterOperationModeChange(void* Sender, const GUID& IfaceId, 
		const wclWiFiOperationMode Mode);
	void MsmAdapterRemoval(void* Sender, const GUID& IfaceId, 
		const wclWiFiMsmConnectionEventData &Data);
	void MsmAssociated(void* Sender, const GUID& IfaceId, 
		const wclWiFiMsmConnectionEventData& Data);
	void MsmAssociating(void* Sender, const GUID& IfaceId, 
		const wclWiFiMsmConnectionEventData& Data);
	void MsmAuthenticating(void* Sender, const GUID& IfaceId, 
		const wclWiFiMsmConnectionEventData& Data);
	void MsmConnected(void* Sender, const GUID& IfaceId, 
		const wclWiFiMsmConnectionEventData& Data);
	void MsmDisassociating(void* Sender, const GUID& IfaceId, 
		const wclWiFiMsmConnectionEventData& Data);
	void MsmDisconnected(void* Sender, const GUID& IfaceId, 
		const wclWiFiMsmConnectionEventData& Data);
	void MsmPeerJoin(void* Sender, const GUID& IfaceId, 
		const wclWiFiMsmConnectionEventData& Data);
	void MsmPeerLeave(void* Sender, const GUID& IfaceId, 
		const wclWiFiMsmConnectionEventData& Data);
	void MsmRadioStateChange(void* Sender, const GUID& IfaceId, 
		const wclWiFiPhyRadioState& State);
	void MsmRoamingEnd(void* Sender, const GUID& IfaceId, 
		const wclWiFiMsmConnectionEventData& Data);
	void MsmRoamingStart(void* Sender, const GUID& IfaceId, 
		const wclWiFiMsmConnectionEventData& Data);
	void MsmSignalQualityChange(void* Sender, const GUID& IfaceId, 
		const unsigned long Quality);
	void MsmLinkDegraded(void* Sender, const GUID& IfaceId);
    void MsmLinkImproved(void* Sender, const GUID& IfaceId);

	void OneXAuthRestarted(void* Sender, const GUID& IfaceId, const int Reason);
	void OneXAuthUpdate(void* Sender, const GUID& IfaceId, 
		const wclWiFiOneXStatusUpdate& State);

	void IpChanged(void* Sender, const GUID& IfaceId,  const wclWiFiIpSettings& Old, 
		const wclWiFiIpSettings& New);

	void PowerStateChanged(void* Sender, const wclPowerState State);

public:
	afx_msg void OnBnClickedButtonEventsOpen();
	afx_msg void OnBnClickedButtonEventsClose();
	afx_msg void OnBnClickedButtonEventsClear();
	afx_msg void OnDestroy();
};
