1 /*
2  * PROJECT:     mydocs
3  * LICENSE:     LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
4  * PURPOSE:     MyDocs implementation
5  * COPYRIGHT:   Copyright 2020 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
6  */
7 
8 #pragma once
9 
10 #include "resource.h"
11 
12 class CMyDocsDropHandler :
13     public CComCoClass<CMyDocsDropHandler, &CLSID_MyDocsDropHandler>,
14     public CComObjectRootEx<CComMultiThreadModelNoCS>,
15     public IDropTarget,
16     public IPersistFile
17 {
18 public:
19     CMyDocsDropHandler();
20     ~CMyDocsDropHandler();
21 
22     // IDropTarget
23     STDMETHODIMP DragEnter(IDataObject *pDataObject, DWORD dwKeyState,
24                            POINTL pt, DWORD *pdwEffect);
25     STDMETHODIMP DragOver(DWORD dwKeyState, POINTL pt, DWORD *pdwEffect);
26     STDMETHODIMP DragLeave();
27     STDMETHODIMP Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt,
28                       DWORD *pdwEffect);
29 
30     // IPersist
31     STDMETHODIMP GetClassID(CLSID *lpClassId);
32 
33     // IPersistFile
34     STDMETHODIMP GetCurFile(LPOLESTR *ppszFileName);
35     STDMETHODIMP IsDirty();
36     STDMETHODIMP Load(LPCOLESTR pszFileName, DWORD dwMode);
37     STDMETHODIMP Save(LPCOLESTR pszFileName, BOOL fRemember);
38     STDMETHODIMP SaveCompleted(LPCOLESTR pszFileName);
39 
40     DECLARE_REGISTRY_RESOURCEID(IDR_MYDOCS)
41     DECLARE_NOT_AGGREGATABLE(CMyDocsDropHandler)
42 
43     DECLARE_PROTECT_FINAL_CONSTRUCT()
44 
45     BEGIN_COM_MAP(CMyDocsDropHandler)
46         COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
47         COM_INTERFACE_ENTRY_IID(IID_IPersistFile, IPersistFile)
48         COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget)
49     END_COM_MAP()
50 };
51