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.

97 lines
2.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-1999.
  5. //
  6. // File: dataobj.h
  7. //
  8. // Contents: CCertTemplatesDataObject
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef __DATAOBJ_H_INCLUDED__
  12. #define __DATAOBJ_H_INCLUDED__
  13. // For use in multiple selection.
  14. LPDATAOBJECT ExtractMultiSelect (LPDATAOBJECT lpDataObject);
  15. class CCertTemplatesDataObject : public CDataObject
  16. {
  17. DECLARE_NOT_AGGREGATABLE(CCertTemplatesDataObject)
  18. public:
  19. // debug refcount
  20. #if DBG==1
  21. ULONG InternalAddRef()
  22. {
  23. return CComObjectRoot::InternalAddRef();
  24. }
  25. ULONG InternalRelease()
  26. {
  27. return CComObjectRoot::InternalRelease();
  28. }
  29. int dbg_InstID;
  30. #endif // DBG==1
  31. CCertTemplatesDataObject();
  32. virtual ~CCertTemplatesDataObject();
  33. STDMETHODIMP Next(ULONG celt, MMC_COOKIE* rgelt, ULONG *pceltFetched);
  34. STDMETHODIMP Skip(ULONG celt);
  35. STDMETHODIMP Reset(void);
  36. void AddCookie(CCertTmplCookie* pCookie);
  37. virtual HRESULT Initialize (
  38. CCertTmplCookie* pcookie,
  39. DATA_OBJECT_TYPES type,
  40. CCertTmplComponentData& refComponentData);
  41. // IDataObject interface implementation
  42. HRESULT STDMETHODCALLTYPE GetDataHere(
  43. FORMATETC __RPC_FAR *pFormatEtcIn,
  44. STGMEDIUM __RPC_FAR *pMedium);
  45. void SetMultiSelData(BYTE* pbMultiSelData, UINT cbMultiSelData);
  46. STDMETHODIMP GetData(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium);
  47. STDMETHOD(IsMultiSelect)(void)
  48. {
  49. return (m_rgCookies.GetSize() > 1) ? S_OK : S_FALSE;
  50. }
  51. protected:
  52. HRESULT PutDisplayName(STGMEDIUM* pMedium);
  53. HRESULT CreateMultiSelectObject(LPSTGMEDIUM lpMedium);
  54. HRESULT Create (const void* pBuffer, int len, LPSTGMEDIUM lpMedium);
  55. CCertTmplCookie* m_pCookie; // the CCookieBlock is AddRef'ed for the life of the DataObject
  56. CertTmplObjectType m_objecttype;
  57. DATA_OBJECT_TYPES m_dataobjecttype;
  58. GUID m_SnapInCLSID;
  59. public:
  60. // Clipboard formats
  61. static CLIPFORMAT m_CFDisplayName;
  62. static CLIPFORMAT m_CFMultiSel; // Required for multiple selection
  63. static CLIPFORMAT m_CFMultiSelDobj; // Required for multiple selection
  64. static CLIPFORMAT m_CFMultiSelDataObjs;// for Multiple selection
  65. static CLIPFORMAT m_CFDsObjectNames; // For DS object property pages
  66. private:
  67. // data member used by IEnumCookies
  68. ULONG m_iCurr;
  69. CCookiePtrArray m_rgCookies;
  70. bool m_bMultiSelDobj;
  71. BYTE* m_pbMultiSelData;
  72. UINT m_cbMultiSelData;
  73. public:
  74. void SetMultiSelDobj()
  75. {
  76. m_bMultiSelDobj = true;
  77. }
  78. }; // CCertTemplatesDataObject
  79. #endif // ~__DATAOBJ_H_INCLUDED__