summaryrefslogtreecommitdiff
path: root/NSCmpts/EncryptAdvancedProp.h
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2003-09-17 19:07:23 +0000
committerStef Walter <stef@thewalter.net>2003-09-17 19:07:23 +0000
commit3f95d417d9e623ac0c74df8ef11d7a01846392dd (patch)
tree45ec73f2dc07eafd7f41a6f62a8cdfbaa279469f /NSCmpts/EncryptAdvancedProp.h
Initial ImportHEADmaster
Diffstat (limited to 'NSCmpts/EncryptAdvancedProp.h')
-rw-r--r--NSCmpts/EncryptAdvancedProp.h104
1 files changed, 104 insertions, 0 deletions
diff --git a/NSCmpts/EncryptAdvancedProp.h b/NSCmpts/EncryptAdvancedProp.h
new file mode 100644
index 0000000..864407c
--- /dev/null
+++ b/NSCmpts/EncryptAdvancedProp.h
@@ -0,0 +1,104 @@
+// EncryptAdvancedProp.h : Declaration of the CEncryptAdvancedProp
+
+#ifndef __ENCRYPTADVANCEDPROP_H_
+#define __ENCRYPTADVANCEDPROP_H_
+
+#include "resource.h" // main symbols
+
+#include "../common/CmptData.h"
+#include <contexthelp.h>
+
+#include "IgnoreProp.h"
+
+EXTERN_C const CLSID CLSID_EncryptAdvancedProp;
+
+/////////////////////////////////////////////////////////////////////////////
+// CEncryptAdvancedProp
+class ATL_NO_VTABLE CEncryptAdvancedProp :
+ public CComObjectRootEx<CComSingleThreadModel>,
+ public CComCoClass<CEncryptAdvancedProp, &CLSID_EncryptAdvancedProp>,
+ public IPropertyPageImpl<CEncryptAdvancedProp>,
+ public CDialogImplEx,
+
+ // Some dialog functionality from
+ public CIgnoreProp,
+ public CContextHelp<CEncryptAdvancedProp>
+{
+
+// Construction
+public:
+ CEncryptAdvancedProp() : CIgnoreProp(m_Data), CDialogImplEx(IDD)
+ {
+ m_dwTitleID = IDS_TITLEEncryptAdvancedProp;
+ m_dwHelpFileID = IDS_NSHELPFILE;
+ m_dwDocStringID = IDS_DOCSTRINGEncryptAdvancedProp;
+ }
+
+ enum {IDD = IDD_ENCRYPTADVANCED};
+
+DECLARE_REGISTRY_RESOURCEID(IDR_ENCRYPTADVANCEDPROP)
+
+DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+BEGIN_COM_MAP(CEncryptAdvancedProp)
+ COM_INTERFACE_ENTRY(IPropertyPage)
+END_COM_MAP()
+
+BEGIN_MSG_MAP(CEncryptAdvancedProp)
+ MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
+ MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
+ NOTIFY_HANDLER(IDC_IGNORE_LIST, LVN_ENDLABELEDIT, OnEndLabelEdit)
+ NOTIFY_HANDLER(IDC_IGNORE_LIST, NM_SETFOCUS, OnListSetFocus)
+ NOTIFY_HANDLER(IDC_IGNORE_LIST, LVN_KEYDOWN, OnKeyDown)
+ COMMAND_ID_HANDLER(IDC_NEW, OnAdd)
+ COMMAND_ID_HANDLER(IDC_DEL, OnRemove)
+ CHAIN_MSG_MAP(IPropertyPageImpl<CEncryptAdvancedProp>)
+ CHAIN_MSG_MAP(CContextHelp<CEncryptAdvancedProp>)
+END_MSG_MAP()
+
+BEGIN_HELP_MAP(NS_HELP_FILE)
+ HELP_ID(IDC_DISABLEPASSWORD, 4009)
+ HELP_ID(IDC_ENCRYPTREADONLY, 4011)
+ HELP_ID(IDC_IGNORE_LIST, 4010)
+ HELP_ID(IDC_NEW, 4018)
+ HELP_ID(IDC_DEL, 4017)
+END_HELP_MAP
+
+// Handler prototypes:
+// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+// LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
+// LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
+
+ LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+ LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+ STDMETHOD(Apply)(void)
+ {
+ ATLTRACE(_T("CEncryptAdvancedProp::Apply\n"));
+
+ // Let it choose an object for data
+ if(!m_Data.IsInitialized())
+ m_Data.Initialize(m_nObjects, m_ppUnk);
+
+ if(!m_Data.IsInitialized())
+ E_FAIL;
+
+ UpdateData(true);
+
+ m_Data.WriteStringSet(NS_IGNORE_REG_EXT, m_asExtensions);
+ m_Data.WriteInt(NS_ENCRYPT_REG_DISABLE, m_bDisablePassword);
+ m_Data.WriteInt(NS_ENCRYPT_REG_READONLY, m_bEncryptReadOnly);
+
+ m_bDirty = FALSE;
+ return S_OK;
+ }
+
+protected:
+ CPropertyBag m_Data;
+ bool m_bDisablePassword;
+ bool m_bEncryptReadOnly;
+
+ void UpdateData(bool bSave = true);
+};
+
+#endif //__ENCRYPTADVANCEDPROP_H_