Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
FSDK.AppProviderCallback Class Reference

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

## Static Public Attributes
static | e_AppInfoLanguage
| Application information: language.
static | e_AppInfoName
| Application information: name.
static | e_AppInfoPlatform
| Application information: platform.
static | e_AppInfoType
| Application information: type.
static | e_AppInfoVariation
| Application information: variation.
static | e_AppInfoVersion
| Enumeration for XFA application information type. More...
static | e_BeepTypeDefault
| Beep type: default.
static | e_BeepTypeError
| Enumeration for XFA beep type. More...
static | e_BeepTypeQuestion
| Beep type: question.
static | e_BeepTypeStatus
| Beep type: status.
static | e_BeepTypeWarning
| Beep type: warning.
static | e_MsgBoxIconError
| Enumeration for icon type of XFA message box. More...
static | e_MsgBoxIconQuestion
| Message box icon: Question.
static | e_MsgBoxIconStatus
| Message box icon: Status.
static | e_MsgBoxIconWarning
| Message box icon: Warning.
static | e_MsgBtnIDCancel
| Message box button ID: Cancel.
static | e_MsgBtnIDNo
| Message box button ID: No.
static | e_MsgBtnIDOK
| Enumeration for button ID of XFA message box. More...
static | e_MsgBtnIDYes
| Message box button ID: Yes.
static | e_MsgBtnTypeOK
| Enumeration for button type of XFA message box. More...
static | e_MsgBtnTypeOKCancel
| Message box button: OK and Cancel.
static | e_MsgBtnTypeYesNo
| Message box button: Yes and No.
static | e_MsgBtnTypeYesNoCancel
| Message box button: Yes, No and Cancel.
static | e_StringIDAccessProertyInNotObject
| Sample message: "An attempt was made to reference property '%s' of a non-object in SOM expression %s".
static | e_StringIDAppName
| String ID for case: Application's name. Sample message: "Foxit Phantom".
static | e_StringIDArgumentExpectContainer
| Sample message: "'%s' argument is expected to be a container".
static | e_StringIDArgumentMismatch
| Sample message: "Argument mismatch in property or function argument".
static | e_StringIDArgumentNotArray
| Sample message: "'%s' function's %d argument cannot be array".
static | e_StringIDBadSuffix
| Sample message: "Bad suffix on number".
static | e_StringIDCalcOverride
| Sample message: "Calculate Override".
static | e_StringIDCannotAssign
| Sample message: "Cannot assign to '%s'".
static | e_StringIDCannotCovertToObject
| Sample message: "%s.%s cannot covert to object".
static | e_StringIDCannotModifyValue
| Sample message: "Cannot modify the '%s' value".
static | e_StringIDCompilerError
| Sample message: "Compiler error".
static | e_StringIDConditionIsNull
| Sample message: "Condition is null".
static | e_StringIDDivideZero
| Sample message: "Divide by zero".
static | e_StringIDErrorMessage
| Sample message: "%s : %s".
static | e_StringIDExpectedEndIf
| Sample message: "Expected 'endif' instead of '%s'".
static | e_StringIDExpectedIdent
| Sample message: "Expected identifier instead of '%s'".
static | e_StringIDExpectedNumber
| Sample message: "Expected number instead of '%s'".
static | e_StringIDExpectedOperator
| Sample message: "Expected operator '%s' instead of '%s'".
static | e_StringIDExpectedString
| Sample message: "Expected '%s' instead of '%s'".
static | e_StringIDFunctionBuildIn
| Sample message: "Function 's' is built-in.
static | e_StringIDIllegalBreak
| Sample message: "Illegal break".
static | e_StringIDIllegalContinue
| Sample message: "Illegal continue".
static | e_StringIDImageFilter
| String ID for case: Filter for image files. Sample message: "Image Files(*.bmp;*.jpg;*.png;*.gif;*.tif)|*.bmp;*.jpg;*.png;*.gif;*.tif|All Files(*.*)|*.*||".
static | e_StringIDIncorrectNumberOfMethod
| Sample message: "Incorrect number of parameters are used when calling method '%s'".
static | e_StringIDIndexValueOutOfBounds
| Sample message: "Index value is out of bounds".
static | e_StringIDInvalidAppend
| Sample message: "Invalid append operation: %s cannot have a child element of %s".
static | e_StringIDInvalidateChar
| Sample message: "Invalidate character '%c'".
static | e_StringIDInvalidateInstruction
| Sample message: "Invalidate instruction".
static | e_StringIDInvalidateLeftValue
| Sample message: "Invalidate left-value '%s'".
static | e_StringIDInvalidBarcodeValue
| Sample message: "Invalid Barcode Value: %s is an invalid value for barcodes of type %s.".
static | e_StringIDInvalidEnumerate
| Sample message: "Invalid enumerated value: %s".
static | e_StringIDInvalidEnumValue
| String ID for case: Some enumerate value is invalid. Sample message: "Invalid enumerate value:".
static | e_StringIDInvalidExpression
| Sample message: "Invalidate expression '%s'".
static | e_StringIDInvalidNodeType
| Sample message: "Invalid node type: '%s'".
static | e_StringIDInvalidPropertySetOperation
| String ID for case: Some setting operation to property is invalid. Sample message: "Invalid property setting operation:".
static | e_StringIDInvalidToken
| Sample message: "Invalidate token '%s'".
static | e_StringIDIsNotArray
| Sample message: "'%s' is not an array".
static | e_StringIDModifyField
| String ID for case: If to modify field. Sample message: "Do you want to modify this field?".
static | e_StringIDMonthApril
| String ID for case: Use string in local language for "April".
static | e_StringIDMonthAug
| String ID for case: Use string in local language for "August".
static | e_StringIDMonthDec
| String ID for case: Use string in local language for "December".
static | e_StringIDMonthFeb
| String ID for case: Use string in local language for "February".
static | e_StringIDMonthJan
| String ID for case: Use string in local language for "January".
static | e_StringIDMonthJuly
| String ID for case: Use string in local language for "July".
static | e_StringIDMonthJune
| String ID for case: Use string in local language for "June".
static | e_StringIDMonthMarch
| String ID for case: Use string in local language for "March".
static | e_StringIDMonthMay
| String ID for case: Use string in local language for "May".
static | e_StringIDMonthNov
| String ID for case: Use string in local language for "November".
static | e_StringIDMonthOct
| String ID for case: Use string in local language for "October".
static | e_StringIDMonthSep
| String ID for case: Use string in local language for "September".
static | e_StringIDNotAssignObject
| Sample message: "Cannot directly assign the value to object".
static | e_StringIDNotDefaultValue
| Sample message: "Not have a default property".
static | e_StringIDNotFoundConst
| Sample message: "Cannot find const '%s'".
static | e_StringIDNotFoundContainer
| Sample message: "Cannot find container '%s'".
static | e_StringIDNotFoundFunction
| Sample message: "Cannot find function '%s'".
static | e_StringIDNotFoundMethod
| Sample message: "Cannot find method '%s'".
static | e_StringIDNotFoundProperty
| Sample message: "Cannot find property '%s'".
static | e_StringIDNotHaveProperty
| Sample message: "'%s' doesn't have property '%s'".
static | e_StringIDNotModifyField
| String ID for case: Not allow to modify field. Sample message: "You are not allowed to modify this field.".
static | e_StringIDNotSupportArrayCalculate
| Sample message: "'%s' operator cannot support array calculation".
static | e_StringIDNumberOfOccur
| Sample message: "The element [%s] has violated its allowable number of occurrences".
static | e_StringIDOutOfArrayRange
| Sample message: "Out of the range of '%s' array".
static | e_StringIDParametersError
| Sample message: "Function '%s' does not have %d parameters".
static | e_StringIDRedefinition
| Sample message: "'%s' redefinition".
static | e_StringIDScriptArgumentMismatch
| Sample message: "Error:Argument mismatch in property or function argument.".
static | e_StringIDScriptFailedError
| Sample message: "Script failed(language is %s;context is %s) script=%s".
static | e_StringIDScriptInvalidValue
| Sample message: "Error:Invalid enumerated value:%s".
static | e_StringIDServerDeny
| String ID for case: Server denies. Sample message: "Server does not permit".
static | e_StringIDSOMExpectedList
| Sample message: "SOM expression returned list when single result was expected".
static | e_StringIDSubmitValidateNullError
| Sample message: "At least one required field was empty. Please fill in the required fields(highlighted) before continuing.".
static | e_StringIDToday
| String ID for case: Use string in local language for "Today".
static | e_StringIDUnableSetClassName
| Sample message: "Unable to set the value for property 'className'".
static | e_StringIDUnableSetLanguage
| Sample message: "Unable to set the value for property 'language'".
static | e_StringIDUnableSetLengthValue
| Sample message: "Unable to set the value for property 'length'".
static | e_StringIDUnableSetNumPages
| Sample message: "Unable to set the value for property 'numPages'".
static | e_StringIDUnableSetPlatformValue
| Sample message: "Unable to set the value for property 'platform'".
static | e_StringIDUnableSetReady
| Sample message: "Unable to set the value for property 'ready'".
static | e_StringIDUnableSetValidationsEnabledValue
| Sample message: "Unable to set the value for property 'validationsEnabled'".
static | e_StringIDUnableSetValidationsValue
| Sample message: "Unable to set the value for property 'variation'".
static | e_StringIDUnableSetVersion
| Sample message: "Unable to set the value for property 'version'".
static | e_StringIDUnableToSet
| Sample message: "Unable to set".
static | e_StringIDUndefineIdentifier
| Sample message: "Undefined identifier '%s'".
static | e_StringIDUnexpectedExpression
| Sample message: "Unexpected expression '%s'".
static | e_StringIDUnknownCaught
| Sample message: "Unknown error is caught!".
static | e_StringIDUnsupportChar
| Sample message: "Unsupported character '%c'".
static | e_StringIDUnsupportMethod
| Sample message: "Unsupported method %s.".
static | e_StringIDUnsupportProperty
| Sample message: "Unsupported property %s.".
static | e_StringIDValidateError
| Sample message: "The value you entered for %s is invalid.".
static | e_StringIDValidateFailed
| Enumeration for string ID used to specify a case. More...
static | e_StringIDValidateLimit
| Sample message: "Message limit exceeded. Remaining %d validation errors not reported.".
static | e_StringIDValidateNullError
| Sample message: "%s cannot be left blank.".
static | e_StringIDValidateNullWarning
| Sample message: "%s cannot be left blank. To ignore validations for %s, click Ignore.".
static | e_StringIDValidateNumberError
| Sample message: "Illegal value:cannot assign '%s' to %s.".
static | e_StringIDValidateOutOfArray
| Sample message: "Validate access index '%s' out of array".
static | e_StringIDValidateWarning
| Sample message: "The value you entered for %s is invalid. To ignore validations for %s, click Ignore.".
static | e_StringIDValueExcalmatory
| Sample message: "Value!".
static | e_StringIDViolateBoundary
| Sample message: "The element [%s] has violated its allowable number of occurrences".
static | e_StringIDWeekDayFri
| String ID for case: Use string in local language for "Friday".
static | e_StringIDWeekDayMon
| String ID for case: Use string in local language for "Monday".
static | e_StringIDWeekDaySat
| String ID for case: Use string in local language for "Saturday".
static | e_StringIDWeekDaySun
| String ID for case: Use string in local language for "Sunday".
static | e_StringIDWeekDayThu
| String ID for case: Use string in local language for "Thursday".
static | e_StringIDWeekDayTue
| String ID for case: Use string in local language for "Tuesday".
static | e_StringIDWeekDayWed
| String ID for case: Use string in local language for "Wednesday".

