Foxit PDF SDK

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

## Public Member Functions
| GetBitmap ()
| Get the bitmap of current XFA widget. More...
| GetDefaultValue ()
| Get the default value string. More...
| GetHAlign ()
| Get text horizontal alignment. More...
| GetIndex ()
| Get the index of XFA Widget in related XFA page. More...
| GetJavaScript ()
| Get the JavaScript of validation for current XFA widget. More...
| GetName (type)
| Get Widget name. More...
| GetOptions ()
| Get options of a choice list or an Exclusion Group (for radion button only). More...
| GetPresence ()
| Get the presence property of the XFA widget. More...
| GetRect ()
| Get rectangle of XFA widget. More...
| GetSignature ()
| Get the signature object from current XFA widget. More...
| GetToolTip ()
| Get tooltip string. More...
| GetType ()
| Get type of XFA widget. More...
| GetVAlign ()
| Get text vertical alignment. More...
| GetValue ()
| Get the value string. More...
| GetXFAPage ()
| Get the related XFA page, to which current XFA widget belongs. More...
| GetXMLContent ()
| Get the xml content of current XFA widget. More...
| HasEdge (edge_pos)
| Check if the edge for specified position exists. More...
| IsAllowRichText ()
| Check whether the widget allows rich text formatting. More...
| IsChecked ()
| Check if current XFA widget is checked. More...
| IsListBox ()
| Check whether the widget is listbox or not. More...
| IsReadOnly ()
| Check whether the widget is read only. More...
| IsRequired ()
| Check whether the widget requires a value at the time it is exported by a submit-form action. More...
| IsSupportMultiline ()
| Check whether the widget supports multiple lines. More...
| IsSupportMultiSelect ()
| Check whether the widget supports multiple selections. More...
| OnChar (input_char, flags)
| Call this function when a character code is being input. More...
| OnHitTest (point)
| Call this function to do hit test for a specified point. More...
| OnKeyDown (key_code, flags)
| Call this function when key on the keyboard is down. More...
| OnKeyUp (key_code, flags)
| Call this function when key on the keyboard is up. More...
| OnLButtonDoubleClick (point, flags)
| Call this function when left mouse button is double-clicked . More...
| OnLButtonDown (point, flags)
| Call this function when left mouse button is down. More...
| OnLButtonUp (point, flags)
| Call this function when left mouse button is up. More...
| OnMouseEnter ()
| Call this function when mouse enters current XFA widget. More...
| OnMouseExit ()
| Call this function when mouse exits. More...
| OnMouseMove (point, flags)
| Call this function when mouse moves. More...
| OnRButtonDown (point, flags)
| Call this function when right mouse is down. More...
| OnRButtonUp (point, flags)
| Call this function when right button is up. More...
| ResetData ()
| Reset XFA Widget Data. More...
| SetCheckState (is_checked)
| Set the checked state of the current XFA widget. More...
| SetDefaultValue (value)
| Set the default value string. More...
| SetImage (image)
| Set the image for current XFA widget. More...
| SetValue (value)
| Set the value string. More...
| ValidateValue (value, format)
| Validate whether the value conforms to the format of current XFA widget. More...

## Static Public Attributes
static | e_HitTestAreaUnknown: number static e_HitTestAreaClient: number static e_HitTestAreaTitleBar: number static e_HitTestAreaHyperLink: number static e_WidgetTypeBarcode: number static e_WidgetTypePushButton: number static e_WidgetTypeCheckButton: number static e_WidgetTypeArc: number static e_WidgetTypeDateTimeEdit: number static e_WidgetTypeNumericEdit: number static e_WidgetTypeSignature: number static e_WidgetTypeChoiceList: number static e_WidgetTypeImageEdit: number static e_WidgetTypeLine: number static e_WidgetTypePasswordEdit: number static e_WidgetTypeRadioButton: number static e_WidgetTypeRectangle: number static e_WidgetTypeTextEdit: number static e_WidgetTypeUnknown: number static e_WidgetTypeExclGroup: number static e_WidgetTypeImage: number static e_PresenceUnknown: number static e_PresenceVisible: number static e_PresenceHidden: number static e_PresenceInactive: number static e_PresenceInvisible: number static e_WidgetNameTypeField: number static e_WidgetNameTypeCaption: number static e_WidgetNameTypeFullName: number static e_WidgethAlignTypeCenter: number static e_WidgethAlignTypeJustify: number static e_WidgethAlignTypeJustifyAll: number static e_WidgethAlignTypeLeft: number static e_WidgethAlignTypeRadix: number static e_WidgethAlignTypeRight: number static e_WidgetvAlignTypeTop: number static e_WidgetvAlignTypeBottom: number static e_WidgetvAlignTypeMiddle: number static e_WidgetEdgePositionTop: number static e_WidgetEdgePositionRight: number static e_WidgetEdgePositionBottom: number static e_WidgetEdgePositionLeft: number IsEmpty()
| Enumeration for hit test area of XFA widget. More...

