Foxit PDF SDK
fsdk.AppProviderCallback Class Reference

Public Member Functions

def Beep (type)
 A callback function used to beep for specified beep type. More...
 
def DownLoadUrl (url)
 A callback function used to download from specified URL. More...
 
def GetAppInfo (app_info)
 A callback function used to get application information for a specified information type. More...
 
def LoadString (string_id)
 A callback function used to load a string in local language for a specified case. More...
 
def MsgBox (message, title, icon_type, button_type)
 A callback function used to set message box. More...
 
def PostRequestURL (url, data, content_type, encode, header)
 A callback function used to post data to the given URL. More...
 
def PutRequestURL (url, data, encode)
 A callback function used to put data to the given URL. More...
 
def Release ()
 A callback function used to release current callback object itself. More...
 
def Response (question, title, default_answer, is_mask)
 A callback function used to response. More...
 
def ShowFileDialog (string_title, string_filter, is_openfile_dialog)
 A callback function used to show file dialog. More...
 

Detailed Description

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

Member Function Documentation

◆ Beep()

def fsdk.AppProviderCallback.Beep (   type)

A callback function used to beep for specified beep type.

Parameters
[in]typeThe beep type. Please refer to values starting from fsdk.AppProviderCallbackE_BeepTypeError and this would be one of these values.
Returns
None.

◆ DownLoadUrl()

def fsdk.AppProviderCallback.DownLoadUrl (   url)

A callback function used to download from specified URL.

Parameters
[in]urlA URL to be downloaded.
Returns
A fsdk.FileReaderCallback object which can be used to read the downloading result.

◆ GetAppInfo()

def fsdk.AppProviderCallback.GetAppInfo (   app_info)

A callback function used to get application information for a specified information type.

Parameters
[in]app_infoThe type of application information, whose information is to retrieved. Please refer to values starting from fsdk.AppProviderCallbackE_AppInfoType and this would be one of these values.
Returns
A string of application information.

◆ LoadString()

def fsdk.AppProviderCallback.LoadString (   string_id)

A callback function used to load a string in local language for a specified case.

This function is very useful for user to use local language for message of specified cases. User can re-write or translate the sample message (which is defined in the comment of values starting from fsdk.AppProviderCallbackE_StringIDValidateFailed ) into local language for the specified case, and return the result string to Foxit PDF SDK. Specially, Foxit PDF SDK will add some necessary information/data to the format part in the sample message, in order to make the message more useful. User is recommended to keep these format part in the re-written or translated result string; otherwise, these information/data will not be lost and will not be added to the message offered by user.

Parameters
[in]string_idA string ID to specify a case. Please refer to values starting from fsdk.AppProviderCallbackE_StringIDValidateFailed and this would be one of these values.
Returns
A string used for the specified case.

◆ MsgBox()

def fsdk.AppProviderCallback.MsgBox (   message,
  title,
  icon_type,
  button_type 
)

A callback function used to set message box.

Parameters
[in]messageA message string.
[in]titleThe title of message box.
[in]icon_typeThe icon type for message box. Please refer to values starting from fsdk.AppProviderCallbackE_MsgBoxIconError and this would be one of these values.
[in]button_typeThe button type for message box. Please refer to values starting from fsdk.AppProviderCallbackE_MsgBtnTypeOK and this would be one of these values.
Returns
The button ID for message box. Please refer to values starting from fsdk.AppProviderCallbackE_MsgBtnIDOK and this should be one of these values.

◆ PostRequestURL()

def fsdk.AppProviderCallback.PostRequestURL (   url,
  data,
  content_type,
  encode,
  header 
)

A callback function used to post data to the given URL.

Parameters
[in]urlA URL, to which the data will be posted.
[in]dataThe data to be posted.
[in]content_typeA string that represents the content type of data. This string could be "text/html", "text/xml", "text/plain", "multipart/form-data", "application/x-www-form-urlencoded", "application/octet-stream", or any valid MIME type.
[in]encodeA string that represents the encoding of data. This string could be "UTF-8", "UTF-16", "ISO8859-1", or any recognized [IANA]character encoding.
[in]headerA string that represents any additional HTTP headers to be included in the post.
Returns
The response string.

◆ PutRequestURL()

def fsdk.AppProviderCallback.PutRequestURL (   url,
  data,
  encode 
)

A callback function used to put data to the given URL.

Parameters
[in]urlA URL, to which the data will be put.
[in]dataThe data to be put.
[in]encodeA string that represents the encoding of data. This string could be "UTF-8", "UTF-16", ISO8859-1", or any recognized [IANA]character encoding.
Returns
true means success, while false means failure.

◆ Release()

def fsdk.AppProviderCallback.Release ( )

A callback function used to release current callback object itself.

Returns
None.

◆ Response()

def fsdk.AppProviderCallback.Response (   question,
  title,
  default_answer,
  is_mask 
)

A callback function used to response.

Parameters
[in]questionA string that represents the question.
[in]titleA string that represents the title.
[in]default_answerA string that represents the default answer. It could be an empty string which means no default answer.
[in]is_masktrue means the answer should be masked by '*', while false means the answer does not need to be masked by '*'.
Returns
A string that represents the response answer.

◆ ShowFileDialog()

def fsdk.AppProviderCallback.ShowFileDialog (   string_title,
  string_filter,
  is_openfile_dialog 
)

A callback function used to show file dialog.

Parameters
[in]string_titleA string that represents the dialog title.
[in]string_filterA string that represents the dialog file filter.
[in]is_openfile_dialogtrue means the dialog is an open-file-dialog, while false means the dialog is a save-as-dialog.
Returns
An array of file paths.