本文整理汇总了C++中CPDFXFA_Document类的典型用法代码示例。如果您正苦于以下问题:C++ CPDFXFA_Document类的具体用法?C++ CPDFXFA_Document怎么用?C++ CPDFXFA_Document使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CPDFXFA_Document类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: FPDF_Widget_GetSpellCheckWords
DLLEXPORT void STDCALL
FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document,
FPDF_WIDGET hWidget,
float x,
float y,
FPDF_STRINGHANDLE* stringHandle) {
if (NULL == hWidget || NULL == document)
return;
CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document;
if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic &&
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
IXFA_MenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander == NULL)
return;
CFX_ByteStringArray* sSuggestWords = new CFX_ByteStringArray;
CFX_PointF ptPopup;
ptPopup.x = x;
ptPopup.y = y;
pXFAMenuHander->GetSuggestWords((IXFA_Widget*)hWidget, ptPopup,
*sSuggestWords);
*stringHandle = (FPDF_STRINGHANDLE)sSuggestWords;
}
示例4: 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);
}
示例5: FPDF_Widget_ReplaceSpellCheckWord
DLLEXPORT void STDCALL
FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document,
FPDF_WIDGET hWidget,
float x,
float y,
FPDF_BYTESTRING bsText) {
if (NULL == hWidget || NULL == document)
return;
CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document;
if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic &&
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
IXFA_MenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander == NULL)
return;
CFX_PointF ptPopup;
ptPopup.x = x;
ptPopup.y = y;
CFX_ByteStringC bs(bsText);
pXFAMenuHander->ReplaceSpellCheckWord((IXFA_Widget*)hWidget, ptPopup, bs);
}
示例6: FPDF_Widget_GetSpellCheckWords
DLLEXPORT void STDCALL
FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document,
FPDF_WIDGET hWidget,
float x,
float y,
FPDF_STRINGHANDLE* stringHandle) {
if (!hWidget || !document)
return;
CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document;
if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic &&
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
IXFA_MenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (!pXFAMenuHander)
return;
std::vector<CFX_ByteString>* sSuggestWords = new std::vector<CFX_ByteString>;
CFX_PointF ptPopup;
ptPopup.x = x;
ptPopup.y = y;
pXFAMenuHander->GetSuggestWords(reinterpret_cast<IXFA_Widget*>(hWidget),
ptPopup, *sSuggestWords);
*stringHandle = ToFPDFStringHandle(sSuggestWords);
}
示例7: FPDF_Widget_Cut
DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document,
FPDF_WIDGET hWidget,
FPDF_WIDESTRING wsText,
FPDF_DWORD* size) {
if (NULL == hWidget || NULL == document)
return;
CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document;
if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic &&
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
IXFA_MenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander == NULL)
return;
CFX_WideString wsCpText;
pXFAMenuHander->Cut((IXFA_Widget*)hWidget, wsCpText);
CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode();
int len = bsCpText.GetLength() / sizeof(unsigned short);
if (wsText == NULL) {
*size = len;
return;
}
int real_size = len < *size ? len : *size;
if (real_size > 0) {
FXSYS_memcpy((void*)wsText,
bsCpText.GetBuffer(real_size * sizeof(unsigned short)),
real_size * sizeof(unsigned short));
bsCpText.ReleaseBuffer(real_size * sizeof(unsigned short));
}
*size = real_size;
}
示例8: FPDF_Widget_Cut
DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document,
FPDF_WIDGET hWidget,
FPDF_WIDESTRING wsText,
FPDF_DWORD* size) {
if (!hWidget || !document)
return;
CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document;
if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic &&
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
CFX_WideString wsCpText;
static_cast<CXFA_FFWidget*>(hWidget)->Cut(wsCpText);
CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode();
uint32_t len = bsCpText.GetLength() / sizeof(unsigned short);
if (!wsText) {
*size = len;
return;
}
uint32_t real_size = len < *size ? len : *size;
if (real_size > 0) {
FXSYS_memcpy((void*)wsText,
bsCpText.GetBuffer(real_size * sizeof(unsigned short)),
real_size * sizeof(unsigned short));
bsCpText.ReleaseBuffer(real_size * sizeof(unsigned short));
}
*size = real_size;
}
示例9: 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;
}
示例10: FPDF_Widget_SelectAll
DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document,
FPDF_WIDGET hWidget) {
if (!hWidget || !document)
return;
CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document;
if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic &&
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
static_cast<CXFA_FFWidget*>(hWidget)->SelectAll();
}
示例11: FPDF_Widget_Paste
DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document,
FPDF_WIDGET hWidget,
FPDF_WIDESTRING wsText,
FPDF_DWORD size) {
if (!hWidget || !document)
return;
CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document;
if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic &&
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
CFX_WideString wstr = CFX_WideString::FromUTF16LE(wsText, size);
static_cast<CXFA_FFWidget*>(hWidget)->Paste(wstr);
}
示例12: FPDF_Widget_SelectAll
DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document,
FPDF_WIDGET hWidget) {
if (NULL == hWidget || NULL == document)
return;
CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document;
if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic &&
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
IXFA_MenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander == NULL)
return;
pXFAMenuHander->SelectAll((IXFA_Widget*)hWidget);
}
示例13: FPDFText_LoadPage
DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) {
CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
if (!pPDFPage)
return nullptr;
#ifdef PDF_ENABLE_XFA
CPDFXFA_Page* pPage = (CPDFXFA_Page*)page;
CPDFXFA_Document* pDoc = pPage->GetDocument();
CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc());
#else // PDF_ENABLE_XFA
CPDF_ViewerPreferences viewRef(pPDFPage->m_pDocument);
#endif // PDF_ENABLE_XFA
CPDF_TextPage* textpage = new CPDF_TextPage(
pPDFPage, viewRef.IsDirectionR2L() ? FPDFText_Direction::Right
: FPDFText_Direction::Left);
textpage->ParseTextPage();
return textpage;
}
示例14: FPDF_Widget_Paste
DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document,
FPDF_WIDGET hWidget,
FPDF_WIDESTRING wsText,
FPDF_DWORD size) {
if (NULL == hWidget || NULL == document)
return;
CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document;
if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic &&
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
IXFA_MenuHandler* pXFAMenuHander =
CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
if (pXFAMenuHander == NULL)
return;
CFX_WideString wstr = CFX_WideString::FromUTF16LE(wsText, size);
pXFAMenuHander->Paste((IXFA_Widget*)hWidget, wstr);
}
示例15: FPDF_Widget_ReplaceSpellCheckWord
DLLEXPORT void STDCALL
FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document,
FPDF_WIDGET hWidget,
float x,
float y,
FPDF_BYTESTRING bsText) {
if (!hWidget || !document)
return;
CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document;
if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic &&
pDocument->GetDocType() != XFA_DOCTYPE_Static)
return;
CFX_PointF ptPopup;
ptPopup.x = x;
ptPopup.y = y;
CFX_ByteStringC bs(bsText);
static_cast<CXFA_FFWidget*>(hWidget)->ReplaceSpellCheckWord(ptPopup, bs);
}