本文整理汇总了C++中CPDF_Document::GetUserPermissions方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Document::GetUserPermissions方法的具体用法?C++ CPDF_Document::GetUserPermissions怎么用?C++ CPDF_Document::GetUserPermissions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDF_Document
的用法示例。
在下文中一共展示了CPDF_Document::GetUserPermissions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsFillingAllowed
FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) {
if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
return TRUE;
CPDF_Page* pPage = pWidget->GetPDFPage();
CPDF_Document* pDocument = pPage->m_pDocument;
FX_DWORD dwPermissions = pDocument->GetUserPermissions();
return (dwPermissions & FPDFPERM_FILL_FORM) ||
(dwPermissions & FPDFPERM_ANNOT_FORM) ||
(dwPermissions & FPDFPERM_MODIFY);
}
示例2: CanAnswer
FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) {
ASSERT(pAnnot->GetType() == "Widget");
if (pAnnot->GetSubType() == BFFT_SIGNATURE)
return FALSE;
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (!pWidget->IsVisible())
return FALSE;
int nFieldFlags = pWidget->GetFieldFlags();
if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY)
return FALSE;
if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
return TRUE;
CPDF_Page* pPage = pWidget->GetPDFPage();
CPDF_Document* pDocument = pPage->m_pDocument;
FX_DWORD dwPermissions = pDocument->GetUserPermissions();
return (dwPermissions & FPDFPERM_FILL_FORM) ||
(dwPermissions & FPDFPERM_ANNOT_FORM);
}
示例3: CanAnswer
FX_BOOL CPDFSDK_WidgetHandler::CanAnswer(CPDFSDK_Annot* pAnnot) {
ASSERT(pAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::WIDGET);
if (pAnnot->IsSignatureWidget())
return FALSE;
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
if (!pWidget->IsVisible())
return FALSE;
int nFieldFlags = pWidget->GetFieldFlags();
if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY)
return FALSE;
if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
return TRUE;
CPDF_Page* pPage = pWidget->GetPDFPage();
CPDF_Document* pDocument = pPage->m_pDocument;
uint32_t dwPermissions = pDocument->GetUserPermissions();
return (dwPermissions & FPDFPERM_FILL_FORM) ||
(dwPermissions & FPDFPERM_ANNOT_FORM);
}