// WiFiDirectClientDlg.h : header file
//

#pragma once

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

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

using namespace wclWiFi;

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

// Dialog Data
	enum { IDD = IDD_WIFIDIRECTCLIENT_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 lvDevices;
	CListBox lbLog;
	CComboBox cbPairingProcedure;
	CEdit edGroupOwnerIntent;
	CButton cbDisplayPin;
	CButton cbProvidePin;
	CButton cbPushButton;

	CwclWiFiDirectDeviceWatcher Watcher;
	CwclWiFiDirectClient Client;

	void wclWiFiDirectDeviceWatcherDeviceFound(void* Sender, const tstring& Id, 
		const tstring& Name);
	void wclWiFiDirectDeviceWatcherDiscoveringCompleted(void* Sender, const int Error);
	void wclWiFiDirectDeviceWatcherDiscoveringStarted(void* Sender);

	void wclWiFiDirectClientDeviceConnected(void* Sender,
		CwclWiFiDirectDevice* const Device, const int Error);
	void wclWiFiDirectClientDeviceDisconnected(void* Sender,
		CwclWiFiDirectDevice* const Device, const int Reason);
	void wclWiFiDirectClientPairCompleted(void* Sender,
		CwclWiFiDirectDevice* const Device, const int Result);
	void wclWiFiDirectClientPairConfirm(void* Sender,
		CwclWiFiDirectDevice* const Device, bool& Confirm);
	void wclWiFiDirectClientPairDisplayPin(void* Sender,
		CwclWiFiDirectDevice* const Device, const tstring& Pin);
	void wclWiFiDirectClientPairGetParams(void* Sender,
		CwclWiFiDirectDevice* const Device, short& GroupOwnerIntent,
		wclWiFiDirectConfigurationMethods& ConfigurationMethods,
		wclWiFiDirectPairingProcedure& PairingProcedure);
	void wclWiFiDirectClientPairProvidePin(void* Sender,
		CwclWiFiDirectDevice* const Device, tstring& Pin);

public:
	afx_msg void OnBnClickedButtonDiscover();
	afx_msg void OnBnClickedButtonTerminate();
	afx_msg void OnDestroy();
	afx_msg void OnBnClickedButtonClear();
	afx_msg void OnBnClickedButtonDisconnect();
	afx_msg void OnBnClickedButtonConnect();
	afx_msg void OnBnClickedButtonIsPaired();
	afx_msg void OnBnClickedButtonUnpair();
	afx_msg void OnBnClickedButtonEnumPaired();
};
