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.

233 lines
6.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2000 - 2001.
  5. //
  6. // File: headers.h
  7. //
  8. // Contents:
  9. //
  10. // History: 08-28-2001 Hiteshr Created
  11. //
  12. //----------------------------------------------------------------------------
  13. /******************************************************************************
  14. Class: CBaseAddDialog
  15. Purpose: This is the base class for all Add Dialog classes.
  16. ******************************************************************************/
  17. class CBaseAddDialog: public CHelpEnabledDialog
  18. {
  19. public:
  20. CBaseAddDialog(CList<CBaseAz*,CBaseAz*>& listAzObjectsToDisplay,
  21. CList<CBaseAz*,CBaseAz*>& listAzObjectsSelected,
  22. ULONG IDD_DIALOG,
  23. INT nIDListCtrl,
  24. COL_FOR_LV *pColForLv,
  25. UINT uiListCtrlFlags)
  26. :CHelpEnabledDialog(IDD_DIALOG),
  27. m_listCtrl(uiListCtrlFlags,FALSE,pColForLv,TRUE),
  28. m_listAzObjectsToDisplay(listAzObjectsToDisplay),
  29. m_listAzObjectsSelected(listAzObjectsSelected),
  30. m_nIDListCtrl(nIDListCtrl),
  31. m_uiListCtrlFlags(uiListCtrlFlags)
  32. {
  33. }
  34. ~CBaseAddDialog()
  35. {
  36. }
  37. protected:
  38. virtual BOOL
  39. OnInitDialog();
  40. virtual void
  41. OnOkCancel(BOOL bCancel);
  42. virtual void
  43. OnCancel();
  44. virtual void
  45. OnOK();
  46. private:
  47. //DATA MEMBERS
  48. CSortListCtrl m_listCtrl;
  49. //List of objects to display. This is provided by
  50. //caller of dialog box.
  51. CList<CBaseAz*,CBaseAz*>& m_listAzObjectsToDisplay;
  52. //List of objects selected by uses. This is return to
  53. //user.
  54. CList<CBaseAz*,CBaseAz*>& m_listAzObjectsSelected;
  55. //Control Id for ListBox Control
  56. INT m_nIDListCtrl;
  57. UINT m_uiListCtrlFlags;
  58. };
  59. /******************************************************************************
  60. Class: CAddOperationDlg
  61. Purpose: Add Operation Dlg box
  62. ******************************************************************************/
  63. class CAddOperationDlg :public CBaseAddDialog
  64. {
  65. public:
  66. CAddOperationDlg(CList<CBaseAz*,CBaseAz*>& listAzObjectsToDisplay,
  67. CList<CBaseAz*,CBaseAz*>& listAzObjectsSelected);
  68. ~CAddOperationDlg();
  69. enum {IDD = IDD_ADD_OPERATION};
  70. private:
  71. DECLARE_MESSAGE_MAP()
  72. };
  73. /******************************************************************************
  74. Class: CAddTaskDlg
  75. Purpose: Add Task Dlg box
  76. ******************************************************************************/
  77. class CAddTaskDlg :public CBaseAddDialog
  78. {
  79. public:
  80. CAddTaskDlg(CList<CBaseAz*,CBaseAz*>& listAzObjectsToDisplay,
  81. CList<CBaseAz*,CBaseAz*>& listAzObjectsSelected,
  82. ULONG IDD_DIALOG);
  83. ~CAddTaskDlg();
  84. private:
  85. DECLARE_MESSAGE_MAP()
  86. };
  87. /******************************************************************************
  88. Class: CAddGroupDlg
  89. Purpose: Add Group Dlg box
  90. ******************************************************************************/
  91. class CAddGroupDlg :public CBaseAddDialog
  92. {
  93. public:
  94. CAddGroupDlg(CList<CBaseAz*,CBaseAz*>& listAzObjectsToDisplay,
  95. CList<CBaseAz*,CBaseAz*>& listAzObjectsSelected);
  96. ~CAddGroupDlg();
  97. enum {IDD = IDD_ADD_GROUP};
  98. private:
  99. DECLARE_MESSAGE_MAP()
  100. };
  101. //+----------------------------------------------------------------------------
  102. // Function:GetSelectedAzObjects
  103. // Synopsis:Display the add dlg box for eObjecType and return the objects
  104. // selected by user
  105. // Arguments:hwnd
  106. // eObjectType: Shows Add Dlg for this objecttype
  107. // pContainerAz:ContainerAz object from whose child objects are
  108. // shown
  109. // listObjectsSelected: Gets list of selected object types
  110. // Returns:
  111. //-----------------------------------------------------------------------------
  112. BOOL GetSelectedAzObjects(IN HWND hWnd,
  113. IN OBJECT_TYPE_AZ eObjectType,
  114. IN CContainerAz* pContainerAz,
  115. OUT CList<CBaseAz*,CBaseAz*>& listObjectsSelected);
  116. //+----------------------------------------------------------------------------
  117. // Function:GetSelectedTasks
  118. // Synopsis:Display the add dlg box for Tasks/RoleDefintions
  119. // and return the objects selected by user
  120. // Arguments:hwnd
  121. // bTaskIsRoleDefintion if True Display AddTask else Add Role Def.
  122. // pContainerAz:ContainerAz object from whose child objects are
  123. // shown
  124. // listObjectsSelected: Gets list of selected object types
  125. // Returns:
  126. //-----------------------------------------------------------------------------
  127. BOOL GetSelectedTasks(IN HWND hWnd,
  128. IN BOOL bTaskIsRoleDefintion,
  129. IN CContainerAz* pContainerAz,
  130. OUT CList<CBaseAz*,CBaseAz*>& listObjectsSelected);
  131. /******************************************************************************
  132. Class: CAddDefinition
  133. Purpose:Property Page for Add Definition Tab. Allows to add Role, Task or
  134. Operation
  135. ******************************************************************************/
  136. class CAddDefinition :public CPropertyPage
  137. {
  138. public:
  139. CAddDefinition(CList<CBaseAz*,CBaseAz*>& listAzObjectsSelected,
  140. ULONG IDD_DIALOG,
  141. IN CContainerAz* pContainerAz,
  142. IN OBJECT_TYPE_AZ eObjectType,
  143. IN BOOL bTaskIsRoleDefintion)
  144. :CPropertyPage(IDD_DIALOG),
  145. m_listCtrl(COL_NAME |COL_PARENT_TYPE|COL_DESCRIPTION,FALSE,Col_For_Add_Object,TRUE),
  146. m_listAzObjectsSelected(listAzObjectsSelected),
  147. m_pContainerAz(pContainerAz),
  148. m_eObjectType(eObjectType),
  149. m_bTaskIsRoleDefintion(bTaskIsRoleDefintion),
  150. m_iSortDirection(1),
  151. m_iLastColumnClick(0)
  152. {
  153. }
  154. virtual BOOL
  155. OnInitDialog();
  156. virtual void
  157. OnCancel();
  158. virtual void
  159. OnOK();
  160. private:
  161. void
  162. OnOkCancel(BOOL bCancel);
  163. DECLARE_MESSAGE_MAP()
  164. //DATA MEMBERS
  165. CSortListCtrl m_listCtrl;
  166. //List of objects selected by uses. This is return to
  167. //user.
  168. CList<CBaseAz*,CBaseAz*>& m_listAzObjectsSelected;
  169. //
  170. //Cotainer which contians objects to be selected
  171. //
  172. CContainerAz* m_pContainerAz;
  173. //
  174. //Type of the object to be selected
  175. //
  176. OBJECT_TYPE_AZ m_eObjectType;
  177. //
  178. //used if m_eObjectType == TASK_AZ. m_bTaskIsRoleDefintion is
  179. //true, display only Role Definitions
  180. //
  181. BOOL m_bTaskIsRoleDefintion;
  182. int m_iSortDirection;
  183. int m_iLastColumnClick;
  184. };
  185. //+----------------------------------------------------------------------------
  186. // Function:GetSelectedDefinitions
  187. // Synopsis:Display the dlg boxes for Tasks/RoleDefintions/Operations
  188. // and return the objects selected by user
  189. // Arguments:hwnd
  190. // bRoleDefintion if True Display Add Role dialog also.
  191. // pContainerAz:ContainerAz object from whose child objects are
  192. // shown
  193. // listObjectsSelected: Gets list of selected object types
  194. // Returns:
  195. //-----------------------------------------------------------------------------
  196. BOOL GetSelectedDefinitions(IN BOOL bAllowRoleDefinition,
  197. IN CContainerAz* pContainerAz,
  198. OUT CList<CBaseAz*,CBaseAz*>& listObjectsSelected);