[SHELLEXT][ZIPFLDR] Implement ZIP creation (#2114)
[reactos.git] / dll / shellext / zipfldr / CSendToZip.hpp
1 /*
2 * PROJECT: ReactOS Zip Shell Extension
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: SendTo handler
5 * COPYRIGHT: Copyright 2019 Mark Jansen (mark.jansen@reactos.org)
6 * Copyright 2019 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
7 */
8
9 #ifndef CSENDTOZIP_HPP_
10 #define CSENDTOZIP_HPP_
11
12 class CSendToZip :
13 public CComCoClass<CSendToZip, &CLSID_ZipFolderSendTo>,
14 public CComObjectRootEx<CComMultiThreadModelNoCS>,
15 public IDropTarget,
16 public IPersistFile
17 {
18 CComPtr<IDataObject> m_pDataObject;
19 BOOL m_fCanDragDrop;
20
21 public:
22 CSendToZip() : m_fCanDragDrop(FALSE)
23 {
24 InterlockedIncrement(&g_ModuleRefCnt);
25 }
26
27 virtual ~CSendToZip()
28 {
29 InterlockedDecrement(&g_ModuleRefCnt);
30 }
31
32 // *** IShellFolder2 methods ***
33 STDMETHODIMP DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
34 STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
35 STDMETHODIMP DragLeave();
36 STDMETHODIMP Drop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
37
38 // *** IPersistFile methods ***
39 STDMETHODIMP IsDirty()
40 {
41 return S_FALSE;
42 }
43 STDMETHODIMP Load(LPCOLESTR pszFileName, DWORD dwMode)
44 {
45 return S_OK;
46 }
47 STDMETHODIMP Save(LPCOLESTR pszFileName, BOOL fRemember)
48 {
49 return E_FAIL;
50 }
51 STDMETHODIMP SaveCompleted(LPCOLESTR pszFileName)
52 {
53 return E_FAIL;
54 }
55 STDMETHODIMP GetCurFile(LPOLESTR *ppszFileName)
56 {
57 return E_FAIL;
58 }
59
60 // *** IPersist methods ***
61 STDMETHODIMP GetClassID(CLSID *pclsid)
62 {
63 return E_FAIL;
64 }
65
66 public:
67 DECLARE_NO_REGISTRY() // Handled manually
68 DECLARE_NOT_AGGREGATABLE(CSendToZip)
69
70 DECLARE_PROTECT_FINAL_CONSTRUCT()
71
72 BEGIN_COM_MAP(CSendToZip)
73 COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget)
74 COM_INTERFACE_ENTRY_IID(IID_IPersistFile, IPersistFile)
75 COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
76 END_COM_MAP()
77 };
78
79 #endif