Foxit PDF SDK

Instance Methods | Properties | List of all members
FSControl Class Reference
Inheritance diagram for FSControl:

## Instance Methods
(FSField *) | - getField
| Get the related form field. More...
(int) | - getIndex
| Get the index of current form control among all the controls of related form field. More...
(FSWidget *) | - getWidget
| Get the related widget annotation. More...
(FSPDFDictionary *) | - getWidgetDict
| Get the dictionary of related widget annotation. More...
(id) | - initWithOther:
| Constructor, with another form control object. More...
(BOOL) | - isChecked
| Check if the current form control is checked when related form field is check box or radio button. More...
(BOOL) | - isDefaultChecked
| Check if the current form control is checked by default when related form field is check box or radio button. More...
(BOOL) | - isEmpty
| Check whether current object is empty or not. More...
(void) | - setChecked:
| Set the check state of current form control when related form field is check box or radio button. More...
(void) | - setDefaultChecked:
| Set the default check state of current form control when related form field is check box or radio button. More...

## Properties
FSAlignment | alignment
| Get or Set the alignment value. More...
FSDefaultAppearance * | defaultAppearance
| Get or Set the default appearance data.
NSString * | exportValue
| Get or Set export mapping name when related form field is check box or radio button. More...

## Detailed Description

Foxit PDF SDK defines "form control" to associate form field with its related widget annotations. A form field may have one or more form controls, and each form control is associated with a widget annotation. A form control object can be retrieved by following functions:

- from a form, please use function FSForm::getControl:index:.
- from a form field, please use functions FSField::getControlWithPDFPage:index:.

Form control also offers functions to get related form field object and widget annotation object.
Function FSForm::addControl:field_name:field_type:rect: can be used to add a new form control to a form field, and function FSForm::removeControl: can be used to remove a form control.

See also
  FSForm
  FSField

## Method Documentation

## ◆ getField()

- (FSField *) getField |  |  |

Get the related form field.

Returns
  The related form field object.

## ◆ getIndex()

- (int) getIndex |  |  |

Get the index of current form control among all the controls of related form field.

Returns
  The index of the form control.

## ◆ getWidget()

- (FSWidget *) getWidget |  |  |

Get the related widget annotation.

Returns
  The related widget annotation.

## ◆ getWidgetDict()

- (FSPDFDictionary *) getWidgetDict |  |  |

Get the dictionary of related widget annotation.

Returns
  Dictionary of related widget annotation. If there is any error, the function will return nil.

## ◆ initWithOther:()

- (id) initWithOther: |  | (FSControl*) | other |

Constructor, with another form control object.

Parameters

  [in] | other | Another form control object.

## ◆ isChecked()

- (BOOL) isChecked |  |  |

Check if the current form control is checked when related form field is check box or radio button.

Applicable for check box and radio button as related form field. If related form field is other field type, this function will return NO.

Returns
  YES means checked, and NO means not checked.

## ◆ isDefaultChecked()

- (BOOL) isDefaultChecked |  |  |

Check if the current form control is checked by default when related form field is check box or radio button.

Applicable for check box and radio button as related form field. If related form field is other field type, this function will return NO.

Returns
  YES means checked by default, and NO means not checked by default.

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

## ◆ setChecked:()

- (void) setChecked: |  | (BOOL) | checked_status |

Set the check state of current form control when related form field is check box or radio button.

Applicable for check box and radio button as related form field. If related form field is other field type, this function will do nothing.

Parameters

  [in] | checked_status | YES means checked, and NO means not checked.

Returns
  None.

## ◆ setDefaultChecked:()

- (void) setDefaultChecked: |  | (BOOL) | checked_status |

Set the default check state of current form control when related form field is check box or radio button.

Applicable for check box and radio button as related form field. If related form field is other field type, this function will do nothing.

Parameters

  [in] | checked_status | YES means checked by default, and NO means not checked by default.

Returns
  None.

## Property Documentation

## ◆ alignment

- (FSAlignment) alignment
| read write nonatomic assign

Get or Set the alignment value.

Alignment is a property for variable text and it is only useful for text field, list box and combo box as related form field, which may contain variable text as their content.
If related form field is a text field or list box and it has its own alignment value, the document-wide default alignment value will be ignored; otherwise, the document-wide default alignment value will be used in this case.

## ◆ exportValue

- (NSString *) exportValue
| read write nonatomic weak

Get or Set export mapping name when related form field is check box or radio button.

Applicable for check box and radio button as related form field. If related form field is other field type, this function will return an empty string.