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.

105 lines
2.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: propmap.hxx
  7. //
  8. // Contents: An implementation for IPropertyMapper interface based
  9. // on the CPidLookTable class.
  10. //
  11. // Classes: CFwPropertyMapper
  12. //
  13. // History: 12-11-96 srikants Created
  14. //
  15. //----------------------------------------------------------------------------
  16. #pragma once
  17. #include <ciintf.h>
  18. #include <pidtable.hxx>
  19. #include <spropmap.hxx>
  20. class CPidLookupTable;
  21. class CFwPropertyMapper : public IPropertyMapper
  22. {
  23. public:
  24. CFwPropertyMapper( CPidLookupTable & pidTable,
  25. BOOL fMapStdOnly,
  26. BOOL fOwnIt = FALSE ) :
  27. _refCount(1),
  28. _pPidTable(0),
  29. _fOwned(fOwnIt),
  30. _fMapStdOnly( fMapStdOnly ),
  31. _papsShortLived( 0 ),
  32. _pidNextAvailable( INIT_DOWNLEVEL_PID ),
  33. _cps( 0 )
  34. {
  35. //
  36. // No concept of a pidtable to map only std
  37. // and Ole properties (for null catalog).
  38. // We will store any requested properties
  39. // (Ole properties that are stored as part of
  40. // the documents themselves), for the purpose of
  41. // pid mapping, in _papsShortLived which is an
  42. // in memory structure and will go away along
  43. // with the catalog (not persistent).
  44. //
  45. if (!_fMapStdOnly)
  46. _pPidTable = &pidTable;
  47. else
  48. _papsShortLived = new CPropSpecArray;
  49. }
  50. ~CFwPropertyMapper();
  51. //
  52. // IUnknown methods.
  53. //
  54. STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppiuk );
  55. STDMETHOD_(ULONG, AddRef) (THIS);
  56. STDMETHOD_(ULONG, Release) (THIS);
  57. //
  58. // IPropertyMapper methods
  59. //
  60. STDMETHOD(PropertyToPropid) (
  61. const FULLPROPSPEC *pFullPropSpec,
  62. BOOL fCreate,
  63. PROPID *pPropId );
  64. STDMETHOD(PropidToProperty) (
  65. PROPID propId,
  66. FULLPROPSPEC ** ppPropSpec)
  67. {
  68. Win4Assert( !"Not Yet Implemented" );
  69. return E_NOTIMPL;
  70. }
  71. private:
  72. long _refCount;
  73. BOOL _fOwned;
  74. BOOL _fMapStdOnly;
  75. CPidLookupTable * _pPidTable;
  76. CStandardPropMapper _propMapper;
  77. //
  78. // Support for null catalog. Enable
  79. // propspecs to be stored in memory.
  80. //
  81. PROPID LocateOrAddProperty(CFullPropSpec const & ps);
  82. PROPID _pidNextAvailable; // Next available pid
  83. CPropSpecArray * _papsShortLived; // This is not persistent
  84. ULONG _cps; // # of elements in _papsShortLived
  85. };