Foxit PDF SDK
foxit.addon.xfa.XFAWidget Class Reference
Inheritance diagram for foxit.addon.xfa.XFAWidget:
foxit.common.Base

Public Types

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

Public Member Functions

 XFAWidget (XFAWidget other)
 Constructor, with another XFA widget object. More...
 
Bitmap GetBitmap ()
 Get the bitmap of current XFA widget. More...
 
XFAWidget.WidgetHAlignType GetHAlign ()
 Get text horizontal alignment. More...
 
int GetIndex ()
 Get the index of XFA Widget in related XFA page. More...
 
string GetName (XFAWidget.WidgetNameType type)
 Get Widget name. More...
 
WidgetChoiceOptionArray GetOptions ()
 Get options of a choice list or an Exclusion Group (for radion button only). More...
 
XFAWidget.PresenceProperty GetPresence ()
 Get the presence property of the XFA widget. More...
 
RectF GetRect ()
 Get rectangle of XFA widget. More...
 
Signature GetSignature ()
 Get the signature object from current XFA widget. More...
 
string GetToolTip ()
 Get tooltip string. More...
 
XFAWidget.WidgetType GetType ()
 Get type of XFA widget. More...
 
XFAWidget.WidgetVAlignType GetVAlign ()
 Get text vertical alignment. More...
 
string GetValue ()
 Get the value string. More...
 
XFAPage GetXFAPage ()
 Get the related XFA page, to which current XFA widget belongs. More...
 
bool HasEdge (XFAWidget.WidgetEdgePosition edge_pos)
 Check if the edge for specified position exists. More...
 
bool IsChecked ()
 Check if current XFA widget is checked when it is a check box or a radio button. More...
 
bool IsEmpty ()
 Check whether current object is empty or not. More...
 
bool OnChar (int input_char, int flags)
 Call this function when a character code is being input. More...
 
XFAWidget.HitTestArea OnHitTest (PointF point)
 Call this function to do hit test for a specified point. More...
 
bool OnKeyDown (int key_code, int flags)
 Call this function when key on the keyboard is down. More...
 
bool OnKeyUp (int key_code, int flags)
 Call this function when key on the keyboard is up. More...
 
bool OnLButtonDoubleClick (PointF point, int flags)
 Call this function when left mouse button is double-clicked . More...
 
bool OnLButtonDown (PointF point, int flags)
 Call this function when left mouse button is down. More...
 
