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.

127 lines
3.7 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // sdodictionary.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Declares the class SdoDictionary.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 03/01/1999 Original version.
  16. // 04/17/2000 Port to new dictionary API.
  17. //
  18. ///////////////////////////////////////////////////////////////////////////////
  19. #ifndef SDODICTIONARY_H
  20. #define SDODICTIONARY_H
  21. #if _MSC_VER >= 1000
  22. #pragma once
  23. #endif
  24. class AttributeDefinition;
  25. ///////////////////////////////////////////////////////////////////////////////
  26. //
  27. // CLASS
  28. //
  29. // SdoDictionary
  30. //
  31. // DESCRIPTION
  32. //
  33. // Implements the ISdoDictionaryOld interface.
  34. //
  35. ///////////////////////////////////////////////////////////////////////////////
  36. class SdoDictionary
  37. : public IDispatchImpl< ISdoDictionaryOld,
  38. &__uuidof(ISdoDictionaryOld),
  39. &LIBID_SDOIASLib
  40. >,
  41. public IDispatchImpl< ISdo,
  42. &__uuidof(ISdo),
  43. &LIBID_SDOIASLib
  44. >
  45. {
  46. public:
  47. // Create a new dictionary.
  48. static HRESULT createInstance(
  49. PCWSTR path,
  50. bool local,
  51. SdoDictionary** newDnary
  52. ) throw ();
  53. // Retrieve AttributeDefinition's by various keys.
  54. const AttributeDefinition* findById(ULONG id) const throw ();
  55. const AttributeDefinition* findByName(PCWSTR name) const throw ();
  56. const AttributeDefinition* findByLdapName(PCWSTR ldapName) const throw ();
  57. //////////
  58. // IUnknown
  59. //////////
  60. STDMETHOD_(ULONG, AddRef)();
  61. STDMETHOD_(ULONG, Release)();
  62. STDMETHOD(QueryInterface)(REFIID iid, void ** ppvObject);
  63. //////////
  64. // ISdoDictionaryOld
  65. //////////
  66. STDMETHOD(EnumAttributes)(
  67. VARIANT* Id,
  68. VARIANT* pValues
  69. );
  70. STDMETHOD(GetAttributeInfo)(
  71. ATTRIBUTEID Id,
  72. VARIANT* pInfoIDs,
  73. VARIANT* pInfoValues
  74. );
  75. STDMETHOD(EnumAttributeValues)(
  76. ATTRIBUTEID Id,
  77. VARIANT* pValueIds,
  78. VARIANT* pValuesDesc
  79. );
  80. STDMETHOD(CreateAttribute)(
  81. ATTRIBUTEID Id,
  82. IDispatch** ppAttributeObject
  83. );
  84. STDMETHOD(GetAttributeID)(
  85. BSTR bstrAttributeName,
  86. ATTRIBUTEID* pId
  87. );
  88. //////////
  89. // ISdo
  90. //////////
  91. STDMETHOD(GetPropertyInfo)(LONG Id, IUnknown** ppPropertyInfo);
  92. STDMETHOD(GetProperty)(LONG Id, VARIANT* pValue);
  93. STDMETHOD(PutProperty)(LONG Id, VARIANT* pValue);
  94. STDMETHOD(ResetProperty)(LONG Id);
  95. STDMETHOD(Apply)();
  96. STDMETHOD(Restore)();
  97. STDMETHOD(get__NewEnum)(IUnknown** ppEnumVARIANT);
  98. protected:
  99. SdoDictionary() throw ();
  100. ~SdoDictionary() throw ();
  101. // Initialize the dictionary from the specified data source.
  102. HRESULT initialize(PCWSTR dsn, bool local) throw ();
  103. private:
  104. LONG refCount; // Reference count.
  105. PWSTR dnaryLoc; // Location of the dictionary.
  106. ULONG size; // Number of definitions.
  107. const AttributeDefinition** byId; // Sorted by ID.
  108. const AttributeDefinition** byName; // Sorted by Name.
  109. const AttributeDefinition** byLdapName; // Sorted by LDAP Name.
  110. // Not implemented.
  111. SdoDictionary(const SdoDictionary&);
  112. SdoDictionary& operator=(const SdoDictionary&);
  113. };
  114. #endif // SDODICTIONARY_H