本文整理汇总了C++中CPDFSDK_Document类的典型用法代码示例。如果您正苦于以下问题:C++ CPDFSDK_Document类的具体用法?C++ CPDFSDK_Document怎么用?C++ CPDFSDK_Document使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CPDFSDK_Document类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
FX_BOOL& bExit,
FX_DWORD nFlag) {
if (!m_bNotifying) {
ASSERT(pWidget);
CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
CPDFSDK_InterForm* pInterForm =
(CPDFSDK_InterForm*)pDocument->GetInterForm();
FX_BOOL bFormated = FALSE;
CFX_WideString sValue =
pInterForm->OnFormat(pWidget->GetFormField(), bFormated);
if (bExit)
return;
if (bFormated) {
pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(),
TRUE);
pInterForm->UpdateField(pWidget->GetFormField());
}
m_bNotifying = FALSE;
}
}
示例2: ASSERT
FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
const CPDF_Point& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument();
switch (pWidget->GetFieldType()) {
case FIELDTYPE_PUSHBUTTON:
case FIELDTYPE_CHECKBOX:
case FIELDTYPE_RADIOBUTTON:
if (GetViewBBox(pPageView, pAnnot).Contains((int)point.x, (int)point.y))
pDocument->SetFocusAnnot(pAnnot);
break;
default:
pDocument->SetFocusAnnot(pAnnot);
break;
}
FX_BOOL bRet = FALSE;
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
bRet = pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point);
}
if (pDocument->GetFocusAnnot() == pAnnot) {
FX_BOOL bExit = FALSE;
FX_BOOL bReset = FALSE;
OnButtonUp(pWidget, pPageView, bReset, bExit, nFlags);
if (bExit)
return TRUE;
}
return bRet;
}
示例3: OnLoad
void CPDFSDK_WidgetHandler::OnLoad(CPDFSDK_Annot* pAnnot) {
if (pAnnot->IsSignatureWidget())
return;
CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
if (!pWidget->IsAppearanceValid())
pWidget->ResetAppearance(nullptr, FALSE);
int nFieldType = pWidget->GetFieldType();
if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX) {
FX_BOOL bFormatted = FALSE;
CFX_WideString sValue = pWidget->OnFormat(bFormatted);
if (bFormatted && nFieldType == FIELDTYPE_COMBOBOX)
pWidget->ResetAppearance(&sValue, FALSE);
}
#ifdef PDF_ENABLE_XFA
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument();
CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) {
if (!pWidget->IsAppearanceValid() && !pWidget->GetValue().IsEmpty())
pWidget->ResetAppearance(FALSE);
}
#endif // PDF_ENABLE_XFA
if (m_pFormFiller)
m_pFormFiller->OnLoad(pAnnot);
}
示例4: ASSERT
void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device,
FX_DWORD dwFlags) {
ASSERT(pPageView != NULL);
ASSERT(pAnnot != NULL);
CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument();
ASSERT(pSDKDoc != NULL);
IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
ASSERT(pWidgetHandler != NULL);
CFX_Graphics gs;
gs.Create(pDevice);
CFX_Matrix mt;
mt = *(CFX_Matrix*)pUser2Device;
FX_BOOL bIsHighlight = FALSE;
if (pSDKDoc->GetFocusAnnot() != pAnnot)
bIsHighlight = TRUE;
pWidgetHandler->RenderWidget(pAnnot->GetXFAWidget(), &gs, &mt, bIsHighlight);
// to do highlight and shadow
}
示例5: HitTest
FX_BOOL CPDFSDK_XFAAnnotHandler::HitTest(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
const CFX_FloatPoint& point) {
if (!pPageView || !pAnnot)
return FALSE;
CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument();
if (!pSDKDoc)
return FALSE;
CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
if (!pDoc)
return FALSE;
CXFA_FFDocView* pDocView = pDoc->GetXFADocView();
if (!pDocView)
return FALSE;
CXFA_FFWidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler();
if (!pWidgetHandler)
return FALSE;
FWL_WidgetHit dwHitTest =
pWidgetHandler->OnHitTest(pAnnot->GetXFAWidget(), point.x, point.y);
return dwHitTest != FWL_WidgetHit::Unknown;
}
示例6: HitTest
FX_BOOL CPDFSDK_XFAAnnotHandler::HitTest(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
const CPDF_Point& point) {
if (!pPageView || !pAnnot)
return FALSE;
CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument();
if (!pSDKDoc)
return FALSE;
CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
if (!pDoc)
return FALSE;
IXFA_DocView* pDocView = pDoc->GetXFADocView();
if (!pDocView)
return FALSE;
IXFA_WidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler();
if (!pWidgetHandler)
return FALSE;
FX_DWORD dwHitTest =
pWidgetHandler->OnHitTest(pAnnot->GetXFAWidget(), point.x, point.y);
return (dwHitTest != FWL_WGTHITTEST_Unknown);
}
示例7: FORM_DoPageAAction
DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page,
FPDF_FORMHANDLE hHandle,
int aaType) {
if (!hHandle)
return;
CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument();
UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page);
CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
if (!pPDFPage)
return;
if (pSDKDoc->GetPageView(pPage, FALSE)) {
CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv();
CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict;
CPDF_AAction aa(pPageDict->GetDictBy("AA"));
if (FPDFPAGE_AACTION_OPEN == aaType) {
if (aa.ActionExist(CPDF_AAction::OpenPage)) {
CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage);
pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
}
} else {
if (aa.ActionExist(CPDF_AAction::ClosePage)) {
CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
}
}
}
}
示例8: OnLoad
void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) {
if (pAnnot->GetSubType() == BFFT_SIGNATURE)
return;
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (!pWidget->IsAppearanceValid())
pWidget->ResetAppearance(NULL, FALSE);
int nFieldType = pWidget->GetFieldType();
if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX) {
FX_BOOL bFormated = FALSE;
CFX_WideString sValue = pWidget->OnFormat(bFormated);
if (bFormated && nFieldType == FIELDTYPE_COMBOBOX) {
pWidget->ResetAppearance(sValue.c_str(), FALSE);
}
}
#ifdef PDF_ENABLE_XFA
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument();
CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) {
if (!pWidget->IsAppearanceValid() && !pWidget->GetValue().IsEmpty())
pWidget->ResetAppearance(FALSE);
}
#endif // PDF_ENABLE_XFA
if (m_pFormFiller)
m_pFormFiller->OnLoad(pAnnot);
}
示例9: ASSERT
void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag)
{
if (!m_bNotifying)
{
ASSERT(pWidget != NULL);
ASSERT(pPageView != NULL);
// CReader_DocView* pDocView = pPageView->GetDocView();
// ASSERT(pDocView != NULL);
CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
ASSERT(pDocument != NULL);
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
ASSERT(pInterForm != NULL);
FX_BOOL bFormated = FALSE;
CFX_WideString sValue = pInterForm->OnFormat(pWidget->GetFormField(), GetCommitKey(), bFormated);
// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
if (bExit) return;
if (bFormated)
{
pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue, TRUE);
pInterForm->UpdateField(pWidget->GetFormField());
}
m_bNotifying = FALSE;
}
}
示例10: FORM_ForceToKillFocus
DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle) {
CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle);
if (!pSDKDoc)
return FALSE;
return pSDKDoc->KillFocusAnnot(0);
}
示例11: NewAnnot
CPDFSDK_Annot* CPDFSDK_XFAAnnotHandler::NewAnnot(IXFA_Widget* pAnnot,
CPDFSDK_PageView* pPage) {
CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument();
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterForm();
CPDFSDK_XFAWidget* pWidget = new CPDFSDK_XFAWidget(pAnnot, pPage, pInterForm);
pInterForm->AddXFAMap(pAnnot, pWidget);
return pWidget;
}
示例12: FORM_ForceToKillFocus
DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle)
{
if(!hHandle)
return FALSE;
CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
if(!pSDKDoc)
return FALSE;
//Kill the current focus.
return pSDKDoc->KillFocusAnnot(0);
}
示例13: FPDF_SetFormFieldHighlightAlpha
DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, unsigned char alpha)
{
if (!hHandle)
return;
CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
if(pSDKDoc)
{
if(CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm())
pInterForm->SetHighlightAlpha(alpha);
}
}
示例14: FPDF_RemoveFormFieldHighlight
DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle)
{
if (!hHandle)
return;
CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
if(pSDKDoc)
{
if(CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm())
pInterForm->RemoveAllHighLight();
}
}
示例15: ASSERT
void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget,
CPDFSDK_PageView* pPageView,
FX_BOOL& bExit,
uint32_t nFlag) {
if (!m_bNotifying) {
ASSERT(pWidget);
CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm();
pInterForm->OnCalculate(pWidget->GetFormField());
m_bNotifying = FALSE;
}
}