[STOBJECT] Change Turkish translation.
[reactos.git] / dll / shellext / acppage / CLayerUIPropPage.hpp
index de1fae4..c65a914 100644 (file)
@@ -1,23 +1,14 @@
 /*
- * Copyright 2015 Mark Jansen
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ * PROJECT:     ReactOS Compatibility Layer Shell Extension
+ * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
+ * PURPOSE:     CLayerUIPropPage definition
+ * COPYRIGHT:   Copyright 2015-2017 Mark Jansen (mark.jansen@reactos.org)
  */
 
+#pragma once
 
 class CLayerUIPropPage :
+    public CPropertyPageImpl<CLayerUIPropPage>,
     public CComCoClass<CLayerUIPropPage, &CLSID_CLayerUIPropPage>,
     public CComObjectRootEx<CComMultiThreadModelNoCS>,
     public IShellExtInit,
@@ -32,35 +23,66 @@ public:
 
 
     // IShellPropSheetExt
-    STDMETHODIMP AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam);
+    STDMETHODIMP AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
+    {
+        HPROPSHEETPAGE hPage = Create();
+        if (hPage && !pfnAddPage(hPage, lParam))
+            DestroyPropertySheetPage(hPage);
+
+        return S_OK;
+    }
+
     STDMETHODIMP ReplacePage(UINT, LPFNADDPROPSHEETPAGE, LPARAM)
     {
         return E_NOTIMPL;
     }
 
+    VOID OnPageAddRef()
+    {
+        InterlockedIncrement(&g_ModuleRefCnt);
+    }
+
+    VOID OnPageRelease()
+    {
+        InterlockedDecrement(&g_ModuleRefCnt);
+    }
+
     HRESULT InitFile(PCWSTR Filename);
-    INT_PTR InitDialog(HWND hWnd);
-    INT_PTR OnCommand(HWND hWnd, WORD id);
-    void UpdateControls(HWND hWnd);
-    INT_PTR DisableControls(HWND hWnd);
+    void UpdateControls();
+    INT_PTR DisableControls();
+    BOOL HasChanges() const;
 
-    void OnRefresh(HWND hWnd);
-    void OnApply(HWND hWnd);
+    int OnSetActive();
+    int OnApply();
+    LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
+    LRESULT OnCtrlCommand(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
+    LRESULT OnEditModes(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
+    LRESULT OnClickNotify(INT uCode, LPNMHDR hdr, BOOL& bHandled);
 
     static INT_PTR CALLBACK PropDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
-    /*static INT_PTR CALLBACK EditModesProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);*/
-
+    static INT_PTR CALLBACK EditModesProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
 
 protected:
-    CComBSTR m_Filename;
-    HWND m_Wnd;
+    CString m_Filename;
     BOOL m_IsSfcProtected;
     BOOL m_AllowPermLayer;
     DWORD m_LayerQueryFlags;
     DWORD m_RegistryOSMode, m_OSMode;
     DWORD m_RegistryEnabledLayers, m_EnabledLayers;
+    CSimpleArray<CString> m_RegistryCustomLayers, m_CustomLayers;
 
 public:
+    enum { IDD = IDD_ACPPAGESHEET };
+
+    BEGIN_MSG_MAP(CLayerUIPropPage)
+        MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
+        COMMAND_RANGE_HANDLER(IDC_CHKRUNCOMPATIBILITY, IDC_CHKDISABLEVISUALTHEMES, OnCtrlCommand)
+        COMMAND_ID_HANDLER(IDC_EDITCOMPATIBILITYMODES, OnEditModes)
+        NOTIFY_CODE_HANDLER(NM_CLICK, OnClickNotify)
+        NOTIFY_CODE_HANDLER(NM_RETURN, OnClickNotify)
+        CHAIN_MSG_MAP(CPropertyPageImpl<CLayerUIPropPage>)
+    END_MSG_MAP()
+
     DECLARE_REGISTRY_RESOURCEID(IDR_ACPPAGE)
     DECLARE_NOT_AGGREGATABLE(CLayerUIPropPage)