Foxit PDF SDK

Public Types | Public Member Functions | List of all members
foxit::addon::xfa::XFAWidget Class Reference
Inheritance diagram for foxit::addon::xfa::XFAWidget:

## Public Types
enum | HitTestArea { e_HitTestAreaUnknown = 0, e_HitTestAreaClient = 1, e_HitTestAreaTitleBar = 2, e_HitTestAreaHyperLink = 3 }
| Enumeration for hit test area of XFA widget. More...
enum | PresenceProperty { e_PresenceUnknown = 0, e_PresenceVisible = 1, e_PresenceHidden = 2, e_PresenceInactive = 3, e_PresenceInvisible = 4 }
| Enumeration for presence attribute of XFA widget. More...
enum | WidgetEdgePosition { e_WidgetEdgePositionTop = 0, e_WidgetEdgePositionRight = 1, e_WidgetEdgePositionBottom = 2, e_WidgetEdgePositionLeft = 3 }
| Enumeration for the positon of XFA widget edge position. More...
enum | WidgetHAlignType { e_WidgethAlignTypeCenter = 128, e_WidgethAlignTypeJustify = 156, e_WidgethAlignTypeJustifyAll = 61, e_WidgethAlignTypeLeft = 252, e_WidgethAlignTypeRadix = 231, e_WidgethAlignTypeRight = 54 }
| Enumeration for the type of text horizontal alignment of XFA widget. More...
enum | WidgetNameType { e_WidgetNameTypeField = 0, e_WidgetNameTypeCaption = 1, e_WidgetNameTypeFullName = 2 }
| Enumeration for the type of XFA widget name. More...
enum | WidgetType { e_WidgetTypeBarcode = 0, e_WidgetTypePushButton = 1, e_WidgetTypeCheckButton = 2, e_WidgetTypeArc = 3, e_WidgetTypeDateTimeEdit = 4, e_WidgetTypeNumericEdit = 5, e_WidgetTypeSignature = 6, e_WidgetTypeChoiceList = 7, e_WidgetTypeImageEdit = 8, e_WidgetTypeLine = 9, e_WidgetTypePasswordEdit = 10, e_WidgetTypeRadioButton = 11, e_WidgetTypeRectangle = 12, e_WidgetTypeTextEdit = 13, e_WidgetTypeUnknown = 14, e_WidgetTypeExclGroup = 15, e_WidgetTypeImage = 16 }
| Enumeration for the type of XFA widget. More...
enum | WidgetVAlignType { e_WidgetvAlignTypeTop = 33, e_WidgetvAlignTypeBottom = 85, e_WidgetvAlignTypeMiddle = 161 }
| Enumeration for the type of text vertical alignment of XFA widget. More...