bool OnLButtonUp (PointF point, int 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 (PointF point, int flags)
 Call this function when mouse moves. More...
 
bool OnRButtonDown (PointF point, int flags)
 Call this function when right mouse is down. More...
 
bool OnRButtonUp (PointF point, int flags)
 Call this function when right button is up. More...
 
void ResetData ()
 Reset XFA Widget Data. More...
 
void SetValue (string 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 foxit.addon.xfa.WidgetMenu object with XFAWidget object.

See also
WidgetMenu

Member Enumeration Documentation

◆ 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

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

Enumeration for the positon of XFA widget edge position.

Values of this enumeration should be used alone.

Enumerator
e_WidgetEdgePositionTop 

Egde position: top.

e_WidgetEdgePositionRight 

Egde position: right.

e_WidgetEdgePositionBottom 

Egde position: bottom.

e_WidgetEdgePositionLeft 

Egde position: left.

◆ 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

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

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

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 ( XFAWidget  other)
inline

Constructor, with another XFA widget object.

Parameters
[in]otherAnother XFA widget object.

Member Function Documentation

◆ GetBitmap()

Bitmap foxit.addon.xfa.XFAWidget.GetBitmap ( )
inline

Get the bitmap of current XFA widget.

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

Returns
The bitmap of current XFA widget.

◆ GetHAlign()

XFAWidget.WidgetHAlignType foxit.addon.xfa.XFAWidget.GetHAlign ( )
inline

Get text horizontal alignment.

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

◆ GetIndex()

int foxit.addon.xfa.XFAWidget.GetIndex ( )
inline

Get the index of XFA Widget in related XFA page.

Returns
The index of XFA Widget in related XFA page.

◆ GetName()

string foxit.addon.xfa.XFAWidget.GetName ( XFAWidget.WidgetNameType  type)
inline

Get Widget name.

Parameters
[in]typeName type. Please refer to values starting from foxit.addon.xfa.XFAWidget.WidgetNameType.e_WidgetNameTypeField and this should be one of these values.
Returns
Widget name string.

◆ GetOptions()

WidgetChoiceOptionArray foxit.addon.xfa.XFAWidget.GetOptions ( )
inline

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

XFAWidget.PresenceProperty foxit.addon.xfa.XFAWidget.GetPresence ( )
inline

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

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

Signature foxit.addon.xfa.XFAWidget.GetSignature ( )
inline

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.common.ErrorCode.e_ErrUnsupported .

Returns
A signature object.

◆ GetToolTip()

string foxit.addon.xfa.XFAWidget.GetToolTip ( )
inline

Get tooltip string.

Returns
Tooltip string.

◆ GetType()

XFAWidget.WidgetType foxit.addon.xfa.XFAWidget.GetType ( )
inline

Get type of XFA widget.

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

◆ GetVAlign()

XFAWidget.WidgetVAlignType foxit.addon.xfa.XFAWidget.GetVAlign ( )
inline

Get text vertical alignment.

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

◆ GetValue()

string foxit.addon.xfa.XFAWidget.GetValue ( )
inline

Get the value string.

Returns
The value string.

◆ GetXFAPage()

XFAPage foxit.addon.xfa.XFAWidget.GetXFAPage ( )
inline

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

Returns
An XFA page object.

◆ HasEdge()

bool foxit.addon.xfa.XFAWidget.HasEdge ( XFAWidget.WidgetEdgePosition  edge_pos)
inline

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 foxit.addon.xfa.XFAWidget.WidgetEdgePosition.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.

◆ IsChecked()

bool foxit.addon.xfa.XFAWidget.IsChecked ( )
inline

Check if current XFA widget is checked when it is a check box or a radio button.

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

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.

◆ OnChar()

bool foxit.addon.xfa.XFAWidget.OnChar ( int  input_char,
int  flags 
)
inline

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 foxit.pdf.interform.Filler.EventFlags.e_EventFlagShiftKey and this should be one or a combination of these values.
Returns
true means success, while false means failure.

◆ OnHitTest()

XFAWidget.HitTestArea foxit.addon.xfa.XFAWidget.OnHitTest ( PointF  point)
inline

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 foxit.addon.xfa.XFAWidget.HitTestArea.e_HitTestAreaUnknown and this would be one of these values.

◆ OnKeyDown()

bool foxit.addon.xfa.XFAWidget.OnKeyDown ( int  key_code,
int  flags 
)
inline

Call this function when key on the keyboard is down.

Parameters
[in]key_codeThe key code. Please refer to values starting from foxit.pdf.interform.Filler.VirtualKeyCode.e_VkeyUnknown and this should be one of these values.
[in]flagsEvent flags. Please refer to values starting from foxit.pdf.interform.Filler.EventFlags.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 ( int  key_code,
int  flags 
)
inline

Call this function when key on the keyboard is up.

Parameters
[in]key_codeThe key code. Please refer to values starting from foxit.pdf.interform.Filler.VirtualKeyCode.e_VkeyUnknown and this should be one of these values.
[in]flagsEvent flags. Please refer to values starting from foxit.pdf.interform.Filler.EventFlags.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 ( PointF  point,
int  flags 
)
inline

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 foxit.pdf.interform.Filler.EventFlags.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 ( PointF  point,
int  flags 
)
inline

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 foxit.pdf.interform.Filler.EventFlags.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 ( PointF  point,
int  flags 
)
inline

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 foxit.pdf.interform.Filler.EventFlags.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 ( )
inline

Call this function when mouse enters current XFA widget.

Returns
true means success, while false means failure.

◆ OnMouseExit()

bool foxit.addon.xfa.XFAWidget.OnMouseExit ( )
inline

Call this function when mouse exits.

Returns
true means success, while false means failure.

◆ OnMouseMove()

bool foxit.addon.xfa.XFAWidget.OnMouseMove ( PointF  point,
int  flags 
)
inline

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 foxit.pdf.interform.Filler.EventFlags.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 ( PointF  point,
int  flags 
)
inline

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 foxit.pdf.interform.Filler.EventFlags.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 ( PointF  point,
int  flags 
)
inline

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 foxit.pdf.interform.Filler.EventFlags.e_EventFlagShiftKey and this should be one or a combination of these values.
Returns
true means success, while false means failure.

◆ ResetData()

void foxit.addon.xfa.XFAWidget.ResetData ( )
inline

Reset XFA Widget Data.

Returns
None.

◆ SetValue()

void foxit.addon.xfa.XFAWidget.SetValue ( string  value)
inline

Set the value string.

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