[SHELL32] -CFSDropTarget: Simplyfy the code path that handles the CFSTR_SHELLIDLIST...
[reactos.git] / reactos / dll / win32 / shell32 / droptargets / CFSDropTarget.h
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 class CFSDropTarget :
27 public CComObjectRootEx<CComMultiThreadModelNoCS>,
28 public IDropTarget
29 {
30 private:
31 UINT cfShellIDList; /* clipboardformat for IDropTarget */
32 BOOL fAcceptFmt; /* flag for pending Drop */
33 LPWSTR sPathTarget;
34
35 BOOL QueryDrop (DWORD dwKeyState, LPDWORD pdwEffect);
36 virtual HRESULT WINAPI _DoDrop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect);
37 virtual HRESULT WINAPI CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl, BOOL bCopy);
38 BOOL GetUniqueFileName(LPWSTR pwszBasePath, LPCWSTR pwszExt, LPWSTR pwszTarget, BOOL bShortcut);
39 static DWORD WINAPI _DoDropThreadProc(LPVOID lpParameter);
40
41 public:
42 CFSDropTarget();
43 ~CFSDropTarget();
44 HRESULT WINAPI Initialize(LPWSTR PathTarget);
45
46 // IDropTarget
47 virtual HRESULT WINAPI DragEnter(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect);
48 virtual HRESULT WINAPI DragOver(DWORD dwKeyState, POINTL pt, DWORD *pdwEffect);
49 virtual HRESULT WINAPI DragLeave();
50 virtual HRESULT WINAPI Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect);
51
52 DECLARE_NOT_AGGREGATABLE(CFSDropTarget)
53
54 DECLARE_PROTECT_FINAL_CONSTRUCT()
55
56 BEGIN_COM_MAP(CFSDropTarget)
57 COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget)
58 END_COM_MAP()
59
60 };
61
62 struct _DoDropData {
63 CFSDropTarget *This;
64 IStream *pStream;
65 DWORD dwKeyState;
66 POINTL pt;
67 DWORD pdwEffect;
68 };
69
70 HRESULT CFSDropTarget_CreateInstance(LPWSTR sPathTarget, REFIID riid, LPVOID * ppvOut);
71
72 #endif /* _CFSFOLDER_H_ */