Foxit PDF SDK
FSXFAWidget Class Reference
Inheritance diagram for FSXFAWidget:
FSBase

Instance Methods

(FSBitmap *) - getBitmap
 Get the bitmap of current XFA widget.
More...
 
(FSXFAWidgetWidgetHAlignType- getHAlign
 Get text horizontal alignment.
More...
 
(int) - getIndex
 Get the index of XFA Widget in related XFA page.
More...
 
(NSString *) - getJavaScript
 Get the JavaScript of validation for current XFA widget.
More...
 
(NSString *) - getName:
 Get Widget name.
More...
 
(FSWidgetChoiceOptionArray *) - getOptions
 Get options of a choice list or an Exclusion Group (for radio button only).
More...
 
(FSXFAWidgetPresenceProperty- getPresence
 Get the presence property of the XFA widget.
More...
 
(FSRectF *) - getRect
 Get rectangle of XFA widget.
More...
 
(FSSignature *) - getSignature
 Get the signature object from current XFA widget.
More...
 
(NSString *) - getToolTip
 Get tooltip string.
More...
 
(FSXFAWidgetWidgetType- getType
 Get type of XFA widget.
More...
 
(FSXFAWidgetWidgetVAlignType- getVAlign
 Get text vertical alignment.
More...
 
(FSXFAPage *) - getXFAPage
 Get the related XFA page, to which current XFA widget belongs.
More...
 
(BOOL) - hasEdge:
 Check if the edge for specified position exists.
More...
 
(id) - initWithOther:
 Constructor, with another XFA widget object.
More...
 
(BOOL) - isAllowRichText
 Check whether the widget allows rich text formatting.
More...
 
(BOOL) - isChecked
 Check if current XFA widget is checked.
More...
 
(BOOL) - isEmpty
 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:flags:
 Call this function when a character code is being input.
More...
 
(FSXFAWidgetHitTestArea- onHitTest:
 Call this function to do hit test for a specified point.
More...
 
(BOOL) - onKeyDown:flags:
 Call this function when key on the keyboard is down.
More...
 
(BOOL) - onKeyUp:flags:
 Call this function when key on the keyboard is up.
More...
 
(BOOL) - onLButtonDoubleClick:flags:
 Call this function when left mouse button is double-clicked .
More...
 
(BOOL) - onLButtonDown:flags:
 Call this function when left mouse button is down.
More...
 
(BOOL) - onLButtonUp: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:flags:
 Call this function when mouse moves.
More...
 
(BOOL) - onRButtonDown:flags:
 Call this function when right mouse is down.
More...
 
(BOOL) - onRButtonUp:flags:
 Call this function when right button is up.
More...
 
(void) - resetData
 Reset XFA Widget Data.
More...
 
(void) - setCheckState:
 Set the checked state of the current XFA widget.
More...
 
(void) - setImage:
 Set the image for current XFA widget.
More...
 
(BOOL) - setOptions:
 Set options of a choice list or an Exclusion Group (for radio button only).
More...
 
(BOOL) - validateValue:format:
 Validate whether the value conforms to the format of current XFA widget.
More...
 

Properties

NSString * defaultValue
 Get or Set the default value string.

 
NSString * value
 Get or Set the value string.

 

Detailed Description

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

See also
FSWidgetMenu

Method Documentation

◆ getBitmap()

- (FSBitmap *) getBitmap

Get the bitmap of current XFA widget.

Applicable only when the type of current XFA widget is FSXFAWidgetWidgetTypeImageEdit or FSXFAWidgetWidgetTypeImage. For types that are not applicable, this function will throw exception FSErrUnsupported.

Returns
The bitmap of current XFA widget.

◆ getHAlign()

Get text horizontal alignment.

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

◆ getIndex()

- (int) getIndex

Get the index of XFA Widget in related XFA page.

Returns
The index of XFA Widget in related XFA page.

◆ getJavaScript()

- (NSString *) getJavaScript

Get the JavaScript of validation for current XFA widget.

Returns
The JavaScript of validation for current XFA widget.

◆ getName:()

- (NSString *) getName: (FSXFAWidgetWidgetNameType type

Get Widget name.

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

◆ getOptions()

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

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

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

- (FSSignature *) 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 FSErrUnsupported.

Returns
A signature object.

◆ getToolTip()

- (NSString *) getToolTip

Get tooltip string.

Returns
Tooltip string.

◆ getType()

- (FSXFAWidgetWidgetType) getType

Get type of XFA widget.

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

◆ getVAlign()

Get text vertical alignment.

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

◆ getXFAPage()

- (FSXFAPage *) getXFAPage

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

Returns
An XFA page object.

◆ hasEdge:()

- (BOOL) hasEdge: (FSXFAWidgetWidgetEdgePosition 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 FSXFAWidgetWidgetEdgePositionTop and this should be one of these values.
Returns
YES means that the edge for specified position exists, while NO means that no such edge exist.

◆ initWithOther:()

- (id) initWithOther: (FSXFAWidget*)  other

Constructor, with another XFA widget object.

Parameters
[in]otherAnother XFA widget object.

◆ isAllowRichText()

- (BOOL) isAllowRichText

Check whether the widget allows rich text formatting.

Only text edit widget which type is FSXFAWidgetWidgetTypeTextEdit supports rich text.

Returns
YES means the widget allows rich text formatting, while NO means not.

◆ isChecked()

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

Returns
YES means checked, while NO means unchecked or failure.

◆ isEmpty()

- (BOOL) isEmpty

Check whether current object is empty or not.

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

Returns
YES means current object is empty, while NO means not.

◆ isListBox()

- (BOOL) isListBox

Check whether the widget is listbox or not.

Returns
YES means the widget is listbox, while NO means not.

◆ isReadOnly()

- (BOOL) isReadOnly

Check whether the widget is read only.

Returns
YES means the value of the field can not be changed, while NO means it can be changed.

◆ isRequired()

- (BOOL) isRequired

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

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

◆ isSupportMultiline()

- (BOOL) isSupportMultiline

Check whether the widget supports multiple lines.

Only text edit widget which type is FSXFAWidgetWidgetTypeTextEdit supports multiple lines.

Returns
YES means the widget supports multiple lines, while NO means not.

◆ isSupportMultiSelect()

- (BOOL) isSupportMultiSelect

Check whether the widget supports multiple selections.

Only the list box widget supports multiline selections, whose type is FSXFAWidgetWidgetTypeChoiceList and the return value of function FSXFAWidget::isListBox is YES.

Returns
YES means the widget support multiple selections, while NO means not.

◆ onChar:flags:()

- (BOOL) onChar: (int)  input_char
flags: (unsigned int)  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 FSFillerEventFlagShiftKey and this should be one or a combination of these values.
Returns
YES means success, while NO means failure.

◆ onHitTest:()

- (FSXFAWidgetHitTestArea) onHitTest: (FSPointF*)  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 FSXFAWidgetHitTestAreaUnknown and this would be one of these values.

◆ onKeyDown:flags:()

- (BOOL) onKeyDown: (unsigned int)  key_code
flags: (unsigned int)  flags 

Call this function when key on the keyboard is down.

Parameters
[in]key_codeThe key code. Please refer to values starting from FSFillerVkeyUnknown and this should be one of these values.
[in]flagsEvent flags. Please refer to values starting from FSFillerEventFlagShiftKey and this should be one or a combination of these values.
Returns
YES means success, while NO means failure.

◆ onKeyUp:flags:()

- (BOOL) onKeyUp: (unsigned int)  key_code
flags: (unsigned int)  flags 

Call this function when key on the keyboard is up.

Parameters
[in]key_codeThe key code. Please refer to values starting from FSFillerVkeyUnknown and this should be one of these values.
[in]flagsEvent flags. Please refer to values starting from FSFillerEventFlagShiftKey and this should be one or a combination of these values.
Returns
YES means success, while NO means failure.

◆ onLButtonDoubleClick:flags:()

- (BOOL) onLButtonDoubleClick: (FSPointF*)  point
flags: (unsigned int)  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 FSFillerEventFlagShiftKey and this should be one or a combination of these values.
Returns
YES means success, while NO means failure.

◆ onLButtonDown:flags:()

- (BOOL) onLButtonDown: (FSPointF*)  point
flags: (unsigned int)  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 FSFillerEventFlagShiftKey and this should be one or a combination of these values.
Returns
YES means success, while NO means failure.

◆ onLButtonUp:flags:()

- (BOOL) onLButtonUp: (FSPointF*)  point
flags: (unsigned int)  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 FSFillerEventFlagShiftKey and this should be one or a combination of these values.
Returns
YES means success, while NO means failure.

◆ onMouseEnter()

- (BOOL) onMouseEnter

Call this function when mouse enters current XFA widget.

Returns
YES means success, while NO means failure.

◆ onMouseExit()

- (BOOL) onMouseExit

Call this function when mouse exits.

Returns
YES means success, while NO means failure.

◆ onMouseMove:flags:()

- (BOOL) onMouseMove: (FSPointF*)  point
flags: (unsigned int)  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 FSFillerEventFlagShiftKey and this should be one or a combination of these values.
Returns
YES means success, while NO means failure.

◆ onRButtonDown:flags:()

- (BOOL) onRButtonDown: (FSPointF*)  point
flags: (unsigned int)  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 FSFillerEventFlagShiftKey and this should be one or a combination of these values.
Returns
YES means success, while NO means failure.

◆ onRButtonUp:flags:()

- (BOOL) onRButtonUp: (FSPointF*)  point
flags: (unsigned int)  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 FSFillerEventFlagShiftKey and this should be one or a combination of these values.
Returns
YES means success, while NO means failure.

◆ resetData()

- (void) resetData

Reset XFA Widget Data.

Returns
None.

◆ setCheckState:()

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

Parameters
[in]is_checkedYES means the current XFA widget will be checked, while NO means it will not be checked.
Returns
None.

◆ setImage:()

- (void) setImage: (FSImage*)  image

Set the image for current XFA widget.

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

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 FSErrUnsupported will be thrown.
Returns
None.

◆ setOptions:()

- (BOOL) setOptions: (FSWidgetChoiceOptionArray*)  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 NO.

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

◆ validateValue:format:()

- (BOOL) validateValue: (NSString *)  value
format: (NSString *)  format 

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

This function can be called before the function FSXFAWidget::value to check whether the value conforms to the format of current XFA widget.

Parameters
[in]valueA string value to be validated.
[out]formatA string value that receives the format of current XFA widget. It will be an empty string if current XFA widget has no format.
Returns
YES means the value conforms to the format of current XFA widget, while NO means not.