Foxit PDF SDK
fsdk.XFAWidget Class Reference

Public Member Functions

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

Detailed Description

Class 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 XFAWidget object.

See also
WidgetMenu

Member Function Documentation

◆ GetBitmap()

def fsdk.XFAWidget.GetBitmap ( )

Get the bitmap of current XFA widget.

Applicable only when the type of current XFA widget is fsdk.XFAWidgetE_WidgetTypeImageEdit or fsdk.XFAWidgetE_WidgetTypeImage . For types that are not applicable, this function will throw exception fsdk.E_ErrUnsupported .

Returns
The bitmap of current XFA widget.

◆ GetDefaultValue()

def fsdk.XFAWidget.GetDefaultValue ( )

Get the default value string.

Returns
The default value string.

◆ GetHAlign()

def fsdk.XFAWidget.GetHAlign ( )

Get text horizontal alignment.

Returns
Text horizontal alignment. Please refer to values starting from fsdk.XFAWidgetE_WidgethAlignTypeLeft and this would be one of these values.

◆ GetIndex()

def fsdk.XFAWidget.GetIndex ( )

Get the index of XFA Widget in related XFA page.

Returns
The index of XFA Widget in related XFA page.

◆ GetJavaScript()

def fsdk.XFAWidget.GetJavaScript ( )

Get the JavaScript of validation for current XFA widget.

Returns
The JavaScript of validation for current XFA widget.

◆ GetName()

def fsdk.XFAWidget.GetName (   type)

Get Widget name.

Parameters
[in]typeName type. Please refer to values starting from fsdk.XFAWidgetE_WidgetNameTypeField and this should be one of these values.
Returns
Widget name string.

◆ GetOptions()

def fsdk.XFAWidget.GetOptions ( )

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

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

Returns
A choice option array.

◆ GetPresence()

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

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

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

def fsdk.XFAWidget.GetToolTip ( )

Get tooltip string.

Returns
Tooltip string.

◆ GetType()

def fsdk.XFAWidget.GetType ( )

Get type of XFA widget.

Returns
The XFA widget type. Please refer to values starting from fsdk.XFAWidgetE_WidgetTypeBarcode and this would be one of these values.

◆ GetVAlign()

def fsdk.XFAWidget.GetVAlign ( )

Get text vertical alignment.

Returns
Text vertical alignment. Please refer to values starting from fsdk.XFAWidgetE_WidgetvAlignTypeTop and this would be one of these values.

◆ GetValue()

def fsdk.XFAWidget.GetValue ( )

Get the value string.

Returns
The value string.

◆ GetXFAPage()

def fsdk.XFAWidget.GetXFAPage ( )

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

Returns
An XFA page object.

◆ GetXMLContent()

def fsdk.XFAWidget.GetXMLContent ( )

Get the xml content of current XFA widget.

Returns
The xml content of current XFA widget.

◆ HasEdge()

def fsdk.XFAWidget.HasEdge (   edge_pos)

Check if the edge for specified position exists.

Parameters
[in]edge_posEdge position to specify which edge will be checked. Please refer to values starting from fsdk.XFAWidgetE_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()

def fsdk.XFAWidget.IsAllowRichText ( )

Check whether the widget allows rich text formatting.

Only text edit widget which type is fsdk.XFAWidgetE_WidgetTypeTextEdit supports rich text.

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

◆ IsChecked()

def 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.

◆ IsEmpty()

def fsdk.XFAWidget.IsEmpty ( )

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ IsListBox()

def fsdk.XFAWidget.IsListBox ( )

Check whether the widget is listbox or not.

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

◆ IsReadOnly()

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

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

def fsdk.XFAWidget.IsSupportMultiline ( )

Check whether the widget supports multiple lines.

Only text edit widget which type is fsdk.XFAWidgetE_WidgetTypeTextEdit supports multiple lines.

Returns
true means the widget supports multiple lines, while false means not.

◆ IsSupportMultiSelect()

def fsdk.XFAWidget.IsSupportMultiSelect ( )

Check whether the widget supports multiple selections.

Only the list box widget supports multiline selections, whose type is fsdk.XFAWidgetE_WidgetTypeChoiceList and the return value of function fsdk.XFAWidget.IsListBox is true.

Returns
true means the widget support multiple selections, while false means not.

◆ OnChar()

def fsdk.XFAWidget.OnChar (   input_char,
  flags 
)

Call this function when a character code is being input.

Parameters
[in]input_charA character code, in UTF16-LE encoding.
[in]flagsEvent flags. Please refer to values starting from fsdk.FillerE_EventFlagShiftKey and this should be one or a combination of these values.
Returns
true means success, while false means failure.

◆ OnHitTest()

def fsdk.XFAWidget.OnHitTest (   point)

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

Parameters
[in]pointA point to be tested.
Returns
The hit test area. Please refer to values starting from fsdk.XFAWidgetE_HitTestAreaUnknown and this would be one of these values.

◆ OnKeyDown()

def fsdk.XFAWidget.OnKeyDown (   key_code,
  flags 
)

Call this function when key on the keyboard is down.

Parameters
[in]key_codeThe key code. Please refer to values starting from fsdk.FillerE_VkeyUnknown and this should be one of these values.
[in]flagsEvent flags. Please refer to values starting from fsdk.FillerE_EventFlagShiftKey and this should be one or a combination of these values.
Returns
true means success, while false means failure.

◆ OnKeyUp()

