ReactOS 0.4.16-dev-1946-g52006dd
CFSDropTarget.h
Go to the documentation of this file.
1/*
2 * file system folder drop target
3 *
4 * Copyright 1997 Marcus Meissner
5 * Copyright 1998, 1999, 2002 Juergen Schmied
6 * Copyright 2009 Andrew Hill
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#ifndef _CFSDROPTARGET_H_
24#define _CFSDROPTARGET_H_
25
26#define DROPIDM_EXTFIRST 100
27#define DROPIDM_EXTLAST 0x7fff
28
30 public CComObjectRootEx<CComMultiThreadModelNoCS>,
31 public IDropTarget,
32 public IObjectWithSite
33{
34 private:
35 UINT m_cfShellIDList; /* clipboardformat for IDropTarget */
36 BOOL m_fAcceptFmt; /* flag for pending Drop */
42 CComPtr<IUnknown> m_site;
43
44 BOOL _QueryDrop (DWORD dwKeyState, LPDWORD pdwEffect);
45 HRESULT _DoDrop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect);
46 HRESULT _CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl, BOOL bCopy);
47 BOOL _GetUniqueFileName(LPCWSTR pwszBasePath, LPCWSTR pwszExt, LPWSTR pwszTarget, BOOL bShortcut);
48 static DWORD WINAPI _DoDropThreadProc(LPVOID lpParameter);
49 HRESULT _GetEffectFromMenu(IDataObject *pDataObject, POINTL pt, DWORD *pdwEffect, DWORD dwAvailableEffects);
50 HRESULT _RepositionItems(IShellFolderView *psfv, IDataObject *pDataObject, POINTL pt);
51
52 public:
55 HRESULT Initialize(LPWSTR PathTarget);
56
57 // IDropTarget
58 STDMETHOD(DragEnter)(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) override;
59 STDMETHOD(DragOver)(DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) override;
60 STDMETHOD(DragLeave)() override;
61 STDMETHOD(Drop)(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) override;
62
63 // IObjectWithSite
64 STDMETHOD(SetSite)(IUnknown *pUnkSite) override;
65 STDMETHOD(GetSite)(REFIID riid, void **ppvSite) override;
66
68
70
72 COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget)
75
76};
77
84};
85
87
88#endif /* _CFSFOLDER_H_ */
HRESULT CFSDropTarget_CreateInstance(LPWSTR sPathTarget, REFIID riid, LPVOID *ppvOut)
#define STDMETHOD(m)
Definition: basetyps.h:62
DWORD m_dwDefaultEffect
Definition: CFSDropTarget.h:40
STDMETHOD() Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) override
CComPtr< IUnknown > m_site
Definition: CFSDropTarget.h:42
STDMETHOD() DragOver(DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) override
DWORD m_AllowedEffects
Definition: CFSDropTarget.h:41
STDMETHOD() GetSite(REFIID riid, void **ppvSite) override
LPWSTR m_sPathTarget
Definition: CFSDropTarget.h:37
static DWORD WINAPI _DoDropThreadProc(LPVOID lpParameter)
HRESULT _CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl, BOOL bCopy)
BOOL _QueryDrop(DWORD dwKeyState, LPDWORD pdwEffect)
UINT m_cfShellIDList
Definition: CFSDropTarget.h:35
HRESULT _GetEffectFromMenu(IDataObject *pDataObject, POINTL pt, DWORD *pdwEffect, DWORD dwAvailableEffects)
STDMETHOD() DragLeave() override
HRESULT _DoDrop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
BOOL _GetUniqueFileName(LPCWSTR pwszBasePath, LPCWSTR pwszExt, LPWSTR pwszTarget, BOOL bShortcut)
DWORD m_grfKeyState
Definition: CFSDropTarget.h:39
STDMETHOD() DragEnter(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) override
STDMETHOD() SetSite(IUnknown *pUnkSite) override
HRESULT _RepositionItems(IShellFolderView *psfv, IDataObject *pDataObject, POINTL pt)
#define pt(x, y)
Definition: drawing.c:79
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID riid
Definition: atlbase.h:39
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define END_COM_MAP()
Definition: atlcom.h:592
const IID IID_IObjectWithSite
unsigned int UINT
Definition: ndis.h:50
#define REFIID
Definition: guiddef.h:118
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
IStream * pStream
Definition: CFSDropTarget.h:80
DWORD dwKeyState
Definition: CFSDropTarget.h:81
DWORD pdwEffect
Definition: CFSDropTarget.h:83
CFSDropTarget * This
Definition: CFSDropTarget.h:79
uint32_t * LPDWORD
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
static void Initialize()
Definition: xlate.c:212
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
WCHAR * LPWSTR
Definition: xmlstorage.h:184