Foxit PDF SDK
com.foxit.sdk.addon.xfa.DocProviderCallback Class Reference

Public Member Functions

void displayCaret (int page_index, boolean is_visible, RectF rect)
 A callback function used to display or hide caret.
More...
 
void exportData (XFADoc doc, String file_path)
 A callback function used to export data to file.
More...
 
int getCurrentPage (XFADoc doc)
 A callback function used to get index of current page.
More...
 
long getHighlightColor (XFADoc doc)
 A callback function get the highlight color.
More...
 
boolean getPopupPos (int page_index, float min_popup, float max_popup, RectF rect_widget, RectF inout_rect_popup)
 A callback function used to get the pop-up position.
More...
 
String getTitle (XFADoc doc)
 A callback function used to get title of current XFA document.
More...
 
void gotoURL (XFADoc doc, String url)
 A callback function used to go to a specified URL.
More...
 
void importData (XFADoc doc, String file_path)
 A callback function used to import data from file.
More...
 
void invalidateRect (int page_index, RectF rect, int flag)
 A callback function used to invalidate rectangle according the flag.
More...
 
void pageViewEvent (int page_index, int page_view_event_type)
 A callback function to execute page view event.
More...
 
boolean popupMenu (int page_index, PointF rect_popup)
 A callback function used to pop up the context menu.
More...
 
void print (XFADoc doc, int start_page_index, int end_page_index, int options)
 A callback function used to print.
More...
 
void release ()
 A callback function used to release current callback object itself.
More...
 
void setChangeMark (XFADoc doc)
 A callback function used to set change mark flag to current XFA document.
More...
 
void setCurrentPage (XFADoc doc, int current_page_index)
 A callback function used to set index of current page.
More...
 
void setFocus (XFAWidget xfa_widget)
 A callback function used to set focus widget.
More...
 
boolean submitData (XFADoc doc, String target, int format, int text_encoding, String content)
 A callback function to submit data.
More...
 
void widgetEvent (XFAWidget xfa_widget, int widget_event_type)
 A callback function to execute XFA widget event.
More...
 

Static Public Attributes

static final int e_InvalidateFlagAllPages = 0
 Invalidate all pages.

 
static final int e_InvalidateFlagCurrentPage = 1
 Invalidate current page.

 
static final int e_PageViewEventTypeAdded = 0
 Event type: after a page view is added.

 
static final int e_PageViewEventTypeAllRemoved = 2
 Event type: all page views are removed.

 
static final int e_PageViewEventTypeRemoved = 1
 Event type: after a page view is removed.

 
static final int e_PrintOptionAsImage = 0x00000008
 If set, print page as image; otherwise, as text.

 
static final int e_PrintOptionCanCancel = 0x00000002
 If set, that means printing process can be canceled.

 
static final int e_PrintOptionPrintAnnot = 0x00000020
 If set, print annotations.

 
static final int e_PrintOptionReverseOrder = 0x00000010
 If set, print page in reverse order; otherwise, in normal order.

 
static final int e_PrintOptionShowDialog = 0x00000001
 If set, show printing dialog box.

 
static final int e_PrintOptionShrinkPage = 0x00000004
 If set, shrink page to fit within content area.

 
static final int e_SubmitInPDF = 1
 The submit data is packaged in PDF format as described in the PDF Reference.

 
static final int e_SubmitInUrlEncoded = 2
 The submit data is packaged in URL-encoded format as described in Uniform Resource Locator(URL).

 
static final int e_SubmitInXDP = 0
 The submit data is packaged in XDP format, as described in XDP Specification.

 
static final int e_SubmitInXFD = 3
 The submit data is packaged in XFD format, as described in XFDF.

 
static final int e_SubmitInXML = 4
 The submit data is translated and packaged into an URL-Encoded format.

 
static final int e_TextEncodingBig5 = 1
 Text encoding: Big5.

 
static final int e_TextEncodingFontSpecific = 2
 Text encoding: font specific.

 
static final int e_TextEncodingGB18030 = 4
 Text encoding: GB18030.

 
static final int e_TextEncodingGB2312 = 5
 Text encoding: GB2312.

 
