#pragma once

#include "afxcmn.h"
#include "afxwin.h"

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

using namespace wclWiFi;

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

// Dialog Data
	enum { IDD = IDD_WIFICLIENT_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:
	CListCtrl lvClientInterfaces;
	CButton cbClientAdHocProfiles;
	CButton cbClientHiddenProfiles;
	CEdit edClientScanSsid;
	CListCtrl lvClientNetworks;
	CButton cbClientUseSsid;
	CComboBox cbClientBssType;
	CListCtrl lvClientBss;
	CEdit edClientNewProfileName;
	CListCtrl lvClientProfiles;
	CComboBox cbClientConnect;
	CEdit edClientPasskey;
	CButton cbClientDiscoverSecure;

	CwclWiFiClient wclWiFiClient;
	CwclWiFiProfilesManager wclWiFiProfilesManager;

	void ClientAfterOpen(void* Sender);
	void ClientBeforeClose(void* Sender);

	void ClientClearInterfaces();
	void ClientClearNetworks();
	void ClientClearBss();
	void ClientClearProfiles();

	bool ClientGetInterfaceId(GUID& Id) const;
	bool ClientGetProfile(CString& Name) const;
	wclWiFiBssType ClientGetNetworkBss() const;

	void ClientEnumProfiles();

	void ClientConenctUsingTemporaryProfile();
	void ClientConnectUsingNetworkProfile();
	void ClientConnectUsingSelectedNetwork();
	void ClientConnectUsingSelectedProfile();

	void ClientSwitchState(const GUID& Id, const bool Off);
	void ClientSetDualState(const bool Enable);

	void UpdateUI(const bool Enable);

public:
	afx_msg void OnBnClickedButtonClientOpen();
	afx_msg void OnBnClickedButtonClientClose();
	afx_msg void OnDestroy();
	afx_msg void OnBnClickedButtonClientEnumIntrfaces();
	afx_msg void OnBnClickedButtonClientEnumNetworks();
	afx_msg void OnBnClickedButtonClientScan();
	afx_msg void OnBnClickedButtonClientEnumBss();
	afx_msg void OnBnClickedButtonClientDisconnect();
	afx_msg void OnBnClickedButtonClientGetShowDeniedNetworks();
	afx_msg void OnBnClickedButtonClientSetShowDeniedNetworks();
	afx_msg void OnBnClickedButtonClientGetPowerSetting();
	afx_msg void OnBnClickedButtonClientGetOnlyUseGpProfiles();
	afx_msg void OnBnClickedButtonClientGetAllowExplicitCreds();
	afx_msg void OnBnClickedButtonClientSetAllowExplicitCreds();
	afx_msg void OnBnClickedButtonClientGetBlockPeriod();
	afx_msg void OnBnClickedButtonClientSetBlockPeriod();
	afx_msg void OnBnClickedButtonClientGetVirtualStationExtensibility();
	afx_msg void OnBnClickedButtonClientSetVirtualStationExtensibility();
	afx_msg void OnBnClickedButtonClientGetState();
	afx_msg void OnBnClickedButtonClientEnumProfiles();
	afx_msg void OnBnClickedButtonClientDeleteProfile();
	afx_msg void OnBnClickedButtonClientRenameProfile();
	afx_msg void OnBnClickedButtonClientGetProfileXml();
	afx_msg void OnBnClickedButtonClientSetProfileExml();
	afx_msg void OnBnClickedButtonClientConnect();
	afx_msg void OnBnClickedButtonTurnOn();
	afx_msg void OnBnClickedButtonTurnOff();
private:
	CButton cbUseBssMac;
	CButton cbPlainText;
public:
	afx_msg void OnBnClickedButtonCurrentIp();
	afx_msg void OnBnClickedButtonGetIpSettings();
	afx_msg void OnBnClickedButtonEnableDhcp();
	afx_msg void OnBnClickedButtonEnableStaticIp();
	afx_msg void OnBnClickedButtonSjowEditUi();
	afx_msg void OnBnClickedButtonSetUserData();
	afx_msg void OnBnClickedButton1();
	afx_msg void OnBnClickedButton3();
	afx_msg void OnBnClickedButton2();
	afx_msg void OnBnClickedButton4();
private:
	CButton btClientOpen;
	CButton btClientClose;
	CButton btClientEnumInterfaces;
	CButton btClientEnumNetworks;
	CButton btClientScan;
	CButton btClientEnumBSS;
	CButton btClientDisconnect;
	CButton btClientGetShowDeniedNetworks;
	CButton btClientSetShowDeniedNetworks;
	CButton btClientGetPowerSettings;
	CButton btClientGetOnlyUseGpProfiles;
	CButton btClientGetAllowExplicitCreds;
	CButton btClientSetAllowExplicitCreds;
	CButton btClientGetBlockPeriod;
	CButton btClientSetBlockPeriod;
	CButton btClientGetVirtualStationExtensibility;
	CButton btClientSetVirtualStationExtensibility;
	CButton btClientGetInterfaceState;
	CButton btClientEnumProfiles;
	CButton btClientDeleteProfile;
	CButton btClientRenameProfile;
	CButton btClientGetProfileXml;
	CButton btClientSetProfileXml;
	CButton btClientConnect;
	CButton btTurnOn;
	CButton btTurnOff;
	CButton btCurrentIp;
	CButton btGetIpSettings;
	CButton btEnableDhcp;
	CButton btEnableStaticIp;
	CButton btEditUi;
	CButton btSetProfileXmlUserData;
	CButton btGetDualStaState;
	CButton btEnableDualSta;
	CButton btDisableDualSta;
	CButton btEnumSecondaryInterfaces;
};
