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.

184 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1994-2000 Microsoft Corporation
  3. Module Name :
  4. inheritancedlg.h
  5. Abstract:
  6. Inheritance Dialog Definitions
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. #ifndef __INHERITANCEDLG__H__
  14. #define __INHERITANCEDLG__H__
  15. class CListBoxNodes : public CWindowImpl<CListBoxNodes, CListBox>
  16. {
  17. public:
  18. BEGIN_MSG_MAP(CListBoxNodes)
  19. END_MSG_MAP()
  20. };
  21. /*++
  22. Class Description:
  23. Inheritance override checker dialog.
  24. Public Interface:
  25. CInheritanceDlg : Constructor
  26. IsEmpty : Check to see if there are overrides.
  27. Notes:
  28. There are two constructors. One which assumes GetDataPaths() has
  29. already been called, and which takes the results from GetDataPaths()
  30. as a CStringList, and a second constructor which will make the GetDataPaths
  31. automatically.
  32. In either case, the calling process should check IsEmpty() right after
  33. constructing the dialog to see if DoModal() needs to be called. If
  34. IsEmpty() returns TRUE, there's no reason to call DoModal().
  35. --*/
  36. class CInheritanceDlg :
  37. public CDialogImpl<CInheritanceDlg>,
  38. public CWinDataExchange<CInheritanceDlg>
  39. {
  40. //
  41. // fWrite parameter helper definitions
  42. //
  43. #define FROM_WRITE_PROPERTY (TRUE)
  44. #define FROM_DELETE_PROPERTY (FALSE)
  45. //
  46. // Construction
  47. //
  48. public:
  49. CInheritanceDlg() :
  50. m_fWrite(FALSE), m_fEmpty(FALSE), m_fHasInstanceInMaster(FALSE), m_fUseTable(FALSE),
  51. m_dwMDIdentifier(0), m_dwMDAttributes(0), m_dwMDUserType(0), m_dwMDDataType(0),
  52. m_mk((CComAuthInfo *)NULL)
  53. {
  54. }
  55. //
  56. // Standard constructor (GetDataPaths() already called)
  57. //
  58. CInheritanceDlg(
  59. DWORD dwMetaID,
  60. BOOL fWrite,
  61. CComAuthInfo * pAuthInfo,
  62. LPCTSTR lpstrMetaRoot,
  63. CStringListEx & strlMetaChildNodes,
  64. LPCTSTR lpstrPropertyName = NULL,
  65. HWND hwndParent = NULL
  66. );
  67. //
  68. // Constructor which will call GetDataPaths()
  69. //
  70. CInheritanceDlg(
  71. DWORD dwMetaID,
  72. BOOL fWrite,
  73. CComAuthInfo * pAuthInfo,
  74. LPCTSTR lpstrMetaRoot,
  75. LPCTSTR lpstrPropertyName = NULL,
  76. HWND hwndParent = NULL
  77. );
  78. //
  79. // Constructor which will call GetDataPaths(), and which
  80. // does not use the predefined property table unless
  81. // fTryToFindInTable is TRUE, in which case it will attempt
  82. // to use the table first, and use the specified parameters
  83. // only if the property ID is not found in the table.
  84. //
  85. CInheritanceDlg(
  86. BOOL fTryToFindInTable,
  87. DWORD dwMDIdentifier,
  88. DWORD dwMDAttributes,
  89. DWORD dwMDUserType,
  90. DWORD dwMDDataType,
  91. LPCTSTR lpstrPropertyName,
  92. BOOL fWrite,
  93. CComAuthInfo * pAuthInfo,
  94. LPCTSTR lpstrMetaRoot,
  95. HWND hwndParent = NULL
  96. );
  97. public:
  98. enum { IDD = IDD_INHERITANCE };
  99. //
  100. // Check to see if there's a reason to continue displaying
  101. // the dialog.
  102. //
  103. BOOL IsEmpty() const { return m_fEmpty; }
  104. //
  105. // Dialog Data
  106. //
  107. protected:
  108. CListBoxNodes m_list_ChildNodes;
  109. //
  110. // Implementation
  111. //
  112. protected:
  113. BEGIN_MSG_MAP_EX(CInheritanceDlg)
  114. MSG_WM_INITDIALOG(OnInitDialog)
  115. COMMAND_HANDLER_EX(IDOK, BN_CLICKED, OnOK)
  116. COMMAND_HANDLER_EX(IDC_BUTTON_SELECT_ALL, BN_CLICKED, OnButtonSelectAll)
  117. END_MSG_MAP()
  118. LRESULT OnInitDialog(HWND hwnd, LPARAM lParam);
  119. void OnOK(WORD wNotifyCode, WORD wID, HWND hwndCtrl);
  120. void OnButtonSelectAll(WORD wNotifyCode, WORD wID, HWND hwndCtrl);
  121. BEGIN_DDX_MAP(CInheritanceDlg)
  122. DDX_CONTROL(IDC_LIST_CHILD_NODES, m_list_ChildNodes)
  123. END_DDX_MAP()
  124. void Initialize();
  125. HRESULT GetDataPaths();
  126. BOOL FriendlyInstance(
  127. IN CString & strMetaRoot,
  128. OUT CString & strFriendly
  129. );
  130. CString & CleanDescendantPath(
  131. IN OUT CString & strMetaPath
  132. );
  133. private:
  134. BOOL m_fWrite;
  135. BOOL m_fEmpty;
  136. BOOL m_fHasInstanceInMaster;
  137. BOOL m_fUseTable;
  138. DWORD m_dwMDIdentifier;
  139. DWORD m_dwMDAttributes;
  140. DWORD m_dwMDUserType;
  141. DWORD m_dwMDDataType;
  142. CString m_strMetaRoot;
  143. //CString m_strServer;
  144. CString m_strPropertyName;
  145. CStringListEx m_strlMetaChildNodes;
  146. CMetaKey m_mk;
  147. };
  148. #endif // __INHERITANCEDLG__H__