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.

106 lines
3.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1998
  6. //
  7. // File: gencreat.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /////////////////////////////////////////////////////////////////////
  11. // gencreat.h
  12. //
  13. // Class definition for the "Generic Create" wizard and other dialogs.
  14. //
  15. // HISTORY
  16. // 21-Aug-97 Dan Morin Creation.
  17. //
  18. /////////////////////////////////////////////////////////////////////
  19. /////////////////////////////////////////////////////////////////////
  20. // The following structure is to map a attribute syntax OID to
  21. // something that both the user and the developer better understand.
  22. struct SCHEMA_ATTR_SYNTAX_INFO
  23. {
  24. LPCTSTR pszSyntaxOID; // OID of the attribute syntax (eg: "2.5.5.6")
  25. UINT uStringIdDesc; // Resource Id describing the syntax OID. (eg: "Numerical String")
  26. VARTYPE vtEnum; // Datatype of the attribute syntax (eg: VT_BSTR, VT_I4, VT_BOOL )
  27. };
  28. const SCHEMA_ATTR_SYNTAX_INFO * PFindSchemaAttrSyntaxInfo(LPCTSTR pszAttrSyntaxOID);
  29. /////////////////////////////////////////////////////////////////////
  30. // The following is a node in a linked-list of mandatory
  31. // attributes to create a new object.
  32. class CMandatoryADsAttribute
  33. {
  34. public:
  35. CString m_strAttrName; // Name of the attribute (eg: "cn", "mail", "streetAddress" )
  36. CString m_strAttrDescription; // Description of attribute (eg: "Common Name", "Email Addresses", "Street Address")
  37. const SCHEMA_ATTR_SYNTAX_INFO * m_pSchemaAttrSyntaxInfo; // Pointer to the syntax info for the attribute.
  38. public:
  39. CComVariant m_varAttrValue; // OUT: Value of the attribute stored in a variant
  40. public:
  41. CMandatoryADsAttribute(
  42. LPCTSTR pszAttrName,
  43. LPCTSTR pszAttrDesc,
  44. LPCTSTR pszSyntaxOID)
  45. {
  46. m_strAttrName = pszAttrName;
  47. m_strAttrDescription = pszAttrDesc;
  48. m_pSchemaAttrSyntaxInfo = PFindSchemaAttrSyntaxInfo(pszSyntaxOID);
  49. ASSERT(m_pSchemaAttrSyntaxInfo != NULL);
  50. }
  51. ~CMandatoryADsAttribute()
  52. {
  53. }
  54. }; // CMandatoryADsAttribute
  55. class CMandatoryADsAttributeList :
  56. public CList< CMandatoryADsAttribute*, CMandatoryADsAttribute* >
  57. {
  58. public:
  59. ~CMandatoryADsAttributeList()
  60. {
  61. _RemoveAll();
  62. }
  63. private:
  64. void _RemoveAll()
  65. {
  66. while(!IsEmpty())
  67. delete RemoveHead();
  68. }
  69. };
  70. /////////////////////////////////////////////////////////////////////
  71. // The "Generic Create" wizard will build a list of attributes
  72. // and prompt the user to enter the value of the attribute.
  73. class CCreateNewObjectGenericWizard
  74. {
  75. friend class CGenericCreateWizPage;
  76. protected:
  77. CNewADsObjectCreateInfo * m_pNewADsObjectCreateInfo; // INOUT: Temporary storage to hold the attributes
  78. LPCTSTR m_pszObjectClass; // IN: Class of object to create.
  79. CPropertySheet * m_paPropertySheet; // Property sheet holding all the property pages
  80. int m_cMandatoryAttributes; // Number of attributes in the list
  81. CMandatoryADsAttributeList* m_paMandatoryAttributeList; // list of mandatory attributes
  82. public:
  83. CCreateNewObjectGenericWizard();
  84. ~CCreateNewObjectGenericWizard();
  85. BOOL FDoModal(INOUT CNewADsObjectCreateInfo * pNewADsObjectCreateInfo);
  86. protected:
  87. CGenericCreateWizPage** m_pPageArr;
  88. }; // CCreateNewObjectGenericWizard