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

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...
 
WidgetHAlignType GetHAlign ()
 Get text horizontal alignment. More...
 
int GetIndex () const
 Get the index of XFA Widget in related XFA page. 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 radion 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...
 
bool HasEdge (WidgetEdgePosition edge_pos)
 Check if the edge for specified position exists. More...
 
bool IsChecked () const
 Check if current XFA widget is checked when it is a check box or a radio button. More...
 
bool IsEmpty () const
 Check whether current object is empty or not. 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...
 
XFAWidgetoperator= (const XFAWidget &other)
 Assign operator. More...
 
bool operator== (const XFAWidget &other) const
 Equal operator. More...
 
void ResetData ()
 Reset XFA Widget Data. More...
 
void SetValue (const wchar_t *value)
 Set the value string. 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

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

Constructor, with another XFA widget object.

Parameters
[in]otherAnother 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.

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

◆ GetName()

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

Get Widget name.

Parameters
[in]typeName 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 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()

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.

◆ HasEdge()

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

◆ IsChecked()

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

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

◆ 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_charA character code, in UTF16-LE encoding.
[in]flagsEvent 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]pointA 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_codeThe key code. Please refer to values starting from pdf::interform::Filler::e_VkeyUnknown and this should be one of these values.
[in]flagsEvent 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_codeThe key code. Please refer to values starting from pdf::interform::Filler::e_VkeyUnknown and this should be one of these values.
[in]flagsEvent 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]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 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]pointA point where left mouse button is down in XFA page, in PDF coordinate system.
[in]flagsEvent 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]pointA point where left mouse button is up in XFA page, in PDF coordinate system.
[in]flagsEvent 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]pointA point where left mouse button moves in XFA page, in PDF coordinate system.
[in]flagsEvent 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]pointA point where right mouse button is down in XFA page, in PDF coordinate system.
[in]flagsEvent 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]pointA point where right mouse button is up in XFA page, in PDF coordinate system.
[in]flagsEvent 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]otherAnother 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]otherAnother 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]otherAnother 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.

◆ SetValue()

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

Set the value string.

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