Foxit PDF SDK

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

## Instance Methods
(NSString *) | - getAppearanceOnStateName
| Get the name of the annotation's appearance "ON" state. More...
(FSControl *) | - getControl
| Get associated form control. More...
(FSField *) | - getField
| Get associated form field. More...
(FSWidgetLineSpacingStyle) | - getLineSpacing:
| Get line spacing of current widget. More...
(BOOL) | - hasMKEntry:
| Check if a specified entry exists in the MK dictionary. More...
(id) | - init
| Constructor.
(id) | - initWithAnnot:
| Constructor, with parent class object. More...
(void) | - removeAction
| Remove action. More...
(void) | - removeMKEntry:
| Remove a specified entry from the MK dictionary. More...
(void) | - setLineSpacing:line_spacing_value:
| Set line spacing for current widget. More...
(void) | - setMKDownIconImage:frame_index:
| Set an image with specified frame index as down icon in the MK dictionary. More...
(void) | - setMKNormalIconImage:frame_index:
| Set an image with specified frame index as normal icon in the MK dictionary. More...
(void) | - setMKRolloverIconImage:frame_index:
| Set an image with specified frame index as rollover icon in the MK dictionary. More...
Instance Methods inherited from FSAnnot
(BOOL) | - FSMoveWithResetAppearance:is_reset_appearance:
| Move current annotation to a new position, specified by a new rectangle in PDF coordinate system. More...
(BOOL) | - FSResetApStreamWithIsGenerateNewAppearanceObj:
| Reset appearance stream. More...
(FSPDFStream *) | - getAppearanceStream:appearance_state:
| Get annotation's appearance stream with specified type and state. More...
(FSRectI *) | - getDeviceRect:
| Get annotation rectangle in device coordinate system. More...
(FSPDFDictionary *) | - getDict
| Get annotation's dictionary object. More...
(FSMatrix2D *) | - getDisplayMatrix:
| Get the display matrix, from PDF coordinate system to targeted device coordinate system. More...
(int) | - getIndex
| Get the index of current annotation in the page which current annotation belongs to. More...
(FSPDFDictionary *) | - getOptionalContent
| Get the PDF dictionary of annotation's optional content. More...
(FSPDFPage *) | - getPage
| Get the related PDF page. More...
(FSRectF *) | - getRect
| Get rectangle, in PDF coordinate system. More...
(FSAnnotType) | - getType
| Get actual annotation type of current annotation. More...
(BOOL) | - hasProperty:
| Whether current annotation has the specified annotation's property. More...
(id) | - initWithPage:annot_dict:
| Constructor, with PDF page and annotation's PDF dictionary. More...
(BOOL) | - isEmpty
| Check whether current object is empty or not. More...
(BOOL) | - isMarkup
| Check if current annotation is a markup annotation. More...
(BOOL) | - move:
| Move current annotation to a new position, specified by a new rectangle in PDF coordinate system. More...
(BOOL) | - removeProperty:
| Remove a specified annotation's property. More...
(BOOL) | - resetAppearanceStream
| Reset appearance stream. More...

## Properties
FSAction * | action
| Get or Set action. More...
NSString * | appearanceState
| Get or Set the annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary.
FSAnnotHighlightingMode | highlightingMode
| Get or Set highlighting mode. More...
unsigned int | mKBackgroundColor
| Get or Set the background color in the MK dictionary. More...
unsigned int | mKBorderColor
| Get or Set the border color in the MK dictionary. More...
NSString * | mKDownCaption
| Get or Set the down caption string in the MK dictionary. More...
FSBitmap * | mKDownIconBitmap
| Get or Set the down icon bitmap in the MK dictionary. More...
FSAnnotMKIconCaptionRelation | mKIconCaptionRelation
| Get or Set the relation of icon and caption in the MK dictionary. More...
FSIconFit * | mKIconFit
| Get or Set the icon fit information in the MK dictionary. More...
NSString * | mKNormalCaption
| Get or Set the normal caption string in the MK dictionary. More...
FSBitmap * | mKNormalIconBitmap
| Get or Set the normal icon bitmap in the MK dictionary. More...
NSString * | mKRolloverCaption
| Get or Set the rollover caption string in the MK dictionary. More...
FSBitmap * | mKRolloverIconBitmap
| Get or Set the rollover icon bitmap in the MK dictionary. More...
FSRotation | mKRotation
| Get or Set the rotation value in the MK dictionary. More...
Properties inherited from FSAnnot
unsigned int | borderColor
| Get or Set border color. More...
FSBorderInfo * | borderInfo
| Get or Set border information. More...
NSString * | content
| Get or Set content.
unsigned int | flags
| Get or Set annotation flags.
FSDateTime * | modifiedDateTime
| Get or Set last modified date time.
NSString * | uniqueID
| Get or Set unique ID.

## Detailed Description

A widget annotation is used to represent the appearance of form fields.
Class FSWidget is derived from class FSAnnot and also offers functions to get/set widget annotation's properties. Functions FSWidget::getField and FSWidget::getControl can be used to get the associated form field and form control object. If a widget annotation is not associated with any form field or is associated with a signature field, this widget can still get/set properties, but cannot be reset appearance. For these cases, FSAnnot::resetAppearanceStream (inherited from Widget's parent class) will return NO directly.

See also
  FSAnnot
  FSField
  FSControl

## Method Documentation

## ◆ getAppearanceOnStateName()

- (NSString *) getAppearanceOnStateName |  |  |

Get the name of the annotation's appearance "ON" state.

Returns
  The name of the annotation's appearance "ON" state.

## ◆ getControl()

- (FSControl *) getControl |  |  |

Get associated form control.

Returns
  The associated form control object.

## ◆ getField()

- (FSField *) getField |  |  |

Get associated form field.

Returns
  The associated form field object.

## ◆ getLineSpacing:()

- (FSWidgetLineSpacingStyle) getLineSpacing: |  | (float *) | line_spacing_value |

Get line spacing of current widget.

This is only applicable for widget associated with text fields which contain the flag FSFieldFlagTextMultiline. For other type of fields, this will be useless.

Parameters

  [out] | line_spacing_value | Output parameter that receives the line spacing exact value.

Returns
  Line spacing style. Please refer to values starting from FSWidgetLineSpacingSingle and this would be one of these values.

## ◆ hasMKEntry:()

- (BOOL) hasMKEntry: |  | (FSAnnotMKEntry) | mk_entry |

Check if a specified entry exists in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

Parameters

  [in] | mk_entry | An entry in MK dictionary. Please refer to values starting from FSAnnotMKEntryRotation and this should be one of these values.

Returns
  YES means the specified entry exists in the MK dictionary, while NO means not.

## ◆ initWithAnnot:()

- (id) initWithAnnot: |  | (FSAnnot*) | annot |

Constructor, with parent class object.

Parameters

  [in] | annot | Parent class object.

Reimplemented from FSAnnot.

## ◆ removeAction()

- (void) removeAction |  |  |

Remove action.

This function cannot be used to remove action which is used as additional action. If user wants to remove any additional action, please refer to class FSAdditionalAction for more details.

Returns
  None.

## ◆ removeMKEntry:()

- (void) removeMKEntry: |  | (FSAnnotMKEntry) | mk_entry |

Remove a specified entry from the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

Parameters

  [in] | mk_entry | An entry in MK dictionary. Please refer to values starting from FSAnnotMKEntryRotation and this should be one of these values.

Returns
  None.

## ◆ setLineSpacing:line_spacing_value:()

- (void) setLineSpacing: |  | (FSWidgetLineSpacingStyle) | line_spacing_style
line_spacing_value: |  | (float) | line_spacing_value

Set line spacing for current widget.

This is only applicable for widget associated with text fields which contain the flag FSFieldFlagTextMultiline. For other type of fields, this will be useless.

Parameters

  [in] | line_spacing_style | Line spacing style to be set to current widget.Please refer to values starting from FSWidgetLineSpacingSingle and this would be one of these values.
  [in] | line_spacing_value | Line spacing exact value to be set to current widget when parameter line_spacing_style is FSWidgetLineSpacingExactValue. When this parameter is useful, this parameter must be an non-negative value and the unit should be "pt" (known as point). If this value is zero, the effect of line spacing will be the same as single line spacing.

Returns
  None.

## ◆ setMKDownIconImage:frame_index:()

- (void) setMKDownIconImage: |  | (FSImage*) | image
frame_index: |  | (int) | frame_index

Set an image with specified frame index as down icon in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page. Down icon (or alternate icon) in MK dictionary is used to displayed when the mouse button is pressed within its active area. This is applicable for widget associated with pushbutton field. For other type of fields, this will be useless.

Parameters

  [in] | image | An image. One of its frames will be set as down icon in MK dictionary. This image should contain at least one frame and the image type should not be FSImageUnknown.
  [in] | frame_index | Frame index. Valid range: from 0 to (count-1). count is returned by function FSImage::getFrameCount.

## ◆ setMKNormalIconImage:frame_index:()

- (void) setMKNormalIconImage: |  | (FSImage*) | image
frame_index: |  | (int) | frame_index

Set an image with specified frame index as normal icon in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page. Normal icon in MK dictionary is used to displayed when the widget is not interacting with the user. This is applicable for widget associated with pushbutton field. For other type of fields, this will be useless.

