ReactOS  0.4.15-dev-1070-ge1a01de
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 
27  public CComObjectRootEx<CComMultiThreadModelNoCS>,
28  public IDropTarget,
29  public IObjectWithSite
30 {
31  private:
32  UINT m_cfShellIDList; /* clipboardformat for IDropTarget */
33  BOOL m_fAcceptFmt; /* flag for pending Drop */
38  CComPtr<IUnknown> m_site;
39 
40  BOOL _QueryDrop (DWORD dwKeyState, LPDWORD pdwEffect);
41  HRESULT _DoDrop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect);
42  HRESULT _CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl, BOOL bCopy);
43  BOOL _GetUniqueFileName(LPWSTR pwszBasePath, LPCWSTR pwszExt, LPWSTR pwszTarget, BOOL bShortcut);
45  HRESULT _GetEffectFromMenu(IDataObject *pDataObject, POINTL pt, DWORD *pdwEffect, DWORD dwAvailableEffects);
46  HRESULT _RepositionItems(IShellFolderView *psfv, IDataObject *pDataObject, POINTL pt);
47 
48  public:
49  CFSDropTarget();
51  HRESULT Initialize(LPWSTR PathTarget);
52 
53  // IDropTarget
54  virtual HRESULT WINAPI DragEnter(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect);
55  virtual HRESULT WINAPI DragOver(DWORD dwKeyState, POINTL pt, DWORD *pdwEffect);
56  virtual HRESULT WINAPI DragLeave();
57  virtual HRESULT WINAPI Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect);
58 
59  // IObjectWithSite
60  virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite);
61  virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite);
62 
64 
66 
68  COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget)
70  END_COM_MAP()
71 
72 };
73 
80 };
81 
83 
84 #endif /* _CFSFOLDER_H_ */
virtual HRESULT WINAPI Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
LPWSTR m_sPathTarget
Definition: CFSDropTarget.h:34
#define REFIID
Definition: guiddef.h:118
virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite)
CComPtr< IUnknown > m_site
Definition: CFSDropTarget.h:38
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define pt(x, y)
Definition: drawing.c:79
REFIID riid
Definition: precomp.h:44
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
HRESULT _CopyItems(IShellFolder *pSFFrom, UINT cidl, LPCITEMIDLIST *apidl, BOOL bCopy)
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
IStream * pStream
Definition: CFSDropTarget.h:76
virtual HRESULT WINAPI DragOver(DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
static DWORD WINAPI _DoDropThreadProc(LPVOID lpParameter)
unsigned int BOOL
Definition: ntddk_ex.h:94
virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite)
HRESULT _GetEffectFromMenu(IDataObject *pDataObject, POINTL pt, DWORD *pdwEffect, DWORD dwAvailableEffects)
UINT m_cfShellIDList
Definition: CFSDropTarget.h:32
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
LONG HRESULT
Definition: typedefs.h:79
BOOL _QueryDrop(DWORD dwKeyState, LPDWORD pdwEffect)
virtual HRESULT WINAPI DragLeave()
#define WINAPI
Definition: msvc.h:6
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
const IID IID_IObjectWithSite
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT _RepositionItems(IShellFolderView *psfv, IDataObject *pDataObject, POINTL pt)
HRESULT _DoDrop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
DWORD pdwEffect
Definition: CFSDropTarget.h:79
DWORD m_dwDefaultEffect
Definition: CFSDropTarget.h:37
LPVOID lpParameter
Definition: kernel32.h:241
BOOL _GetUniqueFileName(LPWSTR pwszBasePath, LPCWSTR pwszExt, LPWSTR pwszTarget, BOOL bShortcut)
DWORD dwKeyState
Definition: CFSDropTarget.h:77
HRESULT Initialize(LPWSTR PathTarget)
HRESULT CFSDropTarget_CreateInstance(LPWSTR sPathTarget, REFIID riid, LPVOID *ppvOut)
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
virtual HRESULT WINAPI DragEnter(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect)
unsigned int UINT
Definition: ndis.h:50
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
uint32_t * LPDWORD
Definition: typedefs.h:59
DWORD m_grfKeyState
Definition: CFSDropTarget.h:36
#define END_COM_MAP()
Definition: atlcom.h:552
CFSDropTarget * This
Definition: CFSDropTarget.h:75
WCHAR * LPWSTR
Definition: xmlstorage.h:184