Foxit PDF SDK
 All Classes Namespaces Functions Enumerations Enumerator Properties Pages
foxit.addon.xfa.DocProviderCallback Class Reference

Inherits SystemIDisposable.

Public Types

enum  InvalidateFlag { InvalidateFlag.e_InvalidateFlagAllPages = 0, InvalidateFlag.e_InvalidateFlagCurrentPage = 1 }
 Enumeration for XFA invalidate flag. More...
 
enum  PageViewEventType { PageViewEventType.e_PageViewEventTypeAdded = 0, PageViewEventType.e_PageViewEventTypeRemoved = 1, PageViewEventType.e_PageViewEventTypeAllRemoved = 2 }
 Enumeration for the event type of page view. More...
 
enum  PrintOption {
  PrintOption.e_PrintOptionShowDialog = 0x00000001, PrintOption.e_PrintOptionCanCancel = 0x00000002, PrintOption.e_PrintOptionShrinkPage = 0x00000004, PrintOption.e_PrintOptionAsImage = 0x00000008,
  PrintOption.e_PrintOptionReverseOrder = 0x00000010, PrintOption.e_PrintOptionPrintAnnot = 0x00000020
}
 Enumeration for XFA print options. More...
 
enum  SubmitFormat {
  SubmitFormat.e_SubmitInXDP = 0, SubmitFormat.e_SubmitInPDF = 1, SubmitFormat.e_SubmitInUrlEncoded = 2, SubmitFormat.e_SubmitInXFD = 3,
  SubmitFormat.e_SubmitInXML = 4
}
 Enumeration for XFA submit format. More...
 
enum  TextEncoding {
  TextEncoding.e_TextEncodingNone = 0, TextEncoding.e_TextEncodingBig5 = 1, TextEncoding.e_TextEncodingFontSpecific = 2, TextEncoding.e_TextEncodingGBK = 3,
  TextEncoding.e_TextEncodingGB18030 = 4, TextEncoding.e_TextEncodingGB2312 = 5, TextEncoding.e_TextEncodingISO8859NN = 6, TextEncoding.e_TextEncodingKSC5601 = 7,
  TextEncoding.e_TextEncodingShiftJIS = 8, TextEncoding.e_TextEncodingUCS2 = 9, TextEncoding.e_TextEncodingUTF16 = 10, TextEncoding.e_TextEncodingUTF8 = 11
}
 Enumeration for text encoding for XFA submit. More...
 
enum  WidgetEventType { WidgetEventType.e_WidgetEventTypeAdded = 0, WidgetEventType.e_WidgetEventTypeBeforeRemoved = 1 }
 Enumeration for the type of XFA widget event. More...
 

Public Member Functions

virtual void DisplayCaret (int page_index, bool is_visible, RectF rect)
 A callback function used to display or hide caret. More...
 
virtual void ExportData (XFADoc doc, string file_path)
 A callback function used to export data to file. More...
 
virtual int GetCurrentPage (XFADoc doc)
 A callback function used to get index of current page. More...
 
virtual uint GetHighlightColor (XFADoc doc)
 A callback function get the highlight color. More...
 
virtual bool 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...
 
virtual string GetTitle (XFADoc doc)
 A callback function used to get title of current XFA document. More...
 
virtual void GotoURL (XFADoc doc, string url)
 A callback function used to go to a specified URL. More...
 
virtual void ImportData (XFADoc doc, string file_path)
 A callback function used to import data from file. More...
 
virtual void InvalidateRect (int page_index, RectF rect, DocProviderCallback.InvalidateFlag flag)
 A callback function used to invalidate rectangle according the flag. More...
 
virtual void PageViewEvent (int page_index, DocProviderCallback.PageViewEventType page_view_event_type)
 A callback function to execute page view event. More...
 
virtual bool PopupMenu (int page_index, PointF rect_popup)
 A callback function used to pop up the context menu. More...
 
virtual void Print (XFADoc doc, int start_page_index, int end_page_index, int options)
 A callback function used to print. More...
 