## 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()

FSDK.AppProviderCallback.Beep | ( | type |  | ) |

A callback function used to beep for specified beep type.

Parameters

  [in] | type | The beep type. Please refer to values starting from FSDK.AppProviderCallback.e_BeepTypeError and this would be one of these values.

Returns
  None.

## ◆ DownLoadUrl()

FSDK.AppProviderCallback.DownLoadUrl | ( | url |  | ) |

A callback function used to download from specified URL.

Parameters

  [in] | url | A URL to be downloaded.

Returns
  A FSDK.FileReaderCallback object which can be used to read the downloading result.

## ◆ GetAppInfo()

FSDK.AppProviderCallback.GetAppInfo | ( | app_info |  | ) |

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

Parameters

  [in] | app_info | The type of application information, whose information is to retrieved. Please refer to values starting from FSDK.AppProviderCallback.e_AppInfoType and this would be one of these values.

Returns
  A string of application information.

## ◆ LoadString()

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.AppProviderCallback.e_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_id | A string ID to specify a case. Please refer to values starting from FSDK.AppProviderCallback.e_StringIDValidateFailed and this would be one of these values.

Returns
  A string used for the specified case.

## ◆ MsgBox()

FSDK.AppProviderCallback.MsgBox | ( | message | ,
|  | title | ,
|  | icon_type | ,
|  | button_type |
| ) |  |