## Public Member Functions
| XFAWidget (const XFAWidget &other)
| Constructor, with another XFA widget object. More...
| ~XFAWidget ()
| Destructor.
foxit::common::Bitmap | GetBitmap ()
| Get the bitmap of current XFA widget. More...
WString | GetDefaultValue ()
| Get the default value string. More...
WidgetHAlignType | GetHAlign ()
| Get text horizontal alignment. More...
int | GetIndex () const
| Get the index of XFA Widget in related XFA page. More...
WString | GetJavaScript ()
| Get the JavaScript of validation for current XFA widget. More...
WString | GetName (WidgetNameType type)
| Get Widget name. More...
addon::xfa::WidgetChoiceOptionArray | GetOptions () const
| Get options of a choice list or an Exclusion Group (for radio button only). More...
PresenceProperty | GetPresence ()
| Get the presence property of the XFA widget. More...
RectF | GetRect ()
| Get rectangle of XFA widget. More...
foxit::pdf::Signature | GetSignature ()
| Get the signature object from current XFA widget. More...
WString | GetToolTip ()
| Get tooltip string. More...
WidgetType | GetType ()
| Get type of XFA widget. More...
WidgetVAlignType | GetVAlign ()
| Get text vertical alignment. More...
WString | GetValue ()
| Get the value string. More...
XFAPage | GetXFAPage ()
| Get the related XFA page, to which current XFA widget belongs. More...
String | GetXMLContent ()
| Get the xml content of current XFA widget. More...
bool | HasEdge (WidgetEdgePosition edge_pos)
| Check if the edge for specified position exists. More...
bool | IsAllowRichText ()
| Check whether the widget allows rich text formatting. More...
bool | IsChecked () const
| Check if current XFA widget is checked. More...
bool | IsEmpty () const
| Check whether current object is empty or not. More...
bool | IsListBox ()
| Check whether the widget is listbox or not. More...
bool | IsReadOnly ()
| Check whether the widget is read only. More...
bool | IsRequired ()
| Check whether the widget requires a value at the time it is exported by a submit-form action. More...
bool | IsSupportMultiline ()
| Check whether the widget supports multiple lines. More...
bool | IsSupportMultiSelect ()
| Check whether the widget supports multiple selections. More...
bool | OnChar (int input_char, uint32 flags)
| Call this function when a character code is being input. More...
HitTestArea | OnHitTest (const PointF &point)
| Call this function to do hit test for a specified point. More...
bool | OnKeyDown (uint32 key_code, uint32 flags)
| Call this function when key on the keyboard is down. More...
bool | OnKeyUp (uint32 key_code, uint32 flags)
| Call this function when key on the keyboard is up. More...
bool | OnLButtonDoubleClick (const PointF &point, uint32 flags)
| Call this function when left mouse button is double-clicked . More...
bool | OnLButtonDown (const PointF &point, uint32 flags)
| Call this function when left mouse button is down. More...
bool | OnLButtonUp (const PointF &point, uint32 flags)
| Call this function when left mouse button is up. More...
bool | OnMouseEnter ()
| Call this function when mouse enters current XFA widget. More...
bool | OnMouseExit ()
| Call this function when mouse exits. More...
bool | OnMouseMove (const PointF &point, uint32 flags)
| Call this function when mouse moves. More...
bool | OnRButtonDown (const PointF &point, uint32 flags)
| Call this function when right mouse is down. More...
bool | OnRButtonUp (const PointF &point, uint32 flags)
| Call this function when right button is up. More...
bool | operator != (const XFAWidget &other) const
| Not equal operator. More...
XFAWidget & | operator= (const XFAWidget &other)
| Assign operator. More...
bool | operator== (const XFAWidget &other) const
| Equal operator. More...
void | ResetData ()
| Reset XFA Widget Data. More...
void | SetCheckState (bool is_checked)
| Set the checked state of the current XFA widget. More...
void | SetDefaultValue (const wchar_t *value)
| Set the default value string. More...
void | SetImage (const foxit::common::Image &image)
| Set the image for current XFA widget. More...
bool | SetOptions (const addon::xfa::WidgetChoiceOptionArray &option_array)
| Set options of a choice list or an Exclusion Group (for radio button only). More...
void | SetValue (const wchar_t *value)
| Set the value string. More...
bool | ValidateValue (const wchar_t *value, WString &format)
| Validate whether the value conforms to the format of current XFA widget. More...
Public Member Functions inherited from foxit::Base
FS_HANDLE | Handle () const
| Get the handle of current object. 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 xfa::WidgetMenu object with XFAWidget object.

See also
  WidgetMenu

## Member Enumeration Documentation

## ◆ HitTestArea

enum foxit::addon::xfa::XFAWidget::HitTestArea

Enumeration for hit test area of XFA widget.

Values of this enumeration should be used alone.

Enumerator
e_HitTestAreaUnknown | Hit test area: Unknown.
e_HitTestAreaClient | Hit test area: Client.
e_HitTestAreaTitleBar | Hit test area: Title Bar.
e_HitTestAreaHyperLink | Hit test area: HyperLink.

## ◆ PresenceProperty

enum foxit::addon::xfa::XFAWidget::PresenceProperty

Enumeration for presence attribute of XFA widget.

Values of this enumeration should be used alone.
The presence property controls the participation of the associated object in different phases of processing.

Enumerator
e_PresenceUnknown | Presence property: Unknown.
e_PresenceVisible | Presence property: Visible. Participate in interaction, layout, and rendering.
e_PresenceHidden | Presence property: Hidden. Participate in interaction but not layout or rendering.
e_PresenceInactive | Presence property: Inactive. Do not participate in interaction, layout, or rendering.
e_PresenceInvisible | Presence property: Invisible. Participate in interaction and layout but not rendering.