## Detailed Description

Class FSDK.XFAWidget represents the XFA widget which is retrieved from XFA page object.
To access the menu of XFA widget, please construct a FSDK.WidgetMenu object with FSDK.XFAWidget object.

See also
  FSDK.WidgetMenu

## Member Function Documentation

## ◆ GetBitmap()

FSDK.XFAWidget.GetBitmap | ( |  | ) |

Get the bitmap of current XFA widget.

Applicable only when the type of current XFA widget is FSDK.XFAWidget.e_WidgetTypeImageEdit or FSDK.XFAWidget.e_WidgetTypeImage. For types that are not applicable, this function will throw exception FSDK.e_ErrUnsupported.

Returns
  The bitmap of current XFA widget.

## ◆ GetDefaultValue()

FSDK.XFAWidget.GetDefaultValue | ( |  | ) |

Get the default value string.

Returns
  The default value string.

## ◆ GetHAlign()

FSDK.XFAWidget.GetHAlign | ( |  | ) |

Get text horizontal alignment.

Returns
  Text horizontal alignment. Please refer to values starting from FSDK.XFAWidget.e_WidgethAlignTypeLeft and this would be one of these values.

## ◆ GetIndex()

FSDK.XFAWidget.GetIndex | ( |  | ) |

Get the index of XFA Widget in related XFA page.

Returns
  The index of XFA Widget in related XFA page.

## ◆ GetJavaScript()

FSDK.XFAWidget.GetJavaScript | ( |  | ) |

Get the JavaScript of validation for current XFA widget.

Returns
  The JavaScript of validation for current XFA widget.

## ◆ GetName()

FSDK.XFAWidget.GetName | ( | type |  | ) |

Get Widget name.

Parameters

  [in] | type | Name type. Please refer to values starting from FSDK.XFAWidget.e_WidgetNameTypeField and this should be one of these values.

Returns
  Widget name string.

## ◆ GetOptions()

FSDK.XFAWidget.GetOptions | ( |  | ) |

Get options of a choice list or an Exclusion Group (for radion button only).

Applicable for choice list and Exclusion Group (for radion button only). For types that are not applicable, this function will return an empty array.

Returns
  A choice option array.

## ◆ GetPresence()

FSDK.XFAWidget.GetPresence | ( |  | ) |

Get the presence property of the XFA widget.

The presence property controls the participation of the associated object in different phases of processing.

Returns
  The presence property of the XFA widget.

## ◆ GetRect()

FSDK.XFAWidget.GetRect | ( |  | ) |

Get rectangle of XFA widget.

Widget rectangle is defined in XFA coordinate. XFA coordinate is defined as original point in left top, x-axis pointing to right and y-axis pointing down.

Returns
  The rectangle of XFA widget.

## ◆ GetSignature()

FSDK.XFAWidget.GetSignature | ( |  | ) |

Get the signature object from current XFA widget.

Applicable only when current XFA widget represents a signature. For types that are not applicable, this function will throw exception FSDK.e_ErrUnsupported.

Returns
  A signature object.

## ◆ GetToolTip()

FSDK.XFAWidget.GetToolTip | ( |  | ) |

Get tooltip string.

Returns
  Tooltip string.

## ◆ GetType()

FSDK.XFAWidget.GetType | ( |  | ) |

Get type of XFA widget.

Returns
  The XFA widget type. Please refer to values starting from FSDK.XFAWidget.e_WidgetTypeBarcode and this would be one of these values.

## ◆ GetVAlign()

FSDK.XFAWidget.GetVAlign | ( |  | ) |

Get text vertical alignment.

Returns
  Text vertical alignment. Please refer to values starting from FSDK.XFAWidget.e_WidgetvAlignTypeTop and this would be one of these values.

## ◆ GetValue()

FSDK.XFAWidget.GetValue | ( |  | ) |

Get the value string.

Returns
  The value string.

## ◆ GetXFAPage()

FSDK.XFAWidget.GetXFAPage | ( |  | ) |

Get the related XFA page, to which current XFA widget belongs.

Returns
  An XFA page object.

## ◆ GetXMLContent()

FSDK.XFAWidget.GetXMLContent | ( |  | ) |

Get the xml content of current XFA widget.

Returns
  The xml content of current XFA widget.

## ◆ HasEdge()

FSDK.XFAWidget.HasEdge | ( | edge_pos |  | ) |