A callback function used to set message box.

Parameters

  [in] | message | A message string.
  [in] | title | The title of message box.
  [in] | icon_type | The icon type for message box. Please refer to values starting from FSDK.AppProviderCallback.e_MsgBoxIconError and this would be one of these values.
  [in] | button_type | The button type for message box. Please refer to values starting from FSDK.AppProviderCallback.e_MsgBtnTypeOK and this would be one of these values.

Returns
  The button ID for message box. Please refer to values starting from FSDK.AppProviderCallback.e_MsgBtnIDOK and this should be one of these values.

## ◆ PostRequestURL()

FSDK.AppProviderCallback.PostRequestURL | ( | url | ,
|  | data | ,
|  | content_type | ,
|  | encode | ,
|  | header |
| ) |  |

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

Parameters

  [in] | url | A URL, to which the data will be posted.
  [in] | data | The data to be posted.
  [in] | content_type | A 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] | encode | A string that represents the encoding of data. This string could be "UTF-8", "UTF-16", "ISO8859-1", or any recognized [IANA]character encoding.
  [in] | header | A string that represents any additional HTTP headers to be included in the post.

Returns
  The response string.

## ◆ PutRequestURL()

FSDK.AppProviderCallback.PutRequestURL | ( | url | ,
|  | data | ,
|  | encode |
| ) |  |

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

