ProcessPaste.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // ProcessPaste.h: interface for the CProcessCopy class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_PROCESSPASTE_H__185CBB6F_4B63_4397_8FF9_E18D777DA506__INCLUDED_)
  5. #define AFX_PROCESSPASTE_H__185CBB6F_4B63_4397_8FF9_E18D777DA506__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "ArrayEx.h"
  10. #include "ProcessCopy.h"
  11. // Sets lID's lDate to GetCurrentTime() and updates paste stats
  12. BOOL MarkClipAsPasted(long lID);
  13. /*------------------------------------------------------------------*\
  14. CClipIDs - an array of Clip IDs
  15. \*------------------------------------------------------------------*/
  16. class CClipIDs : public ARRAY
  17. {
  18. public:
  19. // PASTING FUNCTIONS
  20. // allocate an HGLOBAL of the given Format Type representing the Clip IDs in this array.
  21. HGLOBAL Render( UINT cfType );
  22. // Fills "types" with the Format Types corresponding to the Clip IDs in this array.
  23. void GetTypes( CClipTypes& types );
  24. // Aggregates the cfType Format Data of the Clip IDs in this array, assuming
  25. // each Format is NULL terminated and placing pSeparator between them.
  26. CString AggregateText( UINT cfType, char* pSeparator );
  27. };
  28. /*------------------------------------------------------------------*\
  29. COleClipSource
  30. \*------------------------------------------------------------------*/
  31. class COleClipSource : public COleDataSource
  32. {
  33. DECLARE_DYNAMIC(COleClipSource)
  34. public:
  35. CClipIDs m_ClipIDs;
  36. COleClipSource();
  37. virtual ~COleClipSource();
  38. BOOL DoDelayRender();
  39. BOOL DoImmediateRender();
  40. protected:
  41. DECLARE_MESSAGE_MAP()
  42. public:
  43. virtual BOOL OnRenderGlobalData(LPFORMATETC lpFormatEtc, HGLOBAL* phGlobal);
  44. };
  45. /*------------------------------------------------------------------*\
  46. CProcessPaste
  47. \*------------------------------------------------------------------*/
  48. class CProcessPaste
  49. {
  50. public:
  51. // true if we should delete m_pOle,
  52. // false if it will be automatically deleted
  53. bool m_bDeleteOle;
  54. COleClipSource* m_pOle;
  55. CProcessPaste();
  56. ~CProcessPaste();
  57. CClipIDs& GetClipIDs() { return m_pOle->m_ClipIDs; }
  58. BOOL DoPaste();
  59. BOOL DoDrag();
  60. void MarkAsPasted();
  61. };
  62. #endif // !defined(AFX_PROCESSPASTE_H__185CBB6F_4B63_4397_8FF9_E18D777DA506__INCLUDED_)