static final int e_TextEncodingGBK = 3
 Text encoding: GBK.

 
static final int e_TextEncodingISO8859NN = 6
 Text encoding: ISO8859NN.

 
static final int e_TextEncodingKSC5601 = 7
 Text encoding: KSC5601.

 
static final int e_TextEncodingNone = 0
 No text encoding.

 
static final int e_TextEncodingShiftJIS = 8
 Text encoding: ShiftJIS.

 
static final int e_TextEncodingUCS2 = 9
 Text encoding: UCS-2.

 
static final int e_TextEncodingUTF16 = 10
 Text encoding: UTF-16.

 
static final int e_TextEncodingUTF8 = 11
 Text encoding: UTF-8.

 
static final int e_WidgetEventTypeAdded = 0
 Event type: after an XFA widget is added.

 
static final int e_WidgetEventTypeBeforeRemoved = 1
 Event type: before an XFA widget is removed.

 

Detailed Description

This class represents a callback object as an XFA document provider. All the functions in this class are used as callback functions. Pure virtual functions should be implemented by user.

Member Function Documentation

◆ displayCaret()

void com.foxit.sdk.addon.xfa.DocProviderCallback.displayCaret ( int  page_index,
boolean  is_visible,
RectF  rect 
)

A callback function used to display or hide caret.

Parameters
[in]page_indexThe index of page.
[in]is_visibleUsed to decide whether the caret is visible or not: true means visible, while false means invisible.
[in]rectA rectangle.
Returns
None.

◆ exportData()

void com.foxit.sdk.addon.xfa.DocProviderCallback.exportData ( XFADoc  doc,
String  file_path 
)

A callback function used to export data to file.

Parameters
[in]docCurrent XFA document.
[in]file_pathA file path, to which the data should be exported. If this is an empty string, user should specify a path as the exported file path. In this case, application can show a dialog to user to let user select the file manually.
Returns
None.

◆ getCurrentPage()

int com.foxit.sdk.addon.xfa.DocProviderCallback.getCurrentPage ( XFADoc  doc)

A callback function used to get index of current page.

Parameters
[in]docCurrent XFA document.
Returns
The index of current page.

◆ getHighlightColor()

long com.foxit.sdk.addon.xfa.DocProviderCallback.getHighlightColor ( XFADoc  doc)

A callback function get the highlight color.

Parameters
[in]docCurrent XFA document.
Returns
The highlight color.

◆ getPopupPos()

boolean com.foxit.sdk.addon.xfa.DocProviderCallback.getPopupPos ( int  page_index,
float  min_popup,
float  max_popup,
RectF  rect_widget,
RectF  inout_rect_popup 
)

A callback function used to get the pop-up position.

Parameters
[in]page_indexThe index of page.
[in]min_popupThe minimum height of drop-down box.
[in]max_popupThe maximum height of drop-down box.
[in]rect_widgetThe rectangle of current widget.
[in,out]inout_rect_popupA rectangle. When this function calls, this is used as an input parameter that specifies the width of drop-down box. When this function returns, this is used as an output parameter that receives the height of drop-down box.
Returns
true means success, while false means failure.

◆ getTitle()

String com.foxit.sdk.addon.xfa.DocProviderCallback.getTitle ( XFADoc  doc)

A callback function used to get title of current XFA document.

Parameters
[in]docCurrent XFA document.
Returns
The title.

◆ gotoURL()

void com.foxit.sdk.addon.xfa.DocProviderCallback.gotoURL ( XFADoc  doc,
String  url 
)

A callback function used to go to a specified URL.

Parameters
[in]docCurrent XFA document.
[in]urlA URL string.
Returns
None.

◆ importData()

void com.foxit.sdk.addon.xfa.DocProviderCallback.importData ( XFADoc  doc,
String  file_path 
)

A callback function used to import data from file.

Parameters
[in]docCurrent XFA document.
[in]file_pathA file path, from which the data would be imported. If this is an empty string, user should specify a path as the imported file path. In this case, application can show a dialog to user to let user select the file manually.
Returns
None.

◆ invalidateRect()

