/*****************************************************************************
* 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
*
*****************************************************************************/


// LineHouston.h: interface for the CLineCSU class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(LINECSU_H)
#define LINECSU_H

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "Line.h"

#include "CSUConfig.h"
#include "ValueMapCSU.h"
#include "PropCSU.h"
#include "PropAdvCSU.h"
#include "PropPageFracT1.h"

#include "WizPageRadioButtons.h"

#if defined(LINE_EXPORT)
   #define LINE_EXPORTED_CLASS     AFX_CLASS_EXPORT
   #define LINE_EXPORTED_API       AFX_API_EXPORT
#else
   #define LINE_EXPORTED_CLASS     AFX_CLASS_IMPORT
   #define LINE_EXPORTED_API       AFX_API_IMPORT
#endif


class LINE_EXPORTED_CLASS CLineCSU : public CLine
{
	DECLARE_DYNAMIC(CLineCSU)

public:
	virtual ~CLineCSU();

   virtual BOOL SetParameters(void);
   virtual BOOL RemoveParameters(BOOL fRemoveKey = FALSE);
   virtual BOOL CopyParameters(CConfigObject const * const pFrom);

   virtual BOOL AddWizardPages(CConfigWizSheet * const pSheet);
   virtual BOOL RemoveWizardPages(CConfigWizSheet * const pSheet);
   virtual BOOL NextWizardPage(int const nState);

   virtual CString GetInformationText(void);
   virtual BOOL DoProperties(void);

protected:
   //
   // Allow instantiations of derived classes only
	CLineCSU(HKEY const hKeyRoot, CString const & strRegPath, CConfigObject const * const pParent);

   enum
   {
      WP_UNKNOWN = -1,
      WP_SPAN,
      WP_LBO,
      WP_EGL,
      WP_SHLEN,
      WP_FRAMING,
      WP_ENCODING,
      WP_COUNT,      // This to maintain the aMaps member count
      WP_FRAC_T1
   };

   BOOL AddPropertyPages(CPropertySheet * const pSheet);
   BOOL GetPropertiesFromPages(void);

private:
   //
   // Parameters gettable/settable by the config (data resides in adapter instance registry key)
   SCSUConfig m_CSUConfig;
   SFracT1Config m_FracT1Config;
   BOOL m_fE1;
   DWORD m_fFracT1Capable;
   DWORD m_fConfigFracT1;

   BOOL GetParameters(void);
   BOOL GetConfigData(void);
   DWORD FigureEndPoints(DWORD const Mask);
   DWORD FigureAggregateLineSpeed(DWORD const SlotMask, DWORD const SpeedMask);
   void UpdateFracT1Params(void);
   BOOL VerifyConfigFracT1(void);

   //
   // Wizard stuff
   CConfigWizSheet * m_pwsSheet;

   CConfigWizPage * m_apWizPages[WP_COUNT];
   SValueMapCSU m_aValueMaps[WP_COUNT];


   BOOL HandleWizSpan(void);
   BOOL HandleWizLBO(void);
   BOOL HandleWizEGL(void);
   BOOL HandleWizSHLen(void);
   BOOL HandleWizFraming(void);
   BOOL HandleWizEncoding(void);
   BOOL HandleWizFracT1(void);

   //
   // Prop page stuff
   CPropCSU * m_pPropCSU;
   CPropAdvCSU * m_pPropAdvCSU;
   CPropPageFracT1 * m_pPropPageFracT1;
};

#endif // !defined(LINECSU_H)
