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.

58 lines
2.3 KiB

  1. #ifndef _IMAGPROP_H_
  2. #define _IMAGPROP_H_
  3. typedef void (*FNPROPCHANGE)(IShellImageData *, SHCOLUMNID*);
  4. //
  5. // CImagePropSet defines an IPropertyStorage
  6. // implementation for image files. The properties are backed by GDI+ interfaces.
  7. //
  8. class CImagePropSet : public IPropertyStorage
  9. {
  10. public:
  11. CImagePropSet(Image *pimg, IShellImageData *pData, IPropertyStorage *pps, REFFMTID fmtid, FNPROPCHANGE fnCallback=NULL);
  12. HRESULT SyncImagePropsToStorage();
  13. void SaveProps(Image *pImage, CDSA<SHCOLUMNID> *pdsaChanges);
  14. // IUnknown
  15. STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
  16. STDMETHOD_(ULONG, AddRef)();
  17. STDMETHOD_(ULONG, Release)();
  18. // IPropertyStorage methods
  19. STDMETHODIMP ReadMultiple(ULONG cpspec, const PROPSPEC rgpspec[], PROPVARIANT rgvar[]);
  20. STDMETHODIMP WriteMultiple(ULONG cpspec, const PROPSPEC rgpspec[], const PROPVARIANT rgvar[], PROPID propidNameFirst);
  21. STDMETHODIMP DeleteMultiple(ULONG cpspec, const PROPSPEC rgpspec[]);
  22. STDMETHODIMP ReadPropertyNames(ULONG cpropid, const PROPID rgpropid[], LPOLESTR rglpwstrName[]);
  23. STDMETHODIMP WritePropertyNames(ULONG cpropid, const PROPID rgpropid[], const LPOLESTR rglpwstrName[]);
  24. STDMETHODIMP DeletePropertyNames(ULONG cpropid, const PROPID rgpropid[]);
  25. STDMETHODIMP SetClass(REFCLSID clsid);
  26. STDMETHODIMP Commit(DWORD grfCommitFlags);
  27. STDMETHODIMP Revert();
  28. STDMETHODIMP Enum(IEnumSTATPROPSTG** ppenm);
  29. STDMETHODIMP Stat(STATPROPSETSTG* pstatpsstg);
  30. STDMETHODIMP SetTimes(const FILETIME* pmtime, const FILETIME* pctime, const FILETIME* patime);
  31. private:
  32. ~CImagePropSet();
  33. void _PopulatePropStorage();
  34. HRESULT _PropVarToImgProp(PROPID pid, const PROPVARIANT *pvar, PropertyItem *pprop, BOOL bUnicode);
  35. HRESULT _PropImgToPropvar(PropertyItem *pi, PROPVARIANT *pvar, BOOL bUnicode);
  36. HRESULT _MapPropidToImgPropid(PROPID propid, PROPID *ppid, PROPID *pidUnicode);
  37. HRESULT _MapImgPropidToPropid(PROPID propid, PROPID *ppid, BOOL *pbUnicode);
  38. HRESULT _GetImageSummaryProps(ULONG cpspec, const PROPSPEC rgpspec[], PROPVARIANT rgvar[]);
  39. LONG _cRef;
  40. Image *_pimg;
  41. IShellImageData *_pData; // addref this guy so our Image isn't deleted behind our back
  42. IPropertyStorage *_ppsImg;
  43. BOOL _fDirty;
  44. FMTID _fmtid;
  45. FNPROPCHANGE _fnPropChanged;
  46. BOOL _fEditable;
  47. };
  48. #endif