ReactOS  0.4.14-dev-815-ge410a12
CSendToZip Class Reference

#include <CSendToZip.hpp>

Inheritance diagram for CSendToZip:
Collaboration diagram for CSendToZip:

Public Member Functions

 CSendToZip ()
 
virtual ~CSendToZip ()
 
STDMETHODIMP DragEnter (IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
 
STDMETHODIMP DragOver (DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
 
STDMETHODIMP DragLeave ()
 
STDMETHODIMP Drop (IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
 
STDMETHODIMP IsDirty ()
 
STDMETHODIMP Load (LPCOLESTR pszFileName, DWORD dwMode)
 
STDMETHODIMP Save (LPCOLESTR pszFileName, BOOL fRemember)
 
STDMETHODIMP SaveCompleted (LPCOLESTR pszFileName)
 
STDMETHODIMP GetCurFile (LPOLESTR *ppszFileName)
 
STDMETHODIMP GetClassID (CLSID *pclsid)
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Private Attributes

CComPtr< IDataObjectm_pDataObject
 
BOOL m_fCanDragDrop
 

Additional Inherited Members

- Public Types inherited from IDropTarget
typedef IDropTargetLPDROPTARGET
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IPersistFile
typedef IPersistFileLPPERSISTFILE
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from IDropTarget
const DWORD MK_ALT = 0x20
 
const DWORD DROPEFFECT_NONE = 0
 
const DWORD DROPEFFECT_COPY = 1
 
const DWORD DROPEFFECT_MOVE = 2
 
const DWORD DROPEFFECT_LINK = 4
 
const DWORD DROPEFFECT_SCROLL = 0x80000000
 
const DWORD DD_DEFSCROLLINSET = 11
 
const DWORD DD_DEFSCROLLDELAY = 50
 
const DWORD DD_DEFSCROLLINTERVAL = 50
 
const DWORD DD_DEFDRAGDELAY = 200
 
const DWORD DD_DEFDRAGMINDIST = 2
 

Detailed Description

Definition at line 12 of file CSendToZip.hpp.

Constructor & Destructor Documentation

◆ CSendToZip()

CSendToZip::CSendToZip ( )
inline

Definition at line 22 of file CSendToZip.hpp.

23  {
25  }
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
BOOL m_fCanDragDrop
Definition: CSendToZip.hpp:19
#define InterlockedIncrement
Definition: armddk.h:53

◆ ~CSendToZip()

virtual CSendToZip::~CSendToZip ( )
inlinevirtual

Definition at line 27 of file CSendToZip.hpp.

28  {
30  }
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
#define InterlockedDecrement
Definition: armddk.h:52

Member Function Documentation

◆ DragEnter()

STDMETHODIMP CSendToZip::DragEnter ( IDataObject pDataObj,
DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)

Implements IDropTarget.

Definition at line 12 of file CSendToZip.cpp.

14 {
15  m_pDataObject = pDataObj;
16 
17  FORMATETC etc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
18  m_fCanDragDrop = SUCCEEDED(pDataObj->QueryGetData(&etc));
19 
20  if (m_fCanDragDrop)
21  *pdwEffect &= DROPEFFECT_COPY;
22  else
23  *pdwEffect = DROPEFFECT_NONE;
24 
25  return S_OK;
26 }
BOOL m_fCanDragDrop
Definition: CSendToZip.hpp:19
const DWORD DROPEFFECT_COPY
Definition: oleidl.idl:930
const DWORD DROPEFFECT_NONE
Definition: oleidl.idl:929
smooth NULL
Definition: ftsmooth.c:416
#define CF_HDROP
Definition: constants.h:410
#define S_OK
Definition: intsafe.h:59
HRESULT QueryGetData([in, unique] FORMATETC *pformatetc)
CComPtr< IDataObject > m_pDataObject
Definition: CSendToZip.hpp:18
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ DragLeave()

STDMETHODIMP CSendToZip::DragLeave ( void  )

Implements IDropTarget.

Definition at line 38 of file CSendToZip.cpp.

39 {
42  return S_OK;
43 }
BOOL m_fCanDragDrop
Definition: CSendToZip.hpp:19
#define S_OK
Definition: intsafe.h:59
void Release()
Definition: atlcomcli.h:140
CComPtr< IDataObject > m_pDataObject
Definition: CSendToZip.hpp:18

Referenced by Drop().

◆ DragOver()

STDMETHODIMP CSendToZip::DragOver ( DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)

Implements IDropTarget.

Definition at line 28 of file CSendToZip.cpp.

29 {
30  if (m_fCanDragDrop)
31  *pdwEffect &= DROPEFFECT_COPY;
32  else
33  *pdwEffect = DROPEFFECT_NONE;
34 
35  return S_OK;
36 }
BOOL m_fCanDragDrop
Definition: CSendToZip.hpp:19
const DWORD DROPEFFECT_COPY
Definition: oleidl.idl:930
const DWORD DROPEFFECT_NONE
Definition: oleidl.idl:929
#define S_OK
Definition: intsafe.h:59

◆ Drop()

STDMETHODIMP CSendToZip::Drop ( IDataObject pDataObj,
DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)

Implements IDropTarget.

Definition at line 46 of file CSendToZip.cpp.

48 {
49  m_pDataObject = pDataObj;
50 
51  if (!pDataObj || !m_fCanDragDrop)
52  {
53  DPRINT1("Drop failed: %d %d\n", !pDataObj, !m_fCanDragDrop);
54  *pdwEffect = 0;
55  DragLeave();
56  return E_FAIL;
57  }
58 
59  STGMEDIUM stg;
60  FORMATETC etc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
61  HRESULT hr = pDataObj->GetData(&etc, &stg);
63  {
64  *pdwEffect = 0;
65  DragLeave();
66  return E_FAIL;
67  }
68 
69  HDROP hDrop = reinterpret_cast<HDROP>(stg.hGlobal);
70  UINT cItems = ::DragQueryFileW(hDrop, -1, NULL, 0);
71 
72  CZipCreator *pCreator = CZipCreator::DoCreate();
73 
74  for (UINT iItem = 0; iItem < cItems; ++iItem)
75  {
77  DragQueryFileW(hDrop, iItem, szPath, _countof(szPath));
78 
79  pCreator->DoAddItem(szPath);
80  }
81 
82  ::ReleaseStgMedium(&stg);
83 
84  CZipCreator::runThread(pCreator); // pCreator is deleted in runThread
85 
86  DragLeave();
87  return hr;
88 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
#define _countof(array)
Definition: fontsub.cpp:30
BOOL m_fCanDragDrop
Definition: CSendToZip.hpp:19
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
static CZipCreator * DoCreate()
Definition: CZipCreator.hpp:20
#define E_FAIL
Definition: ddrawi.h:102
virtual void DoAddItem(LPCWSTR pszFile)
smooth NULL
Definition: ftsmooth.c:416
#define CF_HDROP
Definition: constants.h:410
static BOOL runThread(CZipCreator *pCreator)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MAX_PATH
Definition: compat.h:26
LPCWSTR szPath
Definition: env.c:35
STDMETHODIMP DragLeave()
Definition: CSendToZip.cpp:38
unsigned int UINT
Definition: ndis.h:50
#define DPRINT1
Definition: precomp.h:8
CComPtr< IDataObject > m_pDataObject
Definition: CSendToZip.hpp:18
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:627

◆ GetClassID()

STDMETHODIMP CSendToZip::GetClassID ( CLSID pclsid)
inline

Implements IPersist.

Definition at line 61 of file CSendToZip.hpp.

62  {
63  *pclsid = CLSID_ZipFolderSendTo;
64  return S_OK;
65  }
#define S_OK
Definition: intsafe.h:59
EXTERN_C const GUID CLSID_ZipFolderSendTo
Definition: precomp.h:30

◆ GetCurFile()

STDMETHODIMP CSendToZip::GetCurFile ( LPOLESTR ppszFileName)
inline

Implements IPersistFile.

Definition at line 55 of file CSendToZip.hpp.

56  {
57  return E_NOTIMPL;
58  }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IsDirty()

STDMETHODIMP CSendToZip::IsDirty ( void  )
inline

Implements IPersistFile.

Definition at line 39 of file CSendToZip.hpp.

40  {
41  return S_FALSE;
42  }
#define S_FALSE
Definition: winerror.h:2357

◆ Load()

STDMETHODIMP CSendToZip::Load ( LPCOLESTR  pszFileName,
DWORD  dwMode 
)
inline

Implements IPersistFile.

Definition at line 43 of file CSendToZip.hpp.

44  {
45  return S_OK;
46  }
#define S_OK
Definition: intsafe.h:59

◆ Save()

STDMETHODIMP CSendToZip::Save ( LPCOLESTR  pszFileName,
BOOL  fRemember 
)
inline

Implements IPersistFile.

Definition at line 47 of file CSendToZip.hpp.

48  {
49  return E_NOTIMPL;
50  }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SaveCompleted()

STDMETHODIMP CSendToZip::SaveCompleted ( LPCOLESTR  pszFileName)
inline

Implements IPersistFile.

Definition at line 51 of file CSendToZip.hpp.

52  {
53  return E_NOTIMPL;
54  }
#define E_NOTIMPL
Definition: ddrawi.h:99

Member Data Documentation

◆ m_fCanDragDrop

BOOL CSendToZip::m_fCanDragDrop
private

Definition at line 19 of file CSendToZip.hpp.

Referenced by DragEnter(), DragLeave(), DragOver(), and Drop().

◆ m_pDataObject

CComPtr<IDataObject> CSendToZip::m_pDataObject
private

Definition at line 18 of file CSendToZip.hpp.

Referenced by DragEnter(), DragLeave(), and Drop().


The documentation for this class was generated from the following files: