Foxit PDF SDK

Public Member Functions | List of all members
foxit::pdf::interform::Control Class Reference
Inheritance diagram for foxit::pdf::interform::Control:

## Public Member Functions
| Control (const Control &other)
| Constructor, with another form control object. More...
| ~Control ()
| Destructor.
common::Alignment | GetAlignment ()
| Get the alignment value. More...
DefaultAppearance | GetDefaultAppearance () const
| Get the default appearance data. More...
WString | GetExportValue () const
| Get export mapping name when related form field is check box or radio button. More...
Field | GetField () const
| Get the related form field. More...
int | GetIndex () const
| Get the index of current form control among all the controls of related form field. More...
annots::Widget | GetWidget () const
| Get the related widget annotation. More...
objects::PDFDictionary * | GetWidgetDict () const
| Get the dictionary of related widget annotation. More...
bool | IsChecked () const
| Check if the current form control is checked when related form field is check box or radio button. More...
bool | IsDefaultChecked () const
| Check if the current form control is checked by default when related form field is check box or radio button. More...
bool | IsEmpty () const
| Check whether current object is empty or not. More...
bool | operator!= (const Control &other) const
| Not equal operator. More...
Control & | operator= (const Control &other)
| Assign operator. More...
bool | operator== (const Control &other) const
| Equal operator. More...
void | SetAlignment (common::Alignment alignment)
| Set alignment property of current form control. More...
void | SetChecked (bool checked_status)
| Set the check state of current form control when related form field is check box or radio button. More...
void | SetDefaultAppearance (const DefaultAppearance &default_ap)
| Set default appearance data. More...
void | SetDefaultChecked (bool checked_status)
| Set the default check state of current form control when related form field is check box or radio button. More...
void | SetExportValue (const wchar_t *value)
| Set export mapping name when related form field is check box or radio button. More...
Public Member Functions inherited from foxit::Base
FS_HANDLE | Handle () const
| Get the handle of current object. 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 Form::GetControl.
- from a form field, please use functions Field::GetControl.

Form control also offers functions to get related form field object and widget annotation object.
Function Form::AddControl can be used to add a new form control to a form field, and function Form::RemoveControl can be used to remove a form control.

See also
  Form
  Field

## Constructor & Destructor Documentation

## ◆ Control()

foxit::pdf::interform::Control::Control | ( | const Control & | other | ) |

Constructor, with another form control object.

Parameters

  [in] | other | Another form control object.

## Member Function Documentation

## ◆ GetAlignment()

common::Alignment foxit::pdf::interform::Control::GetAlignment | ( |  | ) |

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

Returns
  Alignment value. Please refer to values starting from common::e_AlignmentLeft and this would be one of these values.

## ◆ GetDefaultAppearance()

DefaultAppearance foxit::pdf::interform::Control::GetDefaultAppearance | ( |  | ) | const

Get the default appearance data.

Returns
  The default appearance data.

## ◆ GetExportValue()

WString foxit::pdf::interform::Control::GetExportValue | ( |  | ) | const

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

Returns
  The export mapping name.

## ◆ GetField()

Field foxit::pdf::interform::Control::GetField | ( |  | ) | const

Get the related form field.

Returns
  The related form field object.

## ◆ GetIndex()

int foxit::pdf::interform::Control::GetIndex | ( |  | ) | const

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

Returns
  The index of the form control.

## ◆ GetWidget()

annots::Widget foxit::pdf::interform::Control::GetWidget | ( |  | ) | const

Get the related widget annotation.

Returns
  The related widget annotation.

## ◆ GetWidgetDict()

objects::PDFDictionary* foxit::pdf::interform::Control::GetWidgetDict | ( |  | ) | const

Get the dictionary of related widget annotation.

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

## ◆ IsChecked()

bool foxit::pdf::interform::Control::IsChecked | ( |  | ) | const

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

Returns
  true means checked, and false means not checked.

## ◆ IsDefaultChecked()

bool foxit::pdf::interform::Control::IsDefaultChecked | ( |  | ) | const

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

Returns
  true means checked by default, and false means not checked by default.

## ◆ IsEmpty()

bool foxit::pdf::interform::Control::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.

## ◆ operator!=()

bool foxit::pdf::interform::Control::operator!= | ( | const Control & | other | ) | const

Not equal operator.

Parameters

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

Returns
  true means not equal, while false means equal.

## ◆ operator=()

Control& foxit::pdf::interform::Control::operator= | ( | const Control & | other | ) |

Assign operator.

Parameters

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

Returns
  Reference to current object itself.

## ◆ operator==()

bool foxit::pdf::interform::Control::operator== | ( | const Control & | other | ) | const

Equal operator.

Parameters

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

Returns
  true means equal, while false means not equal.

## ◆ SetAlignment()

void foxit::pdf::interform::Control::SetAlignment | ( | common::Alignment | alignment | ) |

Set alignment property of current form control.

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.

Parameters

  [in] | alignment | New default alignment type of variable text. Please refer to values starting from common::e_AlignmentLeft and this should be one of these values. If other values is used to set, common::e_AlignmentLeft will be used by default.

Returns
  None.

## ◆ SetChecked()

void foxit::pdf::interform::Control::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 | true means checked, and false means not checked.

Returns
  None.

## ◆ SetDefaultAppearance()

void foxit::pdf::interform::Control::SetDefaultAppearance | ( | const DefaultAppearance & | default_ap | ) |

Set default appearance data.

Parameters

  [in] | default_ap | The new default appearance. flags of input data can be used to decide which information is/are to be updated with the new data; for those no updated data, they will keep to use old data. If text_size of input default appearance data is 0, that means the text size should be calculated automatically.

Returns
  None.

## ◆ SetDefaultChecked()

void foxit::pdf::interform::Control::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 | true means checked by default, and false means not checked by default.

Returns
  None.

## ◆ SetExportValue()

void foxit::pdf::interform::Control::SetExportValue | ( | const wchar_t * | value | ) |

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 do nothing.

Parameters

  [in] | value | The new export mapping name. It should not be an empty string.

Returns
  None.