Parameters

  [in] | image | An image. One of its frames will be set as normal icon in MK dictionary. This image should contain at least one frame and the image type should not be FSImageUnknown.
  [in] | frame_index | Frame index. Valid range: from 0 to (count-1). count is returned by function FSImage::getFrameCount.

## ◆ setMKRolloverIconImage:frame_index:()

- (void) setMKRolloverIconImage: |  | (FSImage*) | image
frame_index: |  | (int) | frame_index

Set an image with specified frame index as rollover icon in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page. Rollover icon in MK dictionary is used to displayed when the user rolls the cursor into its active area without pressing the mouse button. This is applicable for widget associated with pushbutton field. For other type of fields, this will be useless.

Parameters

  [in] | image | An image. One of its frames will be set as rollover icon in MK dictionary. This image should contain at least one frame and the image type should not be FSImageUnknown.
  [in] | frame_index | Frame index. Valid range: from 0 to (count-1). count is returned by function FSImage::getFrameCount.

## Property Documentation

## ◆ action

- (FSAction *) action
| read write nonatomic weak

Get or Set action.

This function cannot be used to get action which is used as additional action. If user wants to get any additional action, please refer to class FSAdditionalAction for more details.

## ◆ highlightingMode

- (FSAnnotHighlightingMode) highlightingMode
| read write nonatomic assign

Get or Set highlighting mode.

Highlighting mode is the visual effect to be used when the mouse button is pressed or held down inside its active area.

## ◆ mKBackgroundColor

- (unsigned int) mKBackgroundColor
| read write nonatomic assign

Get or Set the background color in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

## ◆ mKBorderColor

- (unsigned int) mKBorderColor
| read write nonatomic assign

Get or Set the border color in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

## ◆ mKDownCaption

- (NSString *) mKDownCaption
| read write nonatomic weak

Get or Set the down caption string in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page. Down caption (or alternate caption) in MK dictionary is used to displayed when the mouse button is pressed within its active area. This is applicable for widget associated with pushbutton field. For other type of fields, this will be useless.

## ◆ mKDownIconBitmap

- (FSBitmap *) mKDownIconBitmap
| read write nonatomic weak

Get or Set the down icon bitmap in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page. Down icon (or alternate icon) in MK dictionary is used to displayed when the mouse button is pressed within its active area. This is applicable for widget associated with pushbutton field. For other type of fields, this will be useless.

## ◆ mKIconCaptionRelation

- (FSAnnotMKIconCaptionRelation) mKIconCaptionRelation
| read write nonatomic assign

Get or Set the relation of icon and caption in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page. The relation position of caption and icon specifies where to position the text of the widget annotation's caption relative to its icon. This is applicable for widget associated with pushbutton field. For other type of fields, this will be useless.

## ◆ mKIconFit

- (FSIconFit *) mKIconFit
| read write nonatomic weak

Get or Set the icon fit information in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page. The icon fit information specifies how to display the widget annotation's icon within its annotation rectangle. If present, the icon fit information applies to all of the annotation's icons. This is applicable for widget associated with pushbutton field. For other type of fields, this will be useless.

## ◆ mKNormalCaption

- (NSString *) mKNormalCaption
| read write nonatomic weak

Get or Set the normal caption string in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page. Normal caption in MK dictionary is used to displayed when the widget is not interacting with the user. This is applicable for widget associated with pushbutton field, check box field or radio button field. For other type of fields, this will be useless.

## ◆ mKNormalIconBitmap

- (FSBitmap *) mKNormalIconBitmap
| read write nonatomic weak

Get or Set the normal icon bitmap in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page. Normal icon in MK dictionary is used to displayed when the widget is not interacting with the user. This is applicable for widget associated with pushbutton field. For other type of fields, this will be useless.

## ◆ mKRolloverCaption

- (NSString *) mKRolloverCaption
| read write nonatomic weak

Get or Set the rollover caption string in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page. Rollover caption in MK dictionary is used to displayed when the user rolls the cursor into its active area without pressing the mouse button. This is applicable for widget associated with pushbutton field. For other type of fields, this will be useless.

## ◆ mKRolloverIconBitmap

- (FSBitmap *) mKRolloverIconBitmap
| read write nonatomic weak

Get or Set the rollover icon bitmap in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page. Rollover icon in MK dictionary is used to displayed when the user rolls the cursor into its active area without pressing the mouse button. This is applicable for widget associated with pushbutton field. For other type of fields, this will be useless.

## ◆ mKRotation

- (FSRotation) mKRotation
| read write nonatomic assign

Get or Set the rotation value in the MK dictionary.

MK dictionary is an appearance characteristics dictionary to be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page. The rotation in MK dictionary specifies the degrees by which the widget annotation is rotated counterclockwise relative to the page.