def fsdk.XFAWidget.OnKeyUp (   key_code,
  flags 
)

Call this function when key on the keyboard is up.

Parameters
[in]key_codeThe key code. Please refer to values starting from fsdk.FillerE_VkeyUnknown and this should be one of these values.
[in]flagsEvent flags. Please refer to values starting from fsdk.FillerE_EventFlagShiftKey and this should be one or a combination of these values.
Returns
true means success, while false means failure.

◆ OnLButtonDoubleClick()

def fsdk.XFAWidget.OnLButtonDoubleClick (   point,
  flags 
)

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

Parameters
[in]pointA point where left mouse button is double-clicked in XFA page, in PDF coordinate system.
[in]flagsEvent flags. Please refer to values starting from fsdk.FillerE_EventFlagShiftKey and this should be one or a combination of these values.
Returns
true means success, while false means failure.

◆ OnLButtonDown()

def fsdk.XFAWidget.OnLButtonDown (   point,
  flags 
)

Call this function when left mouse button is down.

Parameters
[in]pointA point where left mouse button is down in XFA page, in PDF coordinate system.
[in]flagsEvent flags. Please refer to values starting from fsdk.FillerE_EventFlagShiftKey and this should be one or a combination of these values.
Returns
true means success, while false means failure.

◆ OnLButtonUp()

def fsdk.XFAWidget.OnLButtonUp (   point,
  flags 
)

Call this function when left mouse button is up.

Parameters
[in]pointA point where left mouse button is up in XFA page, in PDF coordinate system.
[in]flagsEvent flags. Please refer to values starting from fsdk.FillerE_EventFlagShiftKey and this should be one or a combination of these values.
Returns
true means success, while false means failure.

◆ OnMouseEnter()

def fsdk.XFAWidget.OnMouseEnter ( )

Call this function when mouse enters current XFA widget.

Returns
true means success, while false means failure.

◆ OnMouseExit()

def fsdk.XFAWidget.OnMouseExit ( )

Call this function when mouse exits.

Returns
true means success, while false means failure.

◆ OnMouseMove()

def fsdk.XFAWidget.OnMouseMove (   point,
  flags 
)

Call this function when mouse moves.

Parameters
[in]pointA point where left mouse button moves in XFA page, in PDF coordinate system.
[in]flagsEvent flags. Please refer to values starting from fsdk.FillerE_EventFlagShiftKey and this should be one or a combination of these values.
Returns
true means success, while false means failure.

◆ OnRButtonDown()

def fsdk.XFAWidget.OnRButtonDown (   point,
  flags 
)

Call this function when right mouse is down.

Parameters
[in]pointA point where right mouse button is down in XFA page, in PDF coordinate system.
[in]flagsEvent flags. Please refer to values starting from fsdk.FillerE_EventFlagShiftKey and this should be one or a combination of these values.
Returns
true means success, while false means failure.

◆ OnRButtonUp()

def fsdk.XFAWidget.OnRButtonUp (   point,
  flags 
)

Call this function when right button is up.

Parameters
[in]pointA point where right mouse button is up in XFA page, in PDF coordinate system.
[in]flagsEvent flags. Please refer to values starting from fsdk.FillerE_EventFlagShiftKey and this should be one or a combination of these values.
Returns
true means success, while false means failure.

◆ ResetData()

def fsdk.XFAWidget.ResetData ( )

Reset XFA Widget Data.

Returns
None.

◆ SetCheckState()

def 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_checkedtrue means the current XFA widget will be checked, while false means it will not be checked.
Returns
None.

◆ SetDefaultValue()

def fsdk.XFAWidget.SetDefaultValue (   value)

Set the default value string.

It is only useful for the XFA widget which type is fsdk.XFAWidgetE_WidgetTypeTextEdit , fsdk.XFAWidgetE_WidgetTypeNumericEdit , fsdk.XFAWidgetE_WidgetTypePasswordEdit or fsdk.XFAWidgetE_WidgetTypeDateTimeEdit .

Parameters
[in]valueA string as default value to be set. It can be an empty string.
Returns
None.

◆ SetImage()

def fsdk.XFAWidget.SetImage (   image)

Set the image for current XFA widget.

Applicable only when the type of current XFA widget is fsdk.XFAWidgetE_WidgetTypeImageEdit . For types that are not applicable, this function will throw exception fsdk.E_ErrUnsupported .

Parameters
[in]imageAn image will be set to current XFA widget. Currently, this function only supports the following image types: If try to set rest unsupported image types, exception fsdk.E_ErrUnsupported will be thrown.
Returns
None.

◆ SetOptions()

def fsdk.XFAWidget.SetOptions (   option_array)

Set options of a choice list or an Exclusion Group (for radio button only).

Applicable for choice list and Exclusion Group (for radio button only). For types that are not applicable, this function will return false.

Parameters
[in]option_arrayAn array of choice options to be set.
Returns
true means success, while false means failure.

◆ SetValue()

def fsdk.XFAWidget.SetValue (   value)

Set the value string.

It is only useful for the XFA widget which type is fsdk.XFAWidgetE_WidgetTypeTextEdit , fsdk.XFAWidgetE_WidgetTypeNumericEdit , fsdk.XFAWidgetE_WidgetTypePasswordEdit or fsdk.XFAWidgetE_WidgetTypeDateTimeEdit .

Parameters
[in]valueA string as value to be set. It can be an empty string.
Returns
None.