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.

85 lines
2.7 KiB

  1. // ITPROPL.H: ITPropertyList interface declaration
  2. #ifndef __ITPROPL_H__
  3. #define __ITPROPL_H__
  4. #include <ocidl.h>
  5. // {1F403BB1-9997-11d0-A850-00AA006C7D01}
  6. DEFINE_GUID(IID_IITPropList,
  7. 0x1f403bb1, 0x9997, 0x11d0, 0xa8, 0x50, 0x0, 0xaa, 0x0, 0x6c, 0x7d, 0x1);
  8. // {4662daae-d393-11d0-9a56-00c04fb68bf7} (changed from IT 3.0)
  9. DEFINE_GUID(CLSID_IITPropList,
  10. 0x4662daae, 0xd393, 0x11d0, 0x9a, 0x56, 0x00, 0xc0, 0x4f, 0xb6, 0x8b, 0xf7);
  11. typedef DWORD PROPID;
  12. // Operations you can do on a property
  13. #define PROP_ADD 0x00000000
  14. #define PROP_DELETE 0x00000001
  15. #define PROP_UPDATE 0x00000002
  16. // Type of data
  17. #define TYPE_VALUE 0x00000000
  18. #define TYPE_POINTER 0x00000001
  19. #define TYPE_STRING 0x00000002
  20. // Class definition of CProperty
  21. class CProperty
  22. {
  23. public:
  24. PROPID dwPropID; // property ID
  25. DWORD cbData; // Amount of data
  26. DWORD dwType; // What type this is
  27. union
  28. {
  29. LPWSTR lpszwData; // String
  30. LPVOID lpvData; // Any kind of data
  31. DWORD dwValue; // Numerical data
  32. };
  33. BOOL fPersist; // TRUE to persist this property
  34. };
  35. typedef CProperty* LPPROP;
  36. // Interface def. for IITPropList
  37. DECLARE_INTERFACE_(IITPropList, IPersistStreamInit)
  38. {
  39. // dwOperation = operation (add, delete, update, etc.) to perform on property list
  40. STDMETHOD(Set)(PROPID PropID, DWORD dwData, DWORD dwOperation) PURE;
  41. STDMETHOD(Set)(PROPID PropID, LPVOID lpvData, DWORD cbData, DWORD dwOperation) PURE;
  42. STDMETHOD(Set)(PROPID PropID, LPCWSTR lpszwString, DWORD dwOperation) PURE;
  43. STDMETHOD(Add)(CProperty& Prop) PURE;
  44. STDMETHOD(Get)(PROPID PropID, CProperty& Property) PURE;
  45. STDMETHOD(Clear)() PURE;
  46. // set persistence state on property
  47. STDMETHOD(SetPersist)(PROPID PropID, BOOL fPersist) PURE; // single property
  48. STDMETHOD(SetPersist)(BOOL fPersist) PURE; // all properties in list
  49. // for enumerating properties
  50. STDMETHOD(GetFirst)(CProperty& Property) PURE;
  51. STDMETHOD(GetNext)(CProperty& Property) PURE;
  52. STDMETHOD(GetPropCount)(LONG &cProp) PURE;
  53. // persist header and data separately
  54. STDMETHOD(SaveHeader)(LPVOID lpvData, DWORD dwHdrSize) PURE;
  55. STDMETHOD(SaveData)(LPVOID lpvHeader, DWORD dwHdrSize, LPVOID lpvData, DWORD dwBufSize) PURE;
  56. STDMETHOD(GetHeaderSize)(DWORD& dwHdrSize) PURE;
  57. STDMETHOD(GetDataSize)(LPVOID lpvHeader, DWORD dwHdrSize, DWORD& dwDataSize) PURE;
  58. STDMETHOD(SaveDataToStream)(LPVOID lpvHeader, DWORD dwHdrSize, IStream* pStream) PURE;
  59. // persist to a memory buffer
  60. STDMETHOD(LoadFromMem)(LPVOID lpvData, DWORD dwBufSize) PURE;
  61. STDMETHOD(SaveToMem)(LPVOID lpvData, DWORD dwBufSize) PURE;
  62. };
  63. typedef IITPropList* LPITPROPLIST;
  64. #endif // __ITPROPL_H__