Parameters

  [in] | url | A URL, to which the data will be put.
  [in] | data | The data to be put.
  [in] | encode | A 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()

FSDK.AppProviderCallback.Release | ( |  | ) |

A callback function used to release current callback object itself.

Returns
  None.

## ◆ Response()

FSDK.AppProviderCallback.Response | ( | question | ,
|  | title | ,
|  | default_answer | ,
|  | is_mask |
| ) |  |

A callback function used to response.

Parameters

  [in] | question | A string that represents the question.
  [in] | title | A string that represents the title.
  [in] | default_answer | A string that represents the default answer. It could be an empty string which means no default answer.
  [in] | is_mask | true 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()

FSDK.AppProviderCallback.ShowFileDialog | ( | string_title | ,
|  | string_filter | ,
|  | is_openfile_dialog |
| ) |  |

A callback function used to show file dialog.

Parameters

  [in] | string_title | A string that represents the dialog title.
  [in] | string_filter | A string that represents the dialog file filter.
  [in] | is_openfile_dialog | true means the dialog is an open-file-dialog, while false means the dialog is a save-as-dialog.

Returns
  An array of file paths.

## Member Data Documentation

## ◆ e_AppInfoVersion

FSDK.AppProviderCallback.e_AppInfoVersion
| static

Enumeration for XFA application information type.

Values of this enumeration should be used alone.

Application information: version.

## ◆ e_BeepTypeError

FSDK.AppProviderCallback.e_BeepTypeError
| static

Enumeration for XFA beep type.

Values of this enumeration should be used alone.

Beep type: error.

## ◆ e_MsgBoxIconError

FSDK.AppProviderCallback.e_MsgBoxIconError
| static

Enumeration for icon type of XFA message box.

Values of this enumeration should be used alone.

Message box icon: Error.

## ◆ e_MsgBtnIDOK

FSDK.AppProviderCallback.e_MsgBtnIDOK
| static

Enumeration for button ID of XFA message box.

Values of this enumeration should be used alone.

Message box button ID: OK.

## ◆ e_MsgBtnTypeOK

FSDK.AppProviderCallback.e_MsgBtnTypeOK
| static

Enumeration for button type of XFA message box.

Values of this enumeration should be used alone.

Message box button: OK.

## ◆ e_StringIDValidateFailed

FSDK.AppProviderCallback.e_StringIDValidateFailed
| static

Enumeration for string ID used to specify a case.

Values of this enumeration should be used alone.

Sample message: "Validate failed".