Foxit PDF SDK

Public Types | Public Member Functions | List of all members
foxit::addon::xfa::AppProviderCallback Class Referenceabstract

## Public Types
enum | AppInfo { e_AppInfoVersion = 0x0, e_AppInfoLanguage = 0x01, e_AppInfoPlatform = 0x02, e_AppInfoVariation = 0x03, e_AppInfoName = 0x04, e_AppInfoType = 0x05 }
| Enumeration for XFA application information type. More...
enum | BeepType { e_BeepTypeError = 0, e_BeepTypeWarning = 1, e_BeepTypeQuestion = 2, e_BeepTypeStatus = 3, e_BeepTypeDefault = 4 }
| Enumeration for XFA beep type. More...
enum | MsgBoxButtonID { e_MsgBtnIDOK = 1, e_MsgBtnIDCancel = 2, e_MsgBtnIDNo = 3, e_MsgBtnIDYes = 4 }
| Enumeration for button ID of XFA message box. More...
enum | MsgBoxButtonType { e_MsgBtnTypeOK = 0, e_MsgBtnTypeOKCancel = 1, e_MsgBtnTypeYesNo = 2, e_MsgBtnTypeYesNoCancel = 3 }
| Enumeration for button type of XFA message box. More...
enum | MsgBoxIconType { e_MsgBoxIconError = 0, e_MsgBoxIconWarning = 1, e_MsgBoxIconQuestion = 2, e_MsgBoxIconStatus = 3 }
| Enumeration for icon type of XFA message box. More...
enum | StringID { e_StringIDValidateFailed = 1, e_StringIDCalcOverride = 2, e_StringIDModifyField = 3, e_StringIDNotModifyField = 4, e_StringIDAppName = 5, e_StringIDImageFilter = 6, e_StringIDUnknownCaught = 7, e_StringIDUnableToSet = 8, e_StringIDValueExcalmatory = 9, e_StringIDInvalidEnumValue = 10, e_StringIDUnsupportMethod = 11, e_StringIDUnsupportProperty = 12, e_StringIDInvalidPropertySetOperation = 13, e_StringIDNotDefaultValue = 14, e_StringIDUnableSetLanguage = 15, e_StringIDUnableSetNumPages = 16, e_StringIDUnableSetPlatformValue = 17, e_StringIDUnableSetValidationsEnabledValue = 18, e_StringIDUnableSetValidationsValue = 19, e_StringIDUnableSetVersion = 20, e_StringIDUnableSetReady = 21, e_StringIDNumberOfOccur = 22, e_StringIDUnableSetClassName = 23, e_StringIDUnableSetLengthValue = 24, e_StringIDUnsupportChar = 25, e_StringIDBadSuffix = 26, e_StringIDExpectedIdent = 27, e_StringIDExpectedString = 28, e_StringIDInvalidateChar = 29, e_StringIDRedefinition = 30, e_StringIDInvalidToken = 31, e_StringIDInvalidExpression = 32, e_StringIDUndefineIdentifier = 33, e_StringIDInvalidateLeftValue = 34, e_StringIDCompilerError = 35, e_StringIDCannotModifyValue = 36, e_StringIDParametersError = 37, e_StringIDExpectedEndIf = 38, e_StringIDUnexpectedExpression = 39, e_StringIDConditionIsNull = 40, e_StringIDIllegalBreak = 41, e_StringIDIllegalContinue = 42, e_StringIDExpectedOperator = 43, e_StringIDDivideZero = 44, e_StringIDCannotCovertToObject = 45, e_StringIDNotFoundContainer = 46, e_StringIDNotFoundProperty = 47, e_StringIDNotFoundMethod = 48, e_StringIDNotFoundConst = 49, e_StringIDNotAssignObject = 50, e_StringIDInvalidateInstruction = 51, e_StringIDExpectedNumber = 52, e_StringIDValidateOutOfArray = 53, e_StringIDCannotAssign = 54, e_StringIDNotFoundFunction = 55, e_StringIDIsNotArray = 56, e_StringIDOutOfArrayRange = 57, e_StringIDNotSupportArrayCalculate = 58, e_StringIDArgumentNotArray = 59, e_StringIDArgumentExpectContainer = 60, e_StringIDAccessProertyInNotObject = 61, e_StringIDFunctionBuildIn = 62, e_StringIDErrorMessage = 63, e_StringIDIndexValueOutOfBounds = 64, e_StringIDIncorrectNumberOfMethod = 65, e_StringIDArgumentMismatch = 66, e_StringIDInvalidEnumerate = 67, e_StringIDInvalidAppend = 68, e_StringIDSOMExpectedList = 69, e_StringIDNotHaveProperty = 70, e_StringIDInvalidNodeType = 71, e_StringIDViolateBoundary = 72, e_StringIDServerDeny = 73, e_StringIDWeekDaySun = 74, e_StringIDWeekDayMon = 75, e_StringIDWeekDayTue = 76, e_StringIDWeekDayWed = 77, e_StringIDWeekDayThu = 78, e_StringIDWeekDayFri = 79, e_StringIDWeekDaySat = 80, e_StringIDMonthJan = 81, e_StringIDMonthFeb = 82, e_StringIDMonthMarch = 83, e_StringIDMonthApril = 84, e_StringIDMonthMay = 85, e_StringIDMonthJune = 86, e_StringIDMonthJuly = 87, e_StringIDMonthAug = 88, e_StringIDMonthSep = 89, e_StringIDMonthOct = 90, e_StringIDMonthNov = 91, e_StringIDMonthDec = 92, e_StringIDToday = 93, e_StringIDValidateLimit = 94, e_StringIDValidateNullWarning = 95, e_StringIDValidateNullError = 96, e_StringIDValidateWarning = 97, e_StringIDValidateError = 98, e_StringIDValidateNumberError = 99, e_StringIDScriptFailedError = 100, e_StringIDScriptInvalidValue = 101, e_StringIDSubmitValidateNullError = 102, e_StringIDInvalidBarcodeValue = 103, e_StringIDScriptArgumentMismatch = 104 }
| Enumeration for string ID used to specify a case. More...

