本文整理汇总了C++中CPDFSDK_PageView::GetAnnotByXFAWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDFSDK_PageView::GetAnnotByXFAWidget方法的具体用法?C++ CPDFSDK_PageView::GetAnnotByXFAWidget怎么用?C++ CPDFSDK_PageView::GetAnnotByXFAWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDFSDK_PageView
的用法示例。
在下文中一共展示了CPDFSDK_PageView::GetAnnotByXFAWidget方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetNextAnnot
CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,
bool bNext) {
#ifdef PDF_ENABLE_XFA
CPDFSDK_PageView* pPageView = pSDKAnnot->GetPageView();
CPDFXFA_Page* pPage = pPageView->GetPDFXFAPage();
if (pPage && !pPage->AsPDFPage()) {
// For xfa annots in XFA pages not backed by PDF pages.
std::unique_ptr<IXFA_WidgetIterator> pWidgetIterator(
pPage->GetXFAPageView()->CreateWidgetIterator(
XFA_TRAVERSEWAY_Tranvalse, XFA_WidgetStatus_Visible |
XFA_WidgetStatus_Viewable |
XFA_WidgetStatus_Focused));
if (!pWidgetIterator)
return nullptr;
if (pWidgetIterator->GetCurrentWidget() != pSDKAnnot->GetXFAWidget())
pWidgetIterator->SetCurrentWidget(pSDKAnnot->GetXFAWidget());
CXFA_FFWidget* hNextFocus = bNext ? pWidgetIterator->MoveToNext()
: pWidgetIterator->MoveToPrevious();
if (!hNextFocus && pSDKAnnot)
hNextFocus = pWidgetIterator->MoveToFirst();
return pPageView->GetAnnotByXFAWidget(hNextFocus);
}
#endif // PDF_ENABLE_XFA
// For PDF annots.
CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pSDKAnnot);
CPDFSDK_AnnotIterator ai(pWidget->GetPageView(), pWidget->GetAnnotSubtype());
return bNext ? ai.GetNextAnnot(pWidget) : ai.GetPrevAnnot(pWidget);
}
示例2: GetNextAnnot
CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,
FX_BOOL bNext) {
#ifdef PDF_ENABLE_XFA
CPDFSDK_PageView* pPageView = pSDKAnnot->GetPageView();
CPDFXFA_Page* pPage = pPageView->GetPDFXFAPage();
if (!pPage)
return nullptr;
if (pPage->GetPDFPage()) { // for pdf annots.
CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), pSDKAnnot->GetType(), "");
CPDFSDK_Annot* pNext =
bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot);
return pNext;
}
// for xfa annots
std::unique_ptr<IXFA_WidgetIterator> pWidgetIterator(
pPage->GetXFAPageView()->CreateWidgetIterator(
XFA_TRAVERSEWAY_Tranvalse, XFA_WidgetStatus_Visible |
XFA_WidgetStatus_Viewable |
XFA_WidgetStatus_Focused));
if (!pWidgetIterator)
return nullptr;
if (pWidgetIterator->GetCurrentWidget() != pSDKAnnot->GetXFAWidget())
pWidgetIterator->SetCurrentWidget(pSDKAnnot->GetXFAWidget());
CXFA_FFWidget* hNextFocus =
bNext ? pWidgetIterator->MoveToNext() : pWidgetIterator->MoveToPrevious();
if (!hNextFocus && pSDKAnnot)
hNextFocus = pWidgetIterator->MoveToFirst();
return pPageView->GetAnnotByXFAWidget(hNextFocus);
#else // PDF_ENABLE_XFA
CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), "Widget", "");
return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot);
#endif // PDF_ENABLE_XFA
}
示例3: WidgetPreRemove
void CPDFXFA_DocEnvironment::WidgetPreRemove(CXFA_FFWidget* hWidget,
CXFA_WidgetAcc* pWidgetData) {
if (m_pContext->GetDocType() != DOCTYPE_DYNAMIC_XFA || !hWidget)
return;
CXFA_FFPageView* pPageView = hWidget->GetPageView();
if (!pPageView)
return;
CPDFXFA_Page* pXFAPage = m_pContext->GetXFAPage(pPageView);
if (!pXFAPage)
return;
CPDFSDK_PageView* pSdkPageView =
m_pContext->GetFormFillEnv()->GetPageView(pXFAPage, true);
if (CPDFSDK_Annot* pAnnot = pSdkPageView->GetAnnotByXFAWidget(hWidget))
pSdkPageView->DeleteAnnot(pAnnot);
}
示例4: SetFocusWidget
void CPDFXFA_DocEnvironment::SetFocusWidget(CXFA_FFDoc* hDoc,
CXFA_FFWidget* hWidget) {
if (hDoc != m_pContext->GetXFADoc())
return;
if (!hWidget) {
CPDFSDK_Annot::ObservedPtr pNull;
m_pContext->GetFormFillEnv()->SetFocusAnnot(&pNull);
return;
}
int pageViewCount = m_pContext->GetFormFillEnv()->GetPageViewCount();
for (int i = 0; i < pageViewCount; i++) {
CPDFSDK_PageView* pPageView = m_pContext->GetFormFillEnv()->GetPageView(i);
if (!pPageView)
continue;
CPDFSDK_Annot::ObservedPtr pAnnot(pPageView->GetAnnotByXFAWidget(hWidget));
if (pAnnot) {
m_pContext->GetFormFillEnv()->SetFocusAnnot(&pAnnot);
break;
}
}
}
示例5: GetNextAnnot
CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,
FX_BOOL bNext) {
#ifdef PDF_ENABLE_XFA
CPDFSDK_PageView* pPageView = pSDKAnnot->GetPageView();
CPDFXFA_Page* pPage = pPageView->GetPDFXFAPage();
if (pPage == NULL)
return NULL;
if (pPage->GetPDFPage()) { // for pdf annots.
CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), pSDKAnnot->GetType(), "");
CPDFSDK_Annot* pNext =
bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot);
return pNext;
}
// for xfa annots
IXFA_WidgetIterator* pWidgetIterator =
pPage->GetXFAPageView()->CreateWidgetIterator(
XFA_TRAVERSEWAY_Tranvalse, XFA_WIDGETFILTER_Visible |
XFA_WIDGETFILTER_Viewable |
XFA_WIDGETFILTER_Field);
if (pWidgetIterator == NULL)
return NULL;
if (pWidgetIterator->GetCurrentWidget() != pSDKAnnot->GetXFAWidget())
pWidgetIterator->SetCurrentWidget(pSDKAnnot->GetXFAWidget());
IXFA_Widget* hNextFocus = NULL;
hNextFocus =
bNext ? pWidgetIterator->MoveToNext() : pWidgetIterator->MoveToPrevious();
if (hNextFocus == NULL && pSDKAnnot != NULL)
hNextFocus = pWidgetIterator->MoveToFirst();
pWidgetIterator->Release();
return pPageView->GetAnnotByXFAWidget(hNextFocus);
#else // PDF_ENABLE_XFA
CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), "Widget", "");
return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot);
#endif // PDF_ENABLE_XFA
}