Check if the edge for specified position exists.

Parameters

  [in] | edge_pos | Edge position to specify which edge will be checked. Please refer to values starting from FSDK.XFAWidget.e_WidgetEdgePositionTop and this should be one of these values.

Returns
  true means that the edge for specified position exists, while false means that no such edge exist.

## ◆ IsAllowRichText()

FSDK.XFAWidget.IsAllowRichText | ( |  | ) |

Check whether the widget allows rich text formatting.

Only text edit widget which type is FSDK.XFAWidget.e_WidgetTypeTextEdit supports rich text.

Returns
  true means the widget allows rich text formatting, while false means not.

## ◆ IsChecked()

FSDK.XFAWidget.IsChecked | ( |  | ) |

Check if current XFA widget is checked.

Applicable for check box or radio button as related XFA widget. For types that are not applicable, this function will return false.

Returns
  true means checked, while false means unchecked or failure.

## ◆ IsListBox()

FSDK.XFAWidget.IsListBox | ( |  | ) |

Check whether the widget is listbox or not.

Returns
  true means the widget is listbox, while false means not.

## ◆ IsReadOnly()

FSDK.XFAWidget.IsReadOnly | ( |  | ) |

Check whether the widget is read only.

Returns
  true means the value of the field can not be changed, while false means it can be changed.

## ◆ IsRequired()

FSDK.XFAWidget.IsRequired | ( |  | ) |

Check whether the widget requires a value at the time it is exported by a submit-form action.

Returns
  true means the field must have a value at the time it is exported by a submit-form action, while false means not.

## ◆ IsSupportMultiline()

FSDK.XFAWidget.IsSupportMultiline | ( |  | ) |

Check whether the widget supports multiple lines.

Only text edit widget which type is FSDK.XFAWidget.e_WidgetTypeTextEdit supports multiple lines.

Returns
  true means the widget is supported, while false means not.

## ◆ IsSupportMultiSelect()

FSDK.XFAWidget.IsSupportMultiSelect | ( |  | ) |

Check whether the widget supports multiple selections.

Only the list box widget supports multiline selections, Whose type is FSDK.XFAWidget.e_WidgetTypeChoiceList and when the function call FSDK.XFAWidget.IsListBox returns true.

Returns
  true means the widget is supported, while false means not.

## ◆ OnChar()

FSDK.XFAWidget.OnChar | ( | input_char | ,
|  | flags |
| ) |  |

Call this function when a character code is being input.

Parameters

  [in] | input_char | A character code, in UTF16-LE encoding.
  [in] | flags | Event flags. Please refer to values starting from FSDK.Filler.e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnHitTest()

FSDK.XFAWidget.OnHitTest | ( | point |  | ) |

Call this function to do hit test for a specified point.

Parameters

  [in] | point | A point to be tested.

Returns
  The hit test area. Please refer to values starting from FSDK.XFAWidget.e_HitTestAreaUnknown and this would be one of these values.

## ◆ OnKeyDown()

FSDK.XFAWidget.OnKeyDown | ( | key_code | ,
|  | flags |
| ) |  |

Call this function when key on the keyboard is down.

Parameters

  [in] | key_code | The key code. Please refer to values starting from FSDK.Filler.e_VkeyUnknown and this should be one of these values.
  [in] | flags | Event flags. Please refer to values starting from FSDK.Filler.e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnKeyUp()

FSDK.XFAWidget.OnKeyUp | ( | key_code | ,
|  | flags |
| ) |  |

Call this function when key on the keyboard is up.

Parameters

  [in] | key_code | The key code. Please refer to values starting from FSDK.Filler.e_VkeyUnknown and this should be one of these values.
  [in] | flags | Event flags. Please refer to values starting from FSDK.Filler.e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnLButtonDoubleClick()

FSDK.XFAWidget.OnLButtonDoubleClick | ( | point | ,
|  | flags |
| ) |  |

Call this function when left mouse button is double-clicked .

Parameters

  [in] | point | A point where left mouse button is double-clicked in XFA page, in PDF coordinate system.
  [in] | flags | Event flags. Please refer to values starting from FSDK.Filler.e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnLButtonDown()

FSDK.XFAWidget.OnLButtonDown | ( | point | ,
|  | flags |
| ) |  |

Call this function when left mouse button is down.

Parameters

  [in] | point | A point where left mouse button is down in XFA page, in PDF coordinate system.
  [in] | flags | Event flags. Please refer to values starting from FSDK.Filler.e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnLButtonUp()

FSDK.XFAWidget.OnLButtonUp | ( | point | ,
|  | flags |
| ) |  |

Call this function when left mouse button is up.

