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.

97 lines
4.0 KiB

  1. //
  2. // Copyright 2001 - Microsoft Corporation
  3. //
  4. //
  5. // Created By:
  6. // Geoff Pease (GPease) 23-JAN-2001
  7. //
  8. // Maintained By:
  9. // Geoff Pease (GPease) 23-JAN-2001
  10. //
  11. #pragma once
  12. static enum PROPTREE_IMAGE_INDEX
  13. {
  14. PTI_NULL = 0
  15. , PTI_PROP_READONLY = 3
  16. , PTI_PROP_READWRITE = 4
  17. , PTI_MULTIPROP_READONLY = 5
  18. , PTI_MULTIPROP_READWRITE = 6
  19. };
  20. class
  21. CPropertyCacheItem
  22. {
  23. private: // data
  24. CPropertyCacheItem * _pNext; // pointer to next property - CPropertyCache is responsible for freeing this member.
  25. BOOL _fReadOnly:1; // has this property been forced read-only?
  26. BOOL _fDirty:1; // is the property value dirty?
  27. BOOL _fMultiple:1; // does the property have mutliple values? (when mutliple docs are selected)
  28. FMTID _fmtid; // format id
  29. PROPID _propid; // property id
  30. VARTYPE _vt; // variant type
  31. UINT _uCodePage; // language code page of the property value
  32. PROPVARIANT _propvar; // cache property value
  33. ULONG _idxDefProp; // index into g_rgDefPropertyItems - if 0xFFFFFFFF, then the valid is invalid
  34. IPropertyUI * _ppui; // shell's property UI helper.
  35. WCHAR _wszTitle[ MAX_PATH ]; // property title - initialized when GetPropertyTitle() is called.
  36. WCHAR _wszDesc[ MAX_PATH ]; // property description - initialized when GetPropertyDescription() is called.
  37. WCHAR _wszValue[ MAX_PATH ]; // property value as a string - initialized when GetPropertyStringValue() is called.
  38. WCHAR _wszHelpFile[ MAX_PATH ]; // property's help file - initialized when GetPropertyHelpInfo() is called.
  39. DEFVAL * _pDefVals; // property state string table - initialized when GetStateStrings() is called.
  40. static WCHAR _szMultipleString[ MAX_PATH ]; // String to display when multiple values have been found for the same property.
  41. private: // methods
  42. explicit CPropertyCacheItem( void );
  43. ~CPropertyCacheItem( void );
  44. HRESULT
  45. Init( void );
  46. HRESULT
  47. FindDefPropertyIndex( void );
  48. void
  49. EnsureMultipleStringLoaded( void );
  50. public: // methods
  51. static HRESULT
  52. CreateInstance( CPropertyCacheItem ** ppItemOut );
  53. STDMETHOD( Destroy )( void );
  54. STDMETHOD( SetPropertyUIHelper )( IPropertyUI * ppuiIn );
  55. STDMETHOD( GetPropertyUIHelper )( IPropertyUI ** pppuiOut );
  56. STDMETHOD( SetNextItem )( CPropertyCacheItem * pNextIn );
  57. STDMETHOD( GetNextItem )( CPropertyCacheItem ** pNextOut );
  58. STDMETHOD( SetFmtId )( const FMTID * pFmtIdIn );
  59. STDMETHOD( GetFmtId )( FMTID * pfmtidOut );
  60. STDMETHOD( SetPropId )( PROPID propidIn );
  61. STDMETHOD( GetPropId )( PROPID * ppropidOut );
  62. STDMETHOD( SetDefaultVarType )( VARTYPE vtIn );
  63. STDMETHOD( GetDefaultVarType )( VARTYPE * pvtOut );
  64. STDMETHOD( SetCodePage )( UINT uCodePageIn );
  65. STDMETHOD( GetCodePage )( UINT * puCodePageOut );
  66. STDMETHOD( MarkDirty )( void );
  67. STDMETHOD( IsDirty )( void );
  68. STDMETHOD( MarkReadOnly )( void );
  69. STDMETHOD( MarkMultiple )( void );
  70. STDMETHOD( GetPropertyValue )( PROPVARIANT ** ppvarOut );
  71. STDMETHOD( GetPropertyTitle )( LPCWSTR * ppwszOut );
  72. STDMETHOD( GetPropertyDescription )( LPCWSTR * ppwszOut );
  73. STDMETHOD( GetPropertyHelpInfo )( LPCWSTR * ppwszFileOut, UINT * puHelpIDOut );
  74. STDMETHOD( GetPropertyStringValue )( LPCWSTR * ppwszOut );
  75. STDMETHOD( GetImageIndex )( int * piImageOut );
  76. STDMETHOD( GetPFID )( const PFID ** ppPFIDOut );
  77. STDMETHOD( GetControlCLSID )( CLSID * pclsidOut );
  78. STDMETHOD( GetStateStrings )( DEFVAL ** ppDefValOut );
  79. };