/*****************************************************************************
* Copyright (c) 1990-2000 Digi International Inc., All Rights Reserved
* 
* This software contains proprietary and confidential information of Digi
* International Inc.  By accepting transfer of this copy, Recipient agrees
* to retain this software in confidence, to prevent disclosure to others,
* and to make no use of this software other than that for which it was
* delivered.  This is an unpublished copyrighted work of Digi International
* Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly
* prohibited.
* 
* Restricted Rights Legend
*
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in sub-paragraph (c)(1)(ii) of The Rights in
* Technical Data and Computer Software clause at DFARS 252.227-7031 or
* subparagraphs (c)(1) and (2) of the Commercial Computer Software -
* Restricted Rights at 48 CFR 52.227-19, as applicable.
*
* Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
*
*****************************************************************************/

#if !defined(AFX_PROPSTDCOMNAME_H__5C32199A_B645_4E81_ADAD_73828559E376__INCLUDED_)
#define AFX_PROPSTDCOMNAME_H__5C32199A_B645_4E81_ADAD_73828559E376__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PropStdComName.h : header file
//
#include "Resource.h"

// When the user requests more com names to choose from, add this many
#define DEFAULT_TO_ADD 64
#define COM_NAME_PREFIX TEXT("COM")
#define MAX_NAMES_IN_LIST 1024
typedef enum COM_NUMBER_STATUS
{
   COM_NUMBER_FREE,
   COM_NUMBER_IN_USE_BY_THIS_ADAPTER,
   COM_NUMBER_SYSTEM_CONFLICT,
   COM_NUMBER_ADD_MORE_NAMES,
   COM_NUMBER_IN_USE_ABOVE_CURRENT_PORT
};

/////////////////////////////////////////////////////////////////////////////
// CPropStdComName dialog

class CPropStdComName : public CPropertyPage
{
	DECLARE_DYNCREATE(CPropStdComName)

// Construction
public:
	CPropStdComName();
	~CPropStdComName();

   void SetExistingComNumber(DWORD const n) {m_nExistingComNumber = n; m_nSelectedComNumber = n;}
   void SetPickListCount(DWORD const n) {m_nPickListCount = n;}
   BOOL SetComNumberStatus(DWORD const nComNumber, COM_NUMBER_STATUS const nStatus);
   DWORD GetSelectedComNumber(void) {return m_nSelectedComNumber;}
   COM_NUMBER_STATUS GetComNumberStatus(DWORD const nNumber);
   BOOL GetRenumberFromHere(void) { return m_fEnumerateFromHere; }
   // No set for this, it should never be turned on going into the dialog!

// Dialog Data
	//{{AFX_DATA(CPropStdComName)
	enum { IDD = IDD_PropPageStdComName };
	CButton	m_bcEnumerateFromHere;
	CComboBox	m_ctlComName;
	int		m_nComNameIndex;
	BOOL	m_fEnumerateFromHere;
	//}}AFX_DATA


// Overrides
	// ClassWizard generate virtual function overrides
	//{{AFX_VIRTUAL(CPropStdComName)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Overridables
public:
	virtual BOOL OnKillActive();

// Implementation
protected:
	// Generated message map functions
	//{{AFX_MSG(CPropStdComName)
	virtual BOOL OnInitDialog();
	afx_msg void OnSelchangeComboComName();
	afx_msg void OnCheckEnumerateFromHere();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

   BOOL FillPickList(void);

private:
	DWORD m_nExistingComNumber;
   DWORD m_nSelectedComNumber;
   DWORD m_nPickListCount;
   COM_NUMBER_STATUS m_nComNumberStatus[MAX_NAMES_IN_LIST];
};

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

#endif // !defined(AFX_PROPSTDCOMNAME_H__5C32199A_B645_4E81_ADAD_73828559E376__INCLUDED_)