Parameters

  [in] | point | A point where left mouse button is up in XFA page, in PDF coordinate system.
  [in] | flags | Event flags. Please refer to values starting from FSDK.Filler.e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnMouseEnter()

FSDK.XFAWidget.OnMouseEnter | ( |  | ) |

Call this function when mouse enters current XFA widget.

Returns
  true means success, while false means failure.

## ◆ OnMouseExit()

FSDK.XFAWidget.OnMouseExit | ( |  | ) |

Call this function when mouse exits.

Returns
  true means success, while false means failure.

## ◆ OnMouseMove()

FSDK.XFAWidget.OnMouseMove | ( | point | ,
|  | flags |
| ) |  |

Call this function when mouse moves.

Parameters

  [in] | point | A point where left mouse button moves in XFA page, in PDF coordinate system.
  [in] | flags | Event flags. Please refer to values starting from FSDK.Filler.e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnRButtonDown()

FSDK.XFAWidget.OnRButtonDown | ( | point | ,
|  | flags |
| ) |  |

Call this function when right mouse is down.

Parameters

  [in] | point | A point where right mouse button is down in XFA page, in PDF coordinate system.
  [in] | flags | Event flags. Please refer to values starting from FSDK.Filler.e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnRButtonUp()

FSDK.XFAWidget.OnRButtonUp | ( | point | ,
|  | flags |
| ) |  |

Call this function when right button is up.

Parameters

  [in] | point | A point where right mouse button is up in XFA page, in PDF coordinate system.
  [in] | flags | Event flags. Please refer to values starting from FSDK.Filler.e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ ResetData()

FSDK.XFAWidget.ResetData | ( |  | ) |

Reset XFA Widget Data.

Returns
  None.

## ◆ SetCheckState()

FSDK.XFAWidget.SetCheckState | ( | is_checked |  | ) |

Set the checked state of the current XFA widget.

Applicable for check box or radio button as related XFA widget. For types that are not applicable, this function will throw exception FSDK.e_ErrUnsupported.

Parameters

  [in] | is_checked | true means the current XFA widget will be checked, while false means it will not be checked.

Returns
  None.

## ◆ SetDefaultValue()

FSDK.XFAWidget.SetDefaultValue | ( | value |  | ) |

Set the default value string.

It is only useful for the XFA widget which type is FSDK.XFAWidget.e_WidgetTypeTextEdit, FSDK.XFAWidget.e_WidgetTypeNumericEdit, FSDK.XFAWidget.e_WidgetTypePasswordEdit or FSDK.XFAWidget.e_WidgetTypeDateTimeEdit.

Parameters

  [in] | value | A string as default value to be set. It can be an empty string.

Returns
  None.

## ◆ SetImage()

FSDK.XFAWidget.SetImage | ( | image |  | ) |

Set the image for current XFA widget.

Applicable only when the type of current XFA widget is FSDK.XFAWidget.e_WidgetTypeImageEdit. For types that are not applicable, this function will throw exception FSDK.e_ErrUnsupported.

Parameters

  [in] | image | An image will be set to current XFA widget. Currently, this function only supports the following image types: FSDK.Image.e_BMP FSDK.Image.e_PNG FSDK.Image.e_JPG FSDK.Image.e_GIF FSDK.Image.e_TIF If try to set rest unsupported image types, exception FSDK.e_ErrUnsupported will be thrown.

Returns
  None.

## ◆ SetValue()

FSDK.XFAWidget.SetValue | ( | value |  | ) |

Set the value string.

It is only useful for the XFA widget which type is FSDK.XFAWidget.e_WidgetTypeTextEdit, FSDK.XFAWidget.e_WidgetTypeNumericEdit, FSDK.XFAWidget.e_WidgetTypePasswordEdit or FSDK.XFAWidget.e_WidgetTypeDateTimeEdit.

Parameters

  [in] | value | A string as value to be set. It can be an empty string.

Returns
  None.

## ◆ ValidateValue()

FSDK.XFAWidget.ValidateValue | ( | value | ,
|  | format |
| ) |  |

Validate whether the value conforms to the format of current XFA widget.

This function can be called before the function FSDK.XFAWidget.SetValue to check whether the value conforms to the format of current XFA widget.

Parameters

  [in] | value | A string value to be validated.
  [out] | format | A string value that receives the format of current XFA widget. It will be an empty string if current XFA widget has no format.

Returns
  true means the value conforms to the format of current XFA widget, while false means not.

## Member Data Documentation

## ◆ e_HitTestAreaUnknown

FSDK.XFAWidget.e_HitTestAreaUnknown
| static

Enumeration for hit test area of XFA widget.

Values of this enumeration should be used alone.

Hit test area: Unknown.