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