virtual void Release ()
 A callback function used to release current callback object itself. More...
 
virtual void SetChangeMark (XFADoc doc)
 A callback function used to set change mark flag to current XFA document. More...
 
virtual void SetCurrentPage (XFADoc doc, int current_page_index)
 A callback function used to set index of current page. More...
 
virtual void SetFocus (XFAWidget xfa_widget)
 A callback function used to set focus widget. More...
 
virtual bool SubmitData (XFADoc doc, string target, DocProviderCallback.SubmitFormat format, DocProviderCallback.TextEncoding text_encoding, string content)
 A callback function to submit data. More...
 
virtual void WidgetEvent (XFAWidget xfa_widget, DocProviderCallback.WidgetEventType widget_event_type)
 A callback function to execute XFA widget event. More...
 

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 Enumeration Documentation

Enumeration for XFA invalidate flag.

Values of this enumeration should be used alone.

Enumerator
e_InvalidateFlagAllPages 

Invalidate all pages.

e_InvalidateFlagCurrentPage 

Invalidate current page.

Enumeration for the event type of page view.

Values of this enumeration should be used alone.

Enumerator
e_PageViewEventTypeAdded 

Event type: after a page view is added.

e_PageViewEventTypeRemoved 

Event type: after a page view is removed.

e_PageViewEventTypeAllRemoved 

Event type: all page views are removed.

Enumeration for XFA print options.

Values of this enumeration should be used alone.

Enumerator
e_PrintOptionShowDialog 

If set, show printing dialog box.

e_PrintOptionCanCancel 

If set, that means printing process can be canceled.

e_PrintOptionShrinkPage 

If set, shrink page to fit within content area.

e_PrintOptionAsImage 

If set, print page as image; otherwise, as text.

e_PrintOptionReverseOrder 

If set, print page in reverse order; otherwise, in normal order.

e_PrintOptionPrintAnnot 

If set, print annotations.

Enumeration for XFA submit format.

Values of this enumeration should be used alone.

Enumerator
e_SubmitInXDP 

The submit data is packaged in XDP format, as described in XDP Specification.

e_SubmitInPDF 

The submit data is packaged in PDF format as described in the PDF Reference.

e_SubmitInUrlEncoded 

The submit data is packaged in URL-encoded format as described in Uniform Resource Locator(URL).

e_SubmitInXFD 

The submit data is packaged in XFD format, as described in XFDF.

e_SubmitInXML 

The submit data is translated and packaged into an URL-Encoded format.

Enumeration for text encoding for XFA submit.

Values of this enumeration should be used alone.

Enumerator
e_TextEncodingNone 

No text encoding.

e_TextEncodingBig5 

Text encoding: Big5.

e_TextEncodingFontSpecific 

Text encoding: font specific.

e_TextEncodingGBK 

Text encoding: GBK.

e_TextEncodingGB18030 

Text encoding: GB18030.

e_TextEncodingGB2312 

Text encoding: GB2312.

e_TextEncodingISO8859NN 

Text encoding: ISO8859NN.

e_TextEncodingKSC5601 

Text encoding: KSC5601.

e_TextEncodingShiftJIS 

Text encoding: ShiftJIS.

e_TextEncodingUCS2 

Text encoding: UCS-2.

e_TextEncodingUTF16 

Text encoding: UTF-16.

e_TextEncodingUTF8 

Text encoding: UTF-8.

Enumeration for the type of XFA widget event.

Values of this enumeration should be used alone.

Enumerator
e_WidgetEventTypeAdded 

Event type: after an XFA widget is added.

e_WidgetEventTypeBeforeRemoved 

Event type: before an XFA widget is removed.

Member Function Documentation

void foxit.addon.xfa.DocProviderCallback.DisplayCaret ( int  page_index,
bool  is_visible,
RectF  rect 
)
inlinevirtual

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.
void foxit.addon.xfa.DocProviderCallback.ExportData ( XFADoc  doc,
string  file_path 
)
inlinevirtual

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.
int foxit.addon.xfa.DocProviderCallback.GetCurrentPage ( XFADoc  doc)
inlinevirtual