## Public Member Functions
virtual void | Beep (BeepType type)=0
| A callback function used to beep for specified beep type. More...
virtual common::file::ReaderCallback * | DownLoadUrl (const wchar_t *url)=0
| A callback function used to download from specified URL. More...
virtual WString | GetAppInfo (AppInfo app_info)=0
| A callback function used to get application information for a specified information type. More...
virtual WString | LoadString (StringID string_id)=0
| A callback function used to load a string in local language for a specified case. More...
virtual MsgBoxButtonID | MsgBox (const wchar_t *message, const wchar_t *title, MsgBoxIconType icon_type, MsgBoxButtonType button_type)=0
| A callback function used to set message box. More...
virtual WString | PostRequestURL (const wchar_t *url, const wchar_t *data, const wchar_t *content_type, const wchar_t *encode, const wchar_t *header)=0
| A callback function used to post data to the given URL. More...
virtual bool | PutRequestURL (const wchar_t *url, const wchar_t *data, const wchar_t *encode)=0
| A callback function used to put data to the given URL. More...
virtual void | Release ()=0
| A callback function used to release current callback object itself. More...
virtual WString | Response (const wchar_t *question, const wchar_t *title, const wchar_t *default_answer, bool is_mask)=0
| A callback function used to response. More...
virtual WStringArray | ShowFileDialog (const wchar_t *string_title, const wchar_t *string_filter, bool is_openfile_dialog)=0
| 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 Enumeration Documentation

## ◆ AppInfo

enum foxit::addon::xfa::AppProviderCallback::AppInfo

Enumeration for XFA application information type.

Values of this enumeration should be used alone.

Enumerator
e_AppInfoVersion | Application information: version.
e_AppInfoLanguage | Application information: language.
e_AppInfoPlatform | Application information: platform.
e_AppInfoVariation | Application information: variation.
e_AppInfoName | Application information: name.
e_AppInfoType | Application information: type.

## ◆ BeepType

enum foxit::addon::xfa::AppProviderCallback::BeepType

Enumeration for XFA beep type.

Values of this enumeration should be used alone.

Enumerator
e_BeepTypeError | Beep type: error.
e_BeepTypeWarning | Beep type: warning.
e_BeepTypeQuestion | Beep type: question.
e_BeepTypeStatus | Beep type: status.
e_BeepTypeDefault | Beep type: default.

## ◆ MsgBoxButtonID

enum foxit::addon::xfa::AppProviderCallback::MsgBoxButtonID