## ◆ WidgetEdgePosition

enum foxit::addon::xfa::XFAWidget::WidgetEdgePosition

Enumeration for the positon of XFA widget edge position.

Values of this enumeration should be used alone.

Enumerator
e_WidgetEdgePositionTop | Edge position: top.
e_WidgetEdgePositionRight | Edge position: right.
e_WidgetEdgePositionBottom | Edge position: bottom.
e_WidgetEdgePositionLeft | Edge position: left.

## ◆ WidgetHAlignType

enum foxit::addon::xfa::XFAWidget::WidgetHAlignType

Enumeration for the type of text horizontal alignment of XFA widget.

Values of this enumeration should be used alone.

Enumerator
e_WidgethAlignTypeCenter | Center the text horizontally within the available region.
e_WidgethAlignTypeJustify | Left-align the last line and spread-justify the rest.
e_WidgethAlignTypeJustifyAll | Spread-justify all lines to fill the available region.
e_WidgethAlignTypeLeft | Align the text to the left edge of the available region.
e_WidgethAlignTypeRadix | Align the radix indicator.
e_WidgethAlignTypeRight | Align the text to the right edge of the available region.

## ◆ WidgetNameType

enum foxit::addon::xfa::XFAWidget::WidgetNameType

Enumeration for the type of XFA widget name.

Values of this enumeration should be used alone.

Enumerator
e_WidgetNameTypeField | Name type: field name. Name in this type will be retrieved from XFA widget's name entry and this may an empty string.
e_WidgetNameTypeCaption | Name type: caption name. Name in this type will be retrieved from caption entry.
e_WidgetNameTypeFullName | Name type: full name.

## ◆ WidgetType

enum foxit::addon::xfa::XFAWidget::WidgetType

Enumeration for the type of XFA widget.

Values of this enumeration should be used alone.

Enumerator
e_WidgetTypeBarcode | XFA widget type: barcode.
e_WidgetTypePushButton | XFA widget type: push button.
e_WidgetTypeCheckButton | XFA widget type: check button.
e_WidgetTypeArc | XFA widget type: arc.
e_WidgetTypeDateTimeEdit | XFA widget type: date time edit.
e_WidgetTypeNumericEdit | XFA widget type: numeric edit.
e_WidgetTypeSignature | XFA widget type: signature.
e_WidgetTypeChoiceList | XFA widget type: choice list.
e_WidgetTypeImageEdit | XFA widget type: image edit.
e_WidgetTypeLine | XFA widget type: line.
e_WidgetTypePasswordEdit | XFA widget type: password edit.
e_WidgetTypeRadioButton | XFA widget type: radio button.
e_WidgetTypeRectangle | XFA widget type: rectangle.
e_WidgetTypeTextEdit | XFA widget type: text edit.
e_WidgetTypeUnknown | XFA widget type: unknown.
e_WidgetTypeExclGroup | XFA widget type: Exclusion Group for radio button only.
e_WidgetTypeImage | XFA widget type: image.

## ◆ WidgetVAlignType

enum foxit::addon::xfa::XFAWidget::WidgetVAlignType

Enumeration for the type of text vertical alignment of XFA widget.

Values of this enumeration should be used alone.

Enumerator
e_WidgetvAlignTypeTop | Align the text to the top of the available region.
e_WidgetvAlignTypeBottom | Align the text to the bottom of the available region.
e_WidgetvAlignTypeMiddle | Align the text so that it is centered between the top and bottom of the available region.

## Constructor & Destructor Documentation

## ◆ XFAWidget()

foxit::addon::xfa::XFAWidget::XFAWidget | ( | const XFAWidget & | other | ) |

Constructor, with another XFA widget object.

Parameters

  [in] | other | Another XFA widget object.

## Member Function Documentation

## ◆ GetBitmap()

foxit::common::Bitmap foxit::addon::xfa::XFAWidget::GetBitmap | ( |  | ) |

Get the bitmap of current XFA widget.

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

Returns
  The bitmap of current XFA widget.

## ◆ GetDefaultValue()

