Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
3.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1998
  6. //
  7. // File: pggen.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #if !defined(AFX_GENERAL_H__C0DCD9EA_64FE_11D1_855B_00C04FC31FD3__INCLUDED_)
  11. #define AFX_GENERAL_H__C0DCD9EA_64FE_11D1_855B_00C04FC31FD3__INCLUDED_
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15. // general.h : header file
  16. //
  17. class CPgSubLimit;
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CPgGeneral dialog
  20. struct CServiceLevelLimitsRecord
  21. {
  22. CServiceLevelLimitsRecord()
  23. {
  24. m_nServiceType = -1; // no inited
  25. m_bExistBeforeEdit = false;
  26. m_bExistAfterEdit = false;
  27. m_dwSaveFlags = 0;
  28. };
  29. int m_nServiceType;
  30. CString m_strNameToCompareWith;
  31. bool m_bExistBeforeEdit;
  32. bool m_bExistAfterEdit;
  33. CComPtr<CACSSubnetServiceLimits> m_spLimitsObj;
  34. DWORD m_dwSaveFlags; // attribute flags
  35. };
  36. // ACS_SUBNET_LIMITS_SERVICETYPE_AGGREGATE
  37. // ACS_SUBNET_LIMITS_SERVICETYPE_GUARANTEEDSERVICE
  38. // ACS_SUBNET_LIMITS_SERVICETYPE_CONTROLLEDLOAD
  39. enum ServiceLevelIndex
  40. {
  41. Index_Aggregate,
  42. Index_Guaranteed,
  43. Index_ControlledLoad,
  44. _Index_Total_
  45. };
  46. class CPgGeneral : public CACSPage
  47. {
  48. DECLARE_DYNCREATE(CPgGeneral)
  49. // Construction
  50. protected:
  51. CPgGeneral();
  52. public:
  53. CPgGeneral(CACSSubnetConfig* pConfig, CACSContainerObject<CACSSubnetServiceLimits>* pLimitsCont);
  54. ~CPgGeneral();
  55. // Dialog Data
  56. //{{AFX_DATA(CPgGeneral)
  57. enum { IDD = IDD_GENERAL };
  58. CButton m_btnEdit;
  59. CButton m_btnDelete;
  60. CButton m_btnAdd;
  61. CListCtrl m_listServiceLimit;
  62. BOOL m_bEnableACS;
  63. CString m_strDesc;
  64. UINT m_uDataRate;
  65. UINT m_uPeakRate;
  66. UINT m_uTTDataRate;
  67. UINT m_uTTPeakRate;
  68. //}}AFX_DATA
  69. // Overrides
  70. // ClassWizard generate virtual function overrides
  71. //{{AFX_VIRTUAL(CPgGeneral)
  72. public:
  73. virtual BOOL OnApply();
  74. protected:
  75. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  76. //}}AFX_VIRTUAL
  77. void EnableEverything();
  78. // Implementation
  79. protected:
  80. // Generated message map functions
  81. //{{AFX_MSG(CPgGeneral)
  82. afx_msg void OnCheckEnableacs();
  83. afx_msg void OnChangeEditGenDesc();
  84. virtual BOOL OnInitDialog();
  85. afx_msg void OnButtonaddservicelimit();
  86. afx_msg void OnButtondeleteservicelimit();
  87. afx_msg void OnButtoneditservicelimit();
  88. afx_msg void OnItemchangedListServicelimit(NMHDR* pNMHDR, LRESULT* pResult);
  89. afx_msg void OnDblclkListServicelimit(NMHDR* pNMHDR, LRESULT* pResult);
  90. //}}AFX_MSG
  91. DECLARE_MESSAGE_MAP()
  92. void DataInit();
  93. CComPtr<CACSSubnetConfig> m_spConfig;
  94. BOOL m_bFlowDataChanged;
  95. CComPtr<CACSContainerObject<CACSSubnetServiceLimits> > m_spLimitsCont;
  96. void CalculateAvailableTypes();
  97. void GetLimitsFromLimitsDlg(CPgSubLimit& dlg);
  98. void SetLimitsToLimitsDlg(CPgSubLimit& dlg, CACSSubnetServiceLimits* pLimits) ;
  99. // since, we only support 3 different service-level limit
  100. // type ids are defined by
  101. // ACS_SUBNET_LIMITS_SERVICETYPE_AGGREGATE
  102. // ACS_SUBNET_LIMITS_SERVICETYPE_GUARANTEEDSERVICE
  103. // ACS_SUBNET_LIMITS_SERVICETYPE_CONTROLLEDLOAD
  104. // names are defined by
  105. // ACS_SUBNET_LIMITS_OBJ_AGGREGATE
  106. // ACS_SUBNET_LIMITS_OBJ_GUARANTEEDSERVICE
  107. // ACS_SUBNET_LIMITS_OBJ_CONTROLLEDLOAD
  108. // the following logic is used to determine which limit can be added
  109. // if aggregate, is defined, no other limit can be added, till the aggregate is removed
  110. // if either guranteed or controlled-load is defined, no aggregate can be added
  111. // guranteed and controlled-load may
  112. CServiceLevelLimitsRecord m_aLimitsRecord[_Index_Total_];
  113. int m_aAvailableTypes[_Index_Total_ + 1]; // -1 is used for the end
  114. };
  115. //{{AFX_INSERT_LOCATION}}
  116. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  117. #endif // !defined(AFX_GENERAL_H__C0DCD9EA_64FE_11D1_855B_00C04FC31FD3__INCLUDED_)