A callback function used to get index of current page.

Parameters
[in]docCurrent XFA document.
Returns
The index of current page.
uint foxit.addon.xfa.DocProviderCallback.GetHighlightColor ( XFADoc  doc)
inlinevirtual

A callback function get the highlight color.

Parameters
[in]docCurrent XFA document.
Returns
The highlight color.
bool foxit.addon.xfa.DocProviderCallback.GetPopupPos ( int  page_index,
float  min_popup,
float  max_popup,
RectF  rect_widget,
RectF  inout_rect_popup 
)
inlinevirtual

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.
string foxit.addon.xfa.DocProviderCallback.GetTitle ( XFADoc  doc)
inlinevirtual

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

Parameters
[in]docCurrent XFA document.
Returns
The title.
void foxit.addon.xfa.DocProviderCallback.GotoURL ( XFADoc  doc,
string  url 
)
inlinevirtual

A callback function used to go to a specified URL.

Parameters
[in]docCurrent XFA document.
[in]urlA URL string.
Returns
None.
void foxit.addon.xfa.DocProviderCallback.ImportData ( XFADoc  doc,
string  file_path 
)
inlinevirtual

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.
void foxit.addon.xfa.DocProviderCallback.InvalidateRect ( int  page_index,
RectF  rect,
DocProviderCallback.InvalidateFlag  flag 
)
inlinevirtual

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 foxit.addon.xfa.DocProviderCallback.InvalidateFlag.e_InvalidateFlagAllPages and this would be one of these values.
Returns
None.
void foxit.addon.xfa.DocProviderCallback.PageViewEvent ( int  page_index,
DocProviderCallback.PageViewEventType  page_view_event_type 
)
inlinevirtual

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 foxit.addon.xfa.DocProviderCallback.PageViewEventType.e_PageViewEventTypeAdded and this would be one of these values.
Returns
None.
bool foxit.addon.xfa.DocProviderCallback.PopupMenu ( int  page_index,
PointF  rect_popup 
)
inlinevirtual

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.
void foxit.addon.xfa.DocProviderCallback.Print ( XFADoc  doc,
int  start_page_index,
int  end_page_index,
int  options 
)
inlinevirtual

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 foxit.addon.xfa.DocProviderCallback.PrintOption.e_PrintOptionShowDialog and this would be one or a combination of these values.
Returns
None.
void foxit.addon.xfa.DocProviderCallback.Release ( )
inlinevirtual

A callback function used to release current callback object itself.

Returns
None.
void foxit.addon.xfa.DocProviderCallback.SetChangeMark ( XFADoc  doc)
inlinevirtual

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

Parameters
[in]docCurrent XFA document.
Returns
None.
void foxit.addon.xfa.DocProviderCallback.SetCurrentPage ( XFADoc  doc,
int  current_page_index 
)
inlinevirtual

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.
void foxit.addon.xfa.DocProviderCallback.SetFocus ( XFAWidget  xfa_widget)
inlinevirtual

A callback function used to set focus widget.

Parameters
[in]xfa_widgetAn XFA widget to be set focus on.
Returns
None.
bool foxit.addon.xfa.DocProviderCallback.SubmitData ( XFADoc  doc,
string  target,
DocProviderCallback.SubmitFormat  format,
DocProviderCallback.TextEncoding  text_encoding,
string  content 
)
inlinevirtual

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 foxit.addon.xfa.DocProviderCallback.SubmitFormat.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 foxit.addon.xfa.DocProviderCallback.TextEncoding.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.
void foxit.addon.xfa.DocProviderCallback.WidgetEvent ( XFAWidget  xfa_widget,
DocProviderCallback.WidgetEventType  widget_event_type 
)
inlinevirtual

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 foxit.addon.xfa.DocProviderCallback.WidgetEventType.e_WidgetEventTypeAdded and this would be one of these values.
Returns
None.