WString foxit::addon::xfa::XFAWidget::GetDefaultValue | ( |  | ) |

Get the default value string.

Returns
  The default value string.

## ◆ GetHAlign()

WidgetHAlignType foxit::addon::xfa::XFAWidget::GetHAlign | ( |  | ) |

Get text horizontal alignment.

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

## ◆ GetIndex()

int foxit::addon::xfa::XFAWidget::GetIndex | ( |  | ) | const

Get the index of XFA Widget in related XFA page.

Returns
  The index of XFA Widget in related XFA page.

## ◆ GetJavaScript()

WString foxit::addon::xfa::XFAWidget::GetJavaScript | ( |  | ) |

Get the JavaScript of validation for current XFA widget.

Returns
  The JavaScript of validation for current XFA widget.

## ◆ GetName()

WString foxit::addon::xfa::XFAWidget::GetName | ( | WidgetNameType | type | ) |

Get Widget name.

Parameters

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

Returns
  Widget name string.

## ◆ GetOptions()

addon::xfa::WidgetChoiceOptionArray foxit::addon::xfa::XFAWidget::GetOptions | ( |  | ) | const

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

PresenceProperty foxit::addon::xfa::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()

RectF foxit::addon::xfa::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()

foxit::pdf::Signature foxit::addon::xfa::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 foxit::e_ErrUnsupported.

Returns
  A signature object.

## ◆ GetToolTip()

WString foxit::addon::xfa::XFAWidget::GetToolTip | ( |  | ) |

Get tooltip string.

Returns
  Tooltip string.

## ◆ GetType()

WidgetType foxit::addon::xfa::XFAWidget::GetType | ( |  | ) |

Get type of XFA widget.

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

## ◆ GetVAlign()

WidgetVAlignType foxit::addon::xfa::XFAWidget::GetVAlign | ( |  | ) |

Get text vertical alignment.

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

## ◆ GetValue()

WString foxit::addon::xfa::XFAWidget::GetValue | ( |  | ) |

Get the value string.

Returns
  The value string.

## ◆ GetXFAPage()

XFAPage foxit::addon::xfa::XFAWidget::GetXFAPage | ( |  | ) |

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

Returns
  An XFA page object.

## ◆ GetXMLContent()

String foxit::addon::xfa::XFAWidget::GetXMLContent | ( |  | ) |

Get the xml content of current XFA widget.

Returns
  The xml content of current XFA widget.

## ◆ HasEdge()

