📄 securitysetting.cpp
字号:
// SecuritySetting.cpp : implementation file
//
#include "stdafx.h"
#include "PDFCMDSample.h"
#include "SecuritySetting.h"
#include "PDFCMDSampleDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSecuritySetting dialog
CSecuritySetting::CSecuritySetting(IPDFSecuritySetting* pPDFSecuritySetting,CWnd* pParent /*=NULL*/)
: CDialog(CSecuritySetting::IDD, pParent)
{
//{{AFX_DATA_INIT(CSecuritySetting)
m_pPDFSecuritySetting=pPDFSecuritySetting;
m_canannotate = FALSE;
m_cancontentaforvi = FALSE;
m_cancontentce = FALSE;
m_cancopy = FALSE;
m_canmodify = FALSE;
m_canprint = FALSE;
m_openpassword = _T("");
m_ownerpassword = _T("");
//}}AFX_DATA_INIT
}
void CSecuritySetting::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSecuritySetting)
DDX_Control(pDX, IDC_PRINTALLOWED, m_printallowed);
DDX_Control(pDX, IDC_ENCRYPTIONLEVEL, m_encryptionlevel);
DDX_Control(pDX, IDC_CHANGEALLOWED, m_changeallowed);
DDX_Check(pDX, IDC_CANANNOTATE, m_canannotate);
DDX_Check(pDX, IDC_CANCONTENTAFORVI, m_cancontentaforvi);
DDX_Check(pDX, IDC_CANCONTENTCE, m_cancontentce);
DDX_Check(pDX, IDC_CANCOPY, m_cancopy);
DDX_Check(pDX, IDC_CANMODIFY, m_canmodify);
DDX_Check(pDX, IDC_CANPRINT, m_canprint);
DDX_Text(pDX, IDC_OPENPASSWORD, m_openpassword);
DDX_Text(pDX, IDC_OWNERPASSWORD, m_ownerpassword);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSecuritySetting, CDialog)
//{{AFX_MSG_MAP(CSecuritySetting)
ON_BN_CLICKED(IDC_SETSECURITY, OnSetsecurity)
ON_BN_CLICKED(IDC_REMOVESECURITY, OnRemovesecurity)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSecuritySetting message handlers
void CSecuritySetting::OnOK()
{
// TODO: Add extra validation here
lencryptionlevel=m_encryptionlevel.GetCurSel();
lchangeallowed=m_changeallowed.GetCurSel();
lprintallowed=m_printallowed.GetCurSel();
CDialog::OnOK();
}
BOOL CSecuritySetting::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_encryptionlevel.SetCurSel(lencryptionlevel);
m_changeallowed.SetCurSel(lchangeallowed);
m_printallowed.SetCurSel(lprintallowed);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSecuritySetting::OnSetsecurity()
{
// TODO: Add your control notification handler code here
m_pPDFSecuritySetting->SetSecurity();
}
void CSecuritySetting::OnRemovesecurity()
{
// TODO: Add your control notification handler code here
m_pPDFSecuritySetting->RemoveSecurity();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -