734fca1d69b665990405625fa5489acdcdebf4f9
[reactos.git] / reactos / dll / shellext / acppage / CLayerUIPropPage.hpp
1 /*
2 * Copyright 2015-2017 Mark Jansen
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19
20 class CLayerUIPropPage :
21 public CComCoClass<CLayerUIPropPage, &CLSID_CLayerUIPropPage>,
22 public CComObjectRootEx<CComMultiThreadModelNoCS>,
23 public IShellExtInit,
24 public IShellPropSheetExt
25 {
26 public:
27 CLayerUIPropPage();
28 ~CLayerUIPropPage();
29
30 // IShellExtInit
31 STDMETHODIMP Initialize(LPCITEMIDLIST pidlFolder, LPDATAOBJECT pdtobj, HKEY hkeyProgID);
32
33
34 // IShellPropSheetExt
35 STDMETHODIMP AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam);
36 STDMETHODIMP ReplacePage(UINT, LPFNADDPROPSHEETPAGE, LPARAM)
37 {
38 return E_NOTIMPL;
39 }
40
41 HRESULT InitFile(PCWSTR Filename);
42 INT_PTR InitDialog(HWND hWnd);
43 INT_PTR OnCommand(HWND hWnd, WORD id);
44 void UpdateControls(HWND hWnd);
45 INT_PTR DisableControls(HWND hWnd);
46 BOOL HasChanges() const;
47
48 void OnRefresh(HWND hWnd);
49 void OnApply(HWND hWnd);
50
51 static INT_PTR CALLBACK PropDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
52 static INT_PTR CALLBACK EditModesProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
53
54
55 protected:
56 CString m_Filename;
57 BOOL m_IsSfcProtected;
58 BOOL m_AllowPermLayer;
59 DWORD m_LayerQueryFlags;
60 DWORD m_RegistryOSMode, m_OSMode;
61 DWORD m_RegistryEnabledLayers, m_EnabledLayers;
62 CSimpleArray<CString> m_RegistryCustomLayers, m_CustomLayers;
63
64 public:
65 DECLARE_REGISTRY_RESOURCEID(IDR_ACPPAGE)
66 DECLARE_NOT_AGGREGATABLE(CLayerUIPropPage)
67
68 DECLARE_PROTECT_FINAL_CONSTRUCT()
69
70 BEGIN_COM_MAP(CLayerUIPropPage)
71 COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
72 COM_INTERFACE_ENTRY_IID(IID_IShellPropSheetExt, IShellPropSheetExt)
73 END_COM_MAP()
74 };