Enumeration for button ID of XFA message box.

Values of this enumeration should be used alone.

Enumerator
e_MsgBtnIDOK | Message box button ID: OK.
e_MsgBtnIDCancel | Message box button ID: Cancel.
e_MsgBtnIDNo | Message box button ID: No.
e_MsgBtnIDYes | Message box button ID: Yes.

## ◆ MsgBoxButtonType

enum foxit::addon::xfa::AppProviderCallback::MsgBoxButtonType

Enumeration for button type of XFA message box.

Values of this enumeration should be used alone.

Enumerator
e_MsgBtnTypeOK | Message box button: OK.
e_MsgBtnTypeOKCancel | Message box button: OK and Cancel.
e_MsgBtnTypeYesNo | Message box button: Yes and No.
e_MsgBtnTypeYesNoCancel | Message box button: Yes, No and Cancel.

## ◆ MsgBoxIconType

enum foxit::addon::xfa::AppProviderCallback::MsgBoxIconType

Enumeration for icon type of XFA message box.

Values of this enumeration should be used alone.

Enumerator
e_MsgBoxIconError | Message box icon: Error.
e_MsgBoxIconWarning | Message box icon: Warning.
e_MsgBoxIconQuestion | Message box icon: Question.
e_MsgBoxIconStatus | Message box icon: Status.

## ◆ StringID

enum foxit::addon::xfa::AppProviderCallback::StringID

Enumeration for string ID used to specify a case.

Values of this enumeration should be used alone.

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

## Member Function Documentation

## ◆ Beep()

virtual void foxit::addon::xfa::AppProviderCallback::Beep | ( | BeepType | type | ) |
| pure virtual

A callback function used to beep for specified beep type.

Parameters

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

Returns
  None.

## ◆ DownLoadUrl()

virtual common::file::ReaderCallback* foxit::addon::xfa::AppProviderCallback::DownLoadUrl | ( | const wchar_t * | url | ) |
| pure virtual

A callback function used to download from specified URL.

Parameters

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

Returns
  A common::file::ReaderCallback object which can be used to read the downloading result.

## ◆ GetAppInfo()

virtual WString foxit::addon::xfa::AppProviderCallback::GetAppInfo | ( | AppInfo | app_info | ) |
| pure virtual

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 AppProviderCallback::e_AppInfoType and this would be one of these values.

Returns
  A string of application information.

## ◆ LoadString()

virtual WString foxit::addon::xfa::AppProviderCallback::LoadString | ( | StringID | string_id | ) |
| pure virtual

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 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 AppProviderCallback::e_StringIDValidateFailed and this would be one of these values.

Returns
  A string used for the specified case.

## ◆ MsgBox()

virtual MsgBoxButtonID foxit::addon::xfa::AppProviderCallback::MsgBox | ( | const wchar_t * | message,
|  | const wchar_t * | title,
|  | MsgBoxIconType | icon_type,
|  | MsgBoxButtonType | button_type
| ) |  |
| pure virtual

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 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 AppProviderCallback::e_MsgBtnTypeOK and this would be one of these values.

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

## ◆ PostRequestURL()

virtual WString foxit::addon::xfa::AppProviderCallback::PostRequestURL | ( | const wchar_t * | url,
|  | const wchar_t * | data,
|  | const wchar_t * | content_type,
|  | const wchar_t * | encode,
|  | const wchar_t * | header
| ) |  |
| pure virtual

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

virtual bool foxit::addon::xfa::AppProviderCallback::PutRequestURL | ( | const wchar_t * | url,
|  | const wchar_t * | data,
|  | const wchar_t * | encode
| ) |  |
| pure virtual

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

virtual void foxit::addon::xfa::AppProviderCallback::Release | ( |  | ) |
| pure virtual

A callback function used to release current callback object itself.

Returns
  None.

## ◆ Response()

virtual WString foxit::addon::xfa::AppProviderCallback::Response | ( | const wchar_t * | question,
|  | const wchar_t * | title,
|  | const wchar_t * | default_answer,
|  | bool | is_mask
| ) |  |
| pure virtual

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

virtual WStringArray foxit::addon::xfa::AppProviderCallback::ShowFileDialog | ( | const wchar_t * | string_title,
|  | const wchar_t * | string_filter,
|  | bool | is_openfile_dialog
| ) |  |
| pure virtual

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.