bool foxit::addon::xfa::XFAWidget::HasEdge | ( | WidgetEdgePosition | 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 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()

bool foxit::addon::xfa::XFAWidget::IsAllowRichText | ( |  | ) |

Check whether the widget allows rich text formatting.

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

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

## ◆ IsChecked()

bool foxit::addon::xfa::XFAWidget::IsChecked | ( |  | ) | const

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

bool foxit::addon::xfa::XFAWidget::IsEmpty | ( |  | ) | const

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

bool foxit::addon::xfa::XFAWidget::IsListBox | ( |  | ) |

Check whether the widget is listbox or not.

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

## ◆ IsReadOnly()

bool foxit::addon::xfa::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()

bool foxit::addon::xfa::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()

bool foxit::addon::xfa::XFAWidget::IsSupportMultiline | ( |  | ) |

Check whether the widget supports multiple lines.

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

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

## ◆ IsSupportMultiSelect()

bool foxit::addon::xfa::XFAWidget::IsSupportMultiSelect | ( |  | ) |

Check whether the widget supports multiple selections.

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

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

## ◆ OnChar()

bool foxit::addon::xfa::XFAWidget::OnChar | ( | int | input_char,
|  | uint32 | 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 pdf::interform::Filler::e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnHitTest()

HitTestArea foxit::addon::xfa::XFAWidget::OnHitTest | ( | const PointF & | 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 XFAWidget::e_HitTestAreaUnknown and this would be one of these values.

## ◆ OnKeyDown()

bool foxit::addon::xfa::XFAWidget::OnKeyDown | ( | uint32 | key_code,
|  | uint32 | flags
| ) |  |

Call this function when key on the keyboard is down.

Parameters

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

Returns
  true means success, while false means failure.

## ◆ OnKeyUp()

bool foxit::addon::xfa::XFAWidget::OnKeyUp | ( | uint32 | key_code,
|  | uint32 | flags
| ) |  |

Call this function when key on the keyboard is up.

Parameters

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

Returns
  true means success, while false means failure.

## ◆ OnLButtonDoubleClick()

bool foxit::addon::xfa::XFAWidget::OnLButtonDoubleClick | ( | const PointF & | point,
|  | uint32 | 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 pdf::interform::Filler::e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnLButtonDown()

bool foxit::addon::xfa::XFAWidget::OnLButtonDown | ( | const PointF & | point,
|  | uint32 | 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 pdf::interform::Filler::e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnLButtonUp()

bool foxit::addon::xfa::XFAWidget::OnLButtonUp | ( | const PointF & | point,
|  | uint32 | 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 pdf::interform::Filler::e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnMouseEnter()

bool foxit::addon::xfa::XFAWidget::OnMouseEnter | ( |  | ) |

Call this function when mouse enters current XFA widget.

Returns
  true means success, while false means failure.

## ◆ OnMouseExit()

bool foxit::addon::xfa::XFAWidget::OnMouseExit | ( |  | ) |

Call this function when mouse exits.

Returns
  true means success, while false means failure.

## ◆ OnMouseMove()

bool foxit::addon::xfa::XFAWidget::OnMouseMove | ( | const PointF & | point,
|  | uint32 | 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 pdf::interform::Filler::e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnRButtonDown()

bool foxit::addon::xfa::XFAWidget::OnRButtonDown | ( | const PointF & | point,
|  | uint32 | 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 pdf::interform::Filler::e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ OnRButtonUp()

bool foxit::addon::xfa::XFAWidget::OnRButtonUp | ( | const PointF & | point,
|  | uint32 | 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 pdf::interform::Filler::e_EventFlagShiftKey and this should be one or a combination of these values.

Returns
  true means success, while false means failure.

## ◆ operator !=()

bool foxit::addon::xfa::XFAWidget::operator != | ( | const XFAWidget & | other | ) | const

Not equal operator.

Parameters

  [in] | other | Another XFA widget object. This function will check if current object is not equal to this one.

Returns
  true means not equal, while false means equal.

## ◆ operator=()

XFAWidget& foxit::addon::xfa::XFAWidget::operator= | ( | const XFAWidget & | other | ) |

Assign operator.

Parameters

  [in] | other | Another XFA widget object, whose value would be assigned to current object.

Returns
  Reference to current object itself.

## ◆ operator==()

bool foxit::addon::xfa::XFAWidget::operator== | ( | const XFAWidget & | other | ) | const

Equal operator.

Parameters

  [in] | other | Another XFA widget object. This function will check if current object is equal to this one.

Returns
  true means equal, while false means not equal.

## ◆ ResetData()

void foxit::addon::xfa::XFAWidget::ResetData | ( |  | ) |

Reset XFA Widget Data.

Returns
  None.

## ◆ SetCheckState()

void foxit::addon::xfa::XFAWidget::SetCheckState | ( | bool | 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 foxit::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()

void foxit::addon::xfa::XFAWidget::SetDefaultValue | ( | const wchar_t * | value | ) |

Set the default value string.

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

Parameters

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

Returns
  None.

## ◆ SetImage()

void foxit::addon::xfa::XFAWidget::SetImage | ( | const foxit::common::Image & | image | ) |

Set the image for current XFA widget.

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

Parameters

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

Returns
  None.

## ◆ SetOptions()

bool foxit::addon::xfa::XFAWidget::SetOptions | ( | const addon::xfa::WidgetChoiceOptionArray & | 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_array | An array of choice options to be set.

Returns
  true means success, while false means failure.

## ◆ SetValue()

void foxit::addon::xfa::XFAWidget::SetValue | ( | const wchar_t * | value | ) |

Set the value string.

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

Parameters

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

Returns
  None.

## ◆ ValidateValue()

bool foxit::addon::xfa::XFAWidget::ValidateValue | ( | const wchar_t * | value,
|  | WString & | format
| ) |  |

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

This function can be called before the function 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.