From 3f95d417d9e623ac0c74df8ef11d7a01846392dd Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 17 Sep 2003 19:07:23 +0000 Subject: Initial Import --- NSCmpts/EncryptAdvancedProp.h | 104 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 NSCmpts/EncryptAdvancedProp.h (limited to 'NSCmpts/EncryptAdvancedProp.h') 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 + +#include "IgnoreProp.h" + +EXTERN_C const CLSID CLSID_EncryptAdvancedProp; + +///////////////////////////////////////////////////////////////////////////// +// CEncryptAdvancedProp +class ATL_NO_VTABLE CEncryptAdvancedProp : + public CComObjectRootEx, + public CComCoClass, + public IPropertyPageImpl, + public CDialogImplEx, + + // Some dialog functionality from + public CIgnoreProp, + public CContextHelp +{ + +// 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) + CHAIN_MSG_MAP(CContextHelp) +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_ -- cgit v1.2.3