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.

100 lines
2.7 KiB

  1. //
  2. // rngsink.h
  3. //
  4. #ifndef RNGSINK_H
  5. #define RNGSINK_H
  6. #include "tfprop.h"
  7. #define BUF_SIZE 16
  8. #define TF_PT_PROXY ((TfPropertyType)-1) // private property type used for CPropStoreProxy data
  9. extern const IID IID_CGeneralPropStore;
  10. class CGeneralPropStore : public ITfPropertyStore,
  11. public CComObjectRootImmx
  12. {
  13. public:
  14. CGeneralPropStore()
  15. {
  16. Dbg_MemSetThisNameID(TEXT("CGeneralPropStore"));
  17. }
  18. ~CGeneralPropStore();
  19. BOOL _Init(TfGuidAtom guidatom, const VARIANT *pvarValue, DWORD dwPropFlags);
  20. BOOL _Init(TfGuidAtom guidatom, int iDataSize, TfPropertyType type, IStream *pStream, DWORD dwPropFlags);
  21. BEGIN_COM_MAP_IMMX(CGeneralPropStore)
  22. COM_INTERFACE_ENTRY_IID(IID_CGeneralPropStore, CGeneralPropStore)
  23. COM_INTERFACE_ENTRY(ITfPropertyStore)
  24. END_COM_MAP_IMMX()
  25. IMMX_OBJECT_IUNKNOWN_FOR_ATL()
  26. //
  27. // ITfPropertyStore
  28. //
  29. STDMETHODIMP GetType(GUID *pguid);
  30. STDMETHODIMP GetDataType(DWORD *pdwReserved);
  31. STDMETHODIMP GetData(VARIANT *pvarValue);
  32. STDMETHODIMP OnTextUpdated(DWORD dwFlags, ITfRange *pRange, BOOL *pfAccept);
  33. STDMETHODIMP Shrink(ITfRange *pRange, BOOL *pfFree);
  34. STDMETHODIMP Divide(ITfRange *pRangeThis, ITfRange *pRangeNew, ITfPropertyStore **ppPropStore);
  35. STDMETHODIMP Clone(ITfPropertyStore **ppPropStore);
  36. STDMETHODIMP GetPropertyRangeCreator(CLSID *pclsid);
  37. STDMETHODIMP Serialize(IStream *pStream, ULONG *pcb);
  38. protected:
  39. BOOL _Init(TfGuidAtom guidatom, TFPROPERTY *ptfp, DWORD dwPropFlags);
  40. TFPROPERTY _prop;
  41. DWORD _dwPropFlags;
  42. TfGuidAtom _guidatom;
  43. DBG_ID_DECLARE;
  44. };
  45. class CPropStoreProxy : public CGeneralPropStore
  46. {
  47. public:
  48. CPropStoreProxy()
  49. {
  50. Dbg_MemSetThisNameID(TEXT("CPropStoreProxy"));
  51. }
  52. BOOL _Init(const CLSID *pclsidTIP, TfGuidAtom guidatom, int iDataSize, IStream *pStream, DWORD dwPropFlags);
  53. //
  54. // ITfPropertyStore
  55. //
  56. STDMETHODIMP GetPropertyRangeCreator(CLSID *pclsid);
  57. STDMETHODIMP Clone(ITfPropertyStore **ppPropStore);
  58. private:
  59. BOOL _Init(const CLSID *pclsidTIP, TfGuidAtom guidatom, TFPROPERTY *ptfp, DWORD dwPropFlags);
  60. CLSID _clsidTIP;
  61. };
  62. class CStaticPropStore : public CGeneralPropStore
  63. {
  64. public:
  65. CStaticPropStore()
  66. {
  67. Dbg_MemSetThisNameID(TEXT("CStaticPropStore"));
  68. }
  69. //
  70. // ITfPropertyStore
  71. //
  72. STDMETHODIMP Shrink(ITfRange *pRange, BOOL *pfFree);
  73. STDMETHODIMP Divide(ITfRange *pRangeThis, ITfRange *pRangeNew, ITfPropertyStore **ppPropStore);
  74. STDMETHODIMP Clone(ITfPropertyStore **ppPropStore);
  75. private:
  76. DBG_ID_DECLARE;
  77. };
  78. #endif // RNGSINK_H