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.

95 lines
2.3 KiB

  1. /*
  2. * _DTE.H
  3. *
  4. * Purpose:
  5. * Interface declaration for IDataTransferEngine
  6. * there is typically one data transfer engine per
  7. * CTxtEdit instance
  8. *
  9. * Author:
  10. * alexgo 3/25/95
  11. *
  12. * NB! THIS FILE IS NOW OBSOLETE
  13. */
  14. #ifndef __DTE_H__
  15. #define __DTE_H__
  16. #include "_m_undo.h"
  17. class CTxtRange;
  18. class CTxtEdit;
  19. /*
  20. * DataObjectInfo
  21. *
  22. * Purpose:
  23. * enumeration of bit flags used to indicate what operations
  24. * are possible from a given data object.
  25. */
  26. typedef enum tagDataObjectInfo
  27. {
  28. DOI_NONE = 0,
  29. DOI_CANUSETOM = 1, // TOM<-->TOM optimized data transfers
  30. DOI_CANPASTEPLAIN = 2, // plain text pasting available
  31. DOI_CANPASTERICH = 4, // rich text pasting available
  32. DOI_CANPASTEOLE = 8, // object may be pasted as an OLE embedding
  33. // (note that this flag may be combined with
  34. // others).
  35. } DataObjectInfo;
  36. /*
  37. * IDataTransferEngine
  38. *
  39. * Purpose:
  40. * provides clipboard, drag drop, and data object data transfer
  41. * capabilities. Each implementation will provide a different
  42. * level of functionality (e.g. OLE vs no-OLE)
  43. */
  44. class IDataTransferEngine
  45. {
  46. public:
  47. // memory mgmt
  48. virtual void Destroy() = 0;
  49. // clipboard operations
  50. virtual HRESULT CopyRangeToClipboard( CTxtRange *prg ) = 0;
  51. virtual HRESULT CutRangeToClipboard( CTxtRange *prg,
  52. IUndoBuilder *publdr ) = 0;
  53. virtual HRESULT PasteClipboardToRange( CTxtRange *prg,
  54. IUndoBuilder *publdr ) = 0;
  55. virtual BOOL CanPaste( CTxtRange *prg, CLIPFORMAT cf) = 0;
  56. // data object operations
  57. virtual HRESULT RangeToDataObject( CTxtRange *prg, LONG lStreamFormat,
  58. IDataObject **ppdo) = 0;
  59. virtual HRESULT PasteDataObjectToRange( IDataObject *pdo,
  60. CTxtRange *prg, IUndoBuilder *publdr) = 0;
  61. virtual HRESULT GetDataObjectInfo( IDataObject *pdo, DWORD *pDOIFlags ) = 0;
  62. // drag drop operations
  63. virtual HRESULT GetDropTarget( IDropTarget **ppDropTarget ) = 0;
  64. virtual HRESULT StartDrag( CTxtRange *prg, IUndoBuilder *publdr) = 0;
  65. // file i/o
  66. virtual LONG LoadFromEs( CTxtRange *prg, LONG lStreamFormat,
  67. EDITSTREAM *pes, IUndoBuilder *publdr) = 0;
  68. virtual LONG SaveToEs( CTxtRange *prg, LONG lStreamFormat,
  69. EDITSTREAM *pes ) = 0;
  70. // converstion routines
  71. virtual HGLOBAL AnsiPlainTextFromRange( CTxtRange *prg ) = 0;
  72. virtual HGLOBAL UnicodePlainTextFromRange( CTxtRange *prg ) = 0;
  73. };
  74. #endif // !__DTE_H__