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.

133 lines
3.9 KiB

  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright(C) 1998-1999 Microsoft Corporation all rights reserved.
  4. //
  5. // Module: propertybag.h
  6. //
  7. // Project: Chameleon
  8. //
  9. // Description: Property bag classes definitions
  10. //
  11. // Author: TLP
  12. //
  13. // When Who What
  14. // ---- --- ----
  15. // 12/3/98 TLP Original version
  16. //
  17. ///////////////////////////////////////////////////////////////////////////
  18. #ifndef __INC_PROPERTY_BAG_H_
  19. #define __INC_PROPERTY_BAG_H_
  20. #include "basedefs.h"
  21. #include "locationinfo.h"
  22. class CPropertyBag; // forward declaraion
  23. typedef CHandle<CPropertyBag> PPROPERTYBAG;
  24. typedef CMasterPtr<CPropertyBag> MPPROPERTYBAG;
  25. ///////////////////////////////////////////////////////////////////////////
  26. // CPropertyBagContainer
  27. //
  28. class CPropertyBagContainer
  29. {
  30. public:
  31. virtual ~CPropertyBagContainer() { }
  32. // Open the container
  33. virtual bool open(void) = 0;
  34. // Close the container
  35. virtual void close(void) = 0;
  36. // Get the container's location information
  37. virtual void getLocation(CLocationInfo& location) = 0;
  38. // Get the name of the container
  39. virtual LPCWSTR getName(void) = 0;
  40. // Get the number of objects in the container
  41. virtual DWORD count(void) = 0;
  42. // Create a new object and add it to the container
  43. virtual PPROPERTYBAG add(LPCWSTR pszName) = 0;
  44. // Remove the specified object from the container
  45. virtual bool remove(LPCWSTR pszName) = 0;
  46. // Find the specified object in the container
  47. virtual PPROPERTYBAG find(LPCWSTR pszName) = 0;
  48. // Reset the iterator to the start of the container
  49. virtual bool reset(void) = 0;
  50. // Get the item at the current iterator position
  51. virtual PPROPERTYBAG current(void) = 0;
  52. // Move the iterator to the next poisition in the container
  53. virtual bool next(void) = 0;
  54. };
  55. typedef CMasterPtr<CPropertyBagContainer> MPPROPERTYBAGCONTAINER;
  56. typedef CHandle<CPropertyBagContainer> PPROPERTYBAGCONTAINER;
  57. ///////////////////////////////////////////////////////////////////////////
  58. // CPropertyBag
  59. //
  60. class CPropertyBag
  61. {
  62. public:
  63. virtual ~CPropertyBag() { }
  64. // Open the bag
  65. virtual bool open(void) = 0;
  66. // Close the bag
  67. virtual void close(void) = 0;
  68. // Get the bag's location information
  69. virtual void getLocation(CLocationInfo& location) = 0;
  70. // Get the name of the bag
  71. virtual LPCWSTR getName(void) = 0;
  72. // Ask the bag to load its properties from the underlying persistent store
  73. virtual bool load(void) = 0;
  74. // Ask the bag to save its properties to the underlying persistent store
  75. virtual bool save(void) = 0;
  76. // Determine if the bag is a container of other bags
  77. virtual bool IsContainer() = 0;
  78. // Get the bags container object (container of subobjects)
  79. virtual PPROPERTYBAGCONTAINER getContainer(void) = 0;
  80. // Determine if a property is in the bag
  81. virtual bool IsProperty(LPCWSTR pszPropertyName) = 0;
  82. // Get the value for a specified property
  83. virtual bool get(LPCWSTR pszPropertyName, VARIANT* pValue) = 0;
  84. // Set the value for a specified property
  85. virtual bool put(LPCWSTR pszPropertyName, VARIANT* pValue) = 0;
  86. // Reset the property bag iterator to the first property in the bag
  87. virtual bool reset(void) = 0;
  88. // Get the length of the longest property name
  89. virtual DWORD getMaxPropertyName(void) = 0;
  90. // Get the value at the current property bag iterator
  91. virtual bool current(LPWSTR pszPropertyName, VARIANT* pValue) = 0;
  92. // Move the property bag iterator to the next property position
  93. virtual bool next(void) = 0;
  94. };
  95. #endif // __INC_PROPERTY_BAG_H