void com.foxit.sdk.addon.xfa.DocProviderCallback.invalidateRect ( int  page_index,
RectF  rect,
int  flag 
)

A callback function used to invalidate rectangle according the flag.

This callback function would be used in dynamic XFA document.

Parameters
[in]page_indexThe index of page.
[in]rectA rectangle to be invalidate.
[in]flagInvalidate flag. Please refer to values starting from com.foxit.sdk.addon.xfa.DocProviderCallback.e_InvalidateFlagAllPages and this would be one of these values.
Returns
None.

◆ pageViewEvent()

void com.foxit.sdk.addon.xfa.DocProviderCallback.pageViewEvent ( int  page_index,
int  page_view_event_type 
)

A callback function to execute page view event.

Parameters
[in]page_indexThe page index.
[in]page_view_event_typePage view event type. Please refer to values starting from com.foxit.sdk.addon.xfa.DocProviderCallback.e_PageViewEventTypeAdded and this would be one of these values.
Returns
None.

◆ popupMenu()

boolean com.foxit.sdk.addon.xfa.DocProviderCallback.popupMenu ( int  page_index,
PointF  rect_popup 
)

A callback function used to pop up the context menu.

Parameters
[in]page_indexThe index of page.
[in]rect_popupThe rectangle where to pop up menu.
Returns
true means success, otherwise means failure.

◆ print()

void com.foxit.sdk.addon.xfa.DocProviderCallback.print ( XFADoc  doc,
int  start_page_index,
int  end_page_index,
int  options 
)

A callback function used to print.

Parameters
[in]docCurrent XFA document.
[in]start_page_indexThe index of start page.
[in]end_page_indexThe index of end page.
[in]optionsPrint options. Please refer to values starting from com.foxit.sdk.addon.xfa.DocProviderCallback.e_PrintOptionShowDialog and this would be one or a combination of these values.
Returns
None.

◆ release()

void com.foxit.sdk.addon.xfa.DocProviderCallback.release ( )

A callback function used to release current callback object itself.

Returns
None.

◆ setChangeMark()

void com.foxit.sdk.addon.xfa.DocProviderCallback.setChangeMark ( XFADoc  doc)

A callback function used to set change mark flag to current XFA document.

Parameters
[in]docCurrent XFA document.
Returns
None.

◆ setCurrentPage()

void com.foxit.sdk.addon.xfa.DocProviderCallback.setCurrentPage ( XFADoc  doc,
int  current_page_index 
)

A callback function used to set index of current page.

Parameters
[in]docCurrent XFA document.
[in]current_page_indexThe index would be set.
Returns
None.

◆ setFocus()

void com.foxit.sdk.addon.xfa.DocProviderCallback.setFocus ( XFAWidget  xfa_widget)

A callback function used to set focus widget.

Parameters
[in]xfa_widgetAn XFA widget to be set focus on.
Returns
None.

◆ submitData()

boolean com.foxit.sdk.addon.xfa.DocProviderCallback.submitData ( XFADoc  doc,
String  target,
int  format,
int  text_encoding,
String  content 
)

A callback function to submit data.

Parameters
[in]docCurrent XFA document.
[in]targetA string that represents the target of data to be submit.
[in]formatThe format of data to be submit. Please refer to values starting from com.foxit.sdk.addon.xfa.DocProviderCallback.e_SubmitInXDP and this would be one of these values.
[in]text_encodingThe text encoding of data to be submit. Please refer to values starting from com.foxit.sdk.addon.xfa.DocProviderCallback.e_TextEncodingNone and this would be one of these values.
[in]contentThe content of data to be submit.
Returns
true means success, otherwise means failure.

◆ widgetEvent()

void com.foxit.sdk.addon.xfa.DocProviderCallback.widgetEvent ( XFAWidget  xfa_widget,
int  widget_event_type 
)

A callback function to execute XFA widget event.

Parameters
[in]xfa_widgetAn XFA widget which sends the event.
[in]widget_event_typeWidget event type. Please refer to values starting from com.foxit.sdk.addon.xfa.DocProviderCallback.e_WidgetEventTypeAdded and this would be one of these values.
Returns
None.