1 /*
2  * PROJECT:     ReactOS Zip Shell Extension
3  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE:     IShellFolderViewCB implementation
5  * COPYRIGHT:   Copyright 2017 David Quintana (gigaherz@gmail.com)
6  *              Copyright 2017 Mark Jansen (mark.jansen@reactos.org)
7  */
8 
9 #include "precomp.h"
10 
11 class CFolderViewCB :
12     public CComObjectRootEx<CComMultiThreadModelNoCS>,
13     public IShellFolderViewCB
14 {
15 public:
16 
17     virtual ~CFolderViewCB()
18     {
19     }
20 
21     // *** IShellFolderViewCB methods ***
22     STDMETHODIMP MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
23     {
24         /* TODO: Handle SFVM_GET_WEBVIEW_CONTENT to add tasks */
25         switch (uMsg)
26         {
27         case SFVM_DEFVIEWMODE:
28         {
29             FOLDERVIEWMODE* pViewMode = (FOLDERVIEWMODE*)lParam;
30             *pViewMode = FVM_DETAILS;
31             return S_OK;
32         }
33         case SFVM_COLUMNCLICK:
34             return S_FALSE;
35         case SFVM_BACKGROUNDENUM:
36             return S_OK;
37         }
38 
39         return E_NOTIMPL;
40     }
41 
42 public:
43     DECLARE_NOT_AGGREGATABLE(CFolderViewCB)
44     DECLARE_PROTECT_FINAL_CONSTRUCT()
45 
46     BEGIN_COM_MAP(CFolderViewCB)
47         COM_INTERFACE_ENTRY_IID(IID_IShellFolderViewCB, IShellFolderViewCB)
48     END_COM_MAP()
49 };
50 
51 HRESULT _CFolderViewCB_CreateInstance(REFIID riid, LPVOID * ppvOut)
52 {
53     return ShellObjectCreator<CFolderViewCB>(riid, ppvOut);
54 }
55