Leaked source code of windows server 2003
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.

217 lines
5.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: dialogs.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // Dialogs.h
  11. //
  12. //////////////////////////////////////////////////////////////////////
  13. #if !defined(AFX_DIALOGS_H__AE8F4B53_D4B3_11D1_846F_00104B211BE5__INCLUDED_)
  14. #define AFX_DIALOGS_H__AE8F4B53_D4B3_11D1_846F_00104B211BE5__INCLUDED_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif // _MSC_VER > 1000
  18. //
  19. // Includes
  20. //
  21. #include "Employee.h"
  22. //
  23. // Helper structure to define plan names and ids.
  24. //
  25. typedef struct tagHEALTHPLANDATA
  26. {
  27. WCHAR* pstrName;
  28. const GUID* pId;
  29. } HEALTHPLANDATA, FAR* PHEALTHPLANDATA;
  30. //
  31. // Helper structure to define plan names and ids.
  32. //
  33. typedef struct tagINVESTMENTPLANDATA
  34. {
  35. WCHAR* pstrName;
  36. const GUID* pId;
  37. } INVESTMENTPLANDATA, FAR* PINVESTMENTPLANDATA;
  38. //
  39. // Helper structure to define building names and ids.
  40. //
  41. typedef struct tagBUILDINGDATA
  42. {
  43. WCHAR* pstrName;
  44. WCHAR* pstrLocation;
  45. DWORD dwId;
  46. } BUILDINGDATA, FAR* PBUILDINGDATA;
  47. #ifdef _BENEFITS_DIALOGS
  48. //
  49. // Helper class to contain employee data.
  50. //
  51. template< class T >
  52. class CBenefitsDialog : public CDialogImpl<T>
  53. {
  54. public:
  55. CBenefitsDialog()
  56. {
  57. //
  58. // Initialize all members.
  59. //
  60. m_pEmployee = NULL;
  61. };
  62. //
  63. // Create a message map that handles all of our cancel button
  64. // implementations.
  65. //
  66. BEGIN_MSG_MAP( CBenefitsDialog<T> )
  67. COMMAND_HANDLER( IDCANCEL, BN_CLICKED, OnCloseCmd )
  68. END_MSG_MAP()
  69. //
  70. // Access function to set the employee that the dialog
  71. // will use.
  72. //
  73. void SetEmployee( CEmployee* pEmployee )
  74. {
  75. _ASSERTE( pEmployee != NULL );
  76. m_pEmployee = pEmployee;
  77. };
  78. //
  79. // Dismisses dialogs when the OK or cancel button are pressed.
  80. //
  81. LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
  82. {
  83. ::EndDialog(m_hWnd, wID);
  84. return 0;
  85. };
  86. protected:
  87. CEmployee* m_pEmployee;
  88. };
  89. //
  90. // Dialog handler for the CHealthNode enroll process.
  91. //
  92. class CHealthEnrollDialog : public CBenefitsDialog<CHealthEnrollDialog>
  93. {
  94. public:
  95. enum { IDD = IDD_HEALTHENROLL_DIALOG };
  96. BEGIN_MSG_MAP( CHealthEnrollDialog )
  97. MESSAGE_HANDLER( WM_INITDIALOG, OnInitDialog )
  98. COMMAND_HANDLER( IDOK, BN_CLICKED, OnOK )
  99. CHAIN_MSG_MAP( CBenefitsDialog<CHealthEnrollDialog> )
  100. END_MSG_MAP()
  101. //
  102. // Handler to initialize values in dialog. This should map data from the
  103. // employee to the dialog controls.
  104. //
  105. LRESULT OnInitDialog( UINT uiMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled );
  106. //
  107. // Stores the data and attempts to enroll the given user in the specified
  108. // health plan.
  109. //
  110. LRESULT OnOK( WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/ );
  111. protected:
  112. //
  113. // Helper structure for enrollment purposes.
  114. //
  115. typedef struct tagENROLLPARAMS
  116. {
  117. tagENROLLPARAMS()
  118. {
  119. fEnrolled = FALSE;
  120. }
  121. BOOL fEnrolled;
  122. TCHAR szInsurerName[ 256 ];
  123. TCHAR szPolicyNumber[ 256 ];
  124. } ENROLLPARAMS, FAR* PENROLLPARAMS;
  125. //
  126. // A stub function that could be used to enroll the employee.
  127. //
  128. BOOL Enroll( GUID* pPlan, PENROLLPARAMS pParams );
  129. };
  130. //
  131. // Dialog handler for the CRetirementNode enroll process.
  132. //
  133. class CRetirementEnrollDialog : public CBenefitsDialog<CRetirementEnrollDialog>
  134. {
  135. public:
  136. enum { IDD = IDD_RETIREMENTENROLL_DIALOG };
  137. BEGIN_MSG_MAP( CRetirementEnrollDialog )
  138. MESSAGE_HANDLER( WM_INITDIALOG, OnInitDialog )
  139. COMMAND_HANDLER( IDOK, BN_CLICKED, OnOK )
  140. CHAIN_MSG_MAP( CBenefitsDialog<CRetirementEnrollDialog> )
  141. END_MSG_MAP()
  142. //
  143. // Handler to initialize values in dialog.
  144. //
  145. LRESULT OnInitDialog( UINT uiMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled );
  146. //
  147. // Stores the data and attempts to enroll the given user in the specified
  148. // investment plan.
  149. //
  150. LRESULT OnOK( WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/ );
  151. protected:
  152. //
  153. // A stub function that could be used to enroll the employee.
  154. //
  155. BOOL Enroll( GUID* pPlan, int nNewRate );
  156. };
  157. //
  158. // Dialog handler for the CRetirementNode enroll process.
  159. //
  160. class CBuildingAccessDialog : public CBenefitsDialog<CBuildingAccessDialog>
  161. {
  162. public:
  163. enum { IDD = IDD_BUILDINGACCESS_DIALOG };
  164. BEGIN_MSG_MAP( CBuildingAccessDialog )
  165. MESSAGE_HANDLER( WM_INITDIALOG, OnInitDialog )
  166. COMMAND_HANDLER( IDOK, BN_CLICKED, OnOK )
  167. CHAIN_MSG_MAP( CBenefitsDialog<CBuildingAccessDialog> )
  168. END_MSG_MAP()
  169. //
  170. // Handler to initialize values in dialog.
  171. //
  172. LRESULT OnInitDialog( UINT uiMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled );
  173. //
  174. // Stores the data and attempts to enroll the given user in the specified
  175. // investment plan.
  176. //
  177. LRESULT OnOK( WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/ );
  178. protected:
  179. //
  180. // A stub function that could be used to enroll the employee.
  181. //
  182. BOOL GrantAccess( DWORD dwBuildingId );
  183. };
  184. #endif
  185. #endif // !defined(AFX_DIALOGS_H__AE8F4B53_D4B3_11D1_846F_00104B211BE5__INCLUDED_)