Foxit PDF SDK

Public Types | Public Member Functions | List of all members
foxit::pdf::annots::Widget Class Reference
Inheritance diagram for foxit::pdf::annots::Widget:

## Public Types
enum | LineSpacingStyle { e_LineSpacingSingle = 0, e_LineSpacingOneAndHalf = 1, e_LineSpacingDouble = 2, e_LineSpacingExactValue = 3, e_LineSpacingAuto = 4 }
| Enumeration for line spacing style. More...
Public Types inherited from foxit::pdf::annots::Annot
enum | AppearanceType { e_AppearanceTypeNormal = 0, e_AppearanceTypeRollover = 1, e_AppearanceTypeDown = 2 }
| Enumeration for the type of annotation's appearance. More...
enum | Flags { e_FlagInvisible = 0x0001, e_FlagHidden = 0x0002, e_FlagPrint = 0x0004, e_FlagNoZoom = 0x0008, e_FlagNoRotate = 0x0010, e_FlagNoView = 0x0020, e_FlagReadOnly = 0x0040, e_FlagLocked = 0x0080, e_FlagToggleNoView = 0x0100, e_FlagLockedContents = 0x0200 }
| Enumeration for PDF annotation flags. More...
enum | HighlightingMode { e_HighlightingNone = 0, e_HighlightingInvert = 1, e_HighlightingOutline = 2, e_HighlightingPush = 3, e_HighlightingToggle = 4 }
| Enumeration for PDF annotation highlighting mode. More...
enum | MKEntry { e_MKEntryRotation = 0, e_MKEntryBorderColor = 1, e_MKEntryBackgroundColor = 2, e_MKEntryNormalCaption = 3, e_MKEntryRolloverCaption = 4, e_MKEntryDownCaption = 5, e_MKEntryNormalIcon = 6, e_MKEntryRolloverIcon = 7, e_MKEntryDownIcon = 8, e_MKEntryIconFit = 9, e_MKEntryIconCaptionRelation = 10 }
| Enumeration for annotation's MK dictionary (an appearance characteristics) entry. More...
enum | MKIconCaptionRelation { e_MKRelationNoIcon = 0, e_MKRelationNoCaption = 1, e_MKRelationCaptionBelowIcon = 2, e_MKRelationCaptionAboveIcon = 3, e_MKRelationCaptionRight = 4, e_MKRelationCaptionLeft = 5, e_MKRelationCaptionOvrlayOnIcon = 6 }
| Enumeration for icon and caption relative position in annotation's MK dictionary. More...
enum | Property { e_PropertyModifiedDate = 0, e_PropertyCreationDate = 1, e_PropertyBorderColor = 2, e_PropertyFillColor = 3 }
| Enumeration for some PDF annotation property. More...
enum | Type { e_UnknownType = 0, e_Note = 1, e_Link = 2, e_FreeText = 3, e_Line = 4, e_Square = 5, e_Circle = 6, e_Polygon = 7, e_PolyLine = 8, e_Highlight = 9, e_Underline = 10, e_Squiggly = 11, e_StrikeOut = 12, e_Stamp = 13, e_Caret = 14, e_Ink = 15, e_PSInk = 16, e_FileAttachment = 17, e_Sound = 18, e_Movie = 19, e_Widget = 20, e_Screen = 21, e_PrinterMark = 22, e_TrapNet = 23, e_Watermark = 24, e_3D = 25, e_Popup = 26, e_Redact = 27, e_RichMedia = 28, e_PagingSeal = 29 }
| Enumeration for PDF annotation type. More...

## Public Member Functions
| Widget ()
| Constructor.
| Widget (const Annot &annot)
| Constructor, with parent class object. More...
| ~Widget ()
| Destructor.
actions::Action | GetAction ()
| Get action. More...
String | GetAppearanceOnStateName () const
| Get the name of the annotation's appearance "ON" state. More...
String | GetAppearanceState () const
| Get the annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary. More...
interform::Control | GetControl ()
| Get associated form control. More...
interform::Field | GetField ()
| Get associated form field. More...
HighlightingMode | GetHighlightingMode ()
| Get highlighting mode. More...
LineSpacingStyle | GetLineSpacing (float &line_spacing_value)
| Get line spacing of current widget. More...
RGB | GetMKBackgroundColor () const
| Get the background color in the MK dictionary. More...
RGB | GetMKBorderColor () const
| Get the border color in the MK dictionary. More...
WString | GetMKDownCaption () const
| Get the down caption string in the MK dictionary. More...
common::Bitmap | GetMKDownIconBitmap ()
| Get the down icon bitmap in the MK dictionary. More...
MKIconCaptionRelation | GetMKIconCaptionRelation () const
| Get the relation of icon and caption in the MK dictionary. More...
IconFit | GetMKIconFit () const
| Get the icon fit information in the MK dictionary. More...
WString | GetMKNormalCaption () const
| Get the normal caption string in the MK dictionary. More...
common::Bitmap | GetMKNormalIconBitmap ()
| Get the normal icon bitmap in the MK dictionary. More...
WString | GetMKRolloverCaption () const
| Get the rollover caption string in the MK dictionary. More...
common::Bitmap | GetMKRolloverIconBitmap ()
| Get the rollover icon bitmap in the MK dictionary. More...
common::Rotation | GetMKRotation () const
| Get the rotation value in the MK dictionary. More...
bool | HasMKEntry (MKEntry mk_entry)
| Check if a specified entry exists in the MK dictionary. More...
void | RemoveAction ()
| Remove action. More...
void | RemoveMKEntry (MKEntry mk_entry)
| Remove a specified entry from the MK dictionary. More...
void | SetAction (const actions::Action &action)
| Set action. More...
void | SetAppearanceState (const String &appearance_state)
| Set the annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary. More...
void | SetHighlightingMode (HighlightingMode mode)
| Set highlighting mode. More...
void | SetLineSpacing (LineSpacingStyle line_spacing_style, float line_spacing_value)
| Set line spacing for current widget. More...
void | SetMKBackgroundColor (RGB color)
| Set the background color in the MK dictionary. More...
void | SetMKBorderColor (RGB color)
| Set the border color in the MK dictionary. More...
void | SetMKDownCaption (const wchar_t *caption)
| Set the down caption string in the MK dictionary. More...
void | SetMKDownIconBitmap (const common::Bitmap &bitmap)
| Set the down icon bitmap in the MK dictionary. More...
void | SetMKDownIconImage (const common::Image &image, int frame_index)
| Set an image with specified frame index as down icon in the MK dictionary. More...
void | SetMKIconCaptionRelation (MKIconCaptionRelation relation)
| Set the relation of icon and caption in the MK dictionary. More...
void | SetMKIconFit (const IconFit &icon_fit)
| Set the icon fit information in the MK dictionary. More...
void | SetMKNormalCaption (const wchar_t *caption)
| Set the normal caption string in the MK dictionary. More...
void | SetMKNormalIconBitmap (const common::Bitmap &bitmap)
| Set a bitmap as normal icon in the MK dictionary. More...
void | SetMKNormalIconImage (const common::Image &image, int frame_index)
| Set an image with specified frame index as normal icon in the MK dictionary. More...
void | SetMKRolloverCaption (const wchar_t *caption)
| Set the rollover caption string in the MK dictionary. More...
void | SetMKRolloverIconBitmap (const common::Bitmap &bitmap)
| Set the rollover icon bitmap in the MK dictionary. More...
void | SetMKRolloverIconImage (const common::Image &image, int frame_index)
| Set an image with specified frame index as rollover icon in the MK dictionary. More...
void | SetMKRotation (common::Rotation rotation)
| Set the rotation value in the MK dictionary. More...
Public Member Functions inherited from foxit::pdf::annots::Annot
| Annot ()
| Constructor.
| Annot (const Annot &annot)
| Constructor, with another annotation object. More...
| Annot (const PDFPage &page, objects::PDFDictionary *annot_dict)
| Constructor, with PDF page and annotation's PDF dictionary. More...
virtual | ~Annot ()
| Destructor.
objects::PDFStream * | GetAppearanceStream (AppearanceType type, const char *appearance_state="") const
| Get annotation's appearance stream with specified type and state. More...
RGB | GetBorderColor () const
| Get border color. More...
BorderInfo | GetBorderInfo () const
| Get border information. More...
WString | GetContent () const
| Get content. More...
RectI | GetDeviceRect (const Matrix &matrix)
| Get annotation rectangle in device coordinate system. More...
objects::PDFDictionary * | GetDict () const
| Get annotation's dictionary object. More...
Matrix | GetDisplayMatrix (const Matrix &page_display_matrix)
| Get the display matrix, from PDF coordinate system to targeted device coordinate system. More...
uint32 | GetFlags () const
| Get annotation flags. More...
int | GetIndex () const
| Get the index of current annotation in the page which current annotation belongs to. More...
DateTime | GetModifiedDateTime () const
| Get last modified date time. More...
objects::PDFDictionary * | GetOptionalContent () const
| Get the PDF dictionary of annotation's optional content. More...
PDFPage | GetPage () const
| Get the related PDF page. More...
RectF | GetRect () const
| Get rectangle, in PDF coordinate system. More...
Type | GetType () const
| Get actual annotation type of current annotation. More...
WString | GetUniqueID () const
| Get unique ID. More...
bool | HasProperty (Property property) const
| Whether current annotation has the specified annotation's property. More...
bool | IsEmpty () const
| Check whether current object is empty or not. More...
bool | IsMarkup () const
| Check if current annotation is a markup annotation. More...
bool | Move (const RectF &rect)
| Move current annotation to a new position, specified by a new rectangle in PDF coordinate system. More...
bool | Move (const RectF &rect, bool is_reset_appearance)
| Move current annotation to a new position, specified by a new rectangle in PDF coordinate system. More...
bool | operator!= (const Annot &other) const
| Not equal operator. More...
Annot & | operator= (const Annot &annot)
| Assign operator. More...
bool | operator== (const Annot &other) const
| Equal operator. More...
bool | RemoveProperty (Property property)
| Remove a specified annotation's property. More...
bool | ResetAppearanceStream ()
| Reset appearance stream. More...
bool | ResetAppearanceStream (bool is_generate_new_appearance_obj)
| Reset appearance stream. More...
void | SetBorderColor (RGB color)
| Set border color. More...
void | SetBorderInfo (const BorderInfo &border)
| Set border information. More...
void | SetContent (const WString &content)
| Set content. More...
void | SetFlags (uint32 flags)
| Set annotation flags. More...
void | SetModifiedDateTime (const DateTime &date_time)
| Set last modified date time. More...
void | SetUniqueID (const WString &unique_id)
| Set unique ID. More...
Public Member Functions inherited from foxit::Base
FS_HANDLE | Handle () const
| Get the handle of current object. More...

## Detailed Description

A widget annotation is used to represent the appearance of form fields.
Class annots::Widget is derived from class Annot and also offers functions to get/set widget annotation's properties. Functions Widget::GetField and Widget::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, Annot::ResetAppearanceStream (inherited from Widget's parent class) will return false directly.

See also
  Annot
  interform::Field
  interform::Control

## Member Enumeration Documentation

## ◆ LineSpacingStyle

enum foxit::pdf::annots::Widget::LineSpacingStyle

Enumeration for line spacing style.

Values of this enumeration should be used alone.

Enumerator
e_LineSpacingSingle | Line spacing style: single line spacing.
e_LineSpacingOneAndHalf | Line spacing style: one and half times line spacing.
e_LineSpacingDouble | Line spacing style: double line spacing.
e_LineSpacingExactValue | Line spacing style: exact value line spacing.
e_LineSpacingAuto | Line spacing style: auto line spacing.

## Constructor & Destructor Documentation

## ◆ Widget()

foxit::pdf::annots::Widget::Widget | ( | const Annot & | annot | ) |
| explicit

Constructor, with parent class object.

Parameters

  [in] | annot | Parent class object.

## Member Function Documentation

## ◆ GetAction()

actions::Action foxit::pdf::annots::Widget::GetAction | ( |  | ) |

Get 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 actions::AdditionalAction for more details.

Returns
  An action object that receives the action data. If the return value of function actions::Action::IsEmpty for the returned action object is true, that means no action.

## ◆ GetAppearanceOnStateName()

String foxit::pdf::annots::Widget::GetAppearanceOnStateName | ( |  | ) | const

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

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

## ◆ GetAppearanceState()

String foxit::pdf::annots::Widget::GetAppearanceState | ( |  | ) | const

Get the annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary.

Returns
  The annotation's appearance state.

## ◆ GetControl()

interform::Control foxit::pdf::annots::Widget::GetControl | ( |  | ) |

Get associated form control.

Returns
  The associated form control object.

## ◆ GetField()

interform::Field foxit::pdf::annots::Widget::GetField | ( |  | ) |

Get associated form field.

Returns
  The associated form field object.

## ◆ GetHighlightingMode()

HighlightingMode foxit::pdf::annots::Widget::GetHighlightingMode | ( |  | ) |

Get highlighting mode.

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

Returns
  Highlighting mode value. Please refer to values starting from Annot::e_HighlightingNone and this would be one of these values.

## ◆ GetLineSpacing()

LineSpacingStyle foxit::pdf::annots::Widget::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 interform::Field::e_FlagTextMultiline. 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 Widget::e_LineSpacingSingle and this would be one of these values.

## ◆ GetMKBackgroundColor()

RGB foxit::pdf::annots::Widget::GetMKBackgroundColor | ( |  | ) | const

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

Returns
  The background color in MK dictionary. Value format: 0xRRGGBB.
  0 may means no background color in MK dictionary. In this case, please call function Widget::HasMKEntry with value Annot::e_MKEntryBackgroundColor to check.

## ◆ GetMKBorderColor()

RGB foxit::pdf::annots::Widget::GetMKBorderColor | ( |  | ) | const

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

Returns
  The border color in MK dictionary. Value format: 0xRRGGBB.
  0 may means no border color in MK dictionary. In this case, please call function Widget::HasMKEntry with value Annot::e_MKEntryBorderColor to check.

## ◆ GetMKDownCaption()

WString foxit::pdf::annots::Widget::GetMKDownCaption | ( |  | ) | const

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

Returns
  Down caption string. An empty string may means no down caption in MK dictionary. In this case, please call function Widget::HasMKEntry with value Annot::e_MKEntryDownCaption to check.

## ◆ GetMKDownIconBitmap()

common::Bitmap foxit::pdf::annots::Widget::GetMKDownIconBitmap | ( |  | ) |

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

Returns
  Down icon bitmap. If function common::Bitmap::IsEmpty for the returned bitmap object returns true, that means current widget annotation does not have down icon bitmap.

## ◆ GetMKIconCaptionRelation()

MKIconCaptionRelation foxit::pdf::annots::Widget::GetMKIconCaptionRelation | ( |  | ) | const

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

Returns
  The relation position of caption and icon. Please refer to Annot::e_MKRelationNoIcon values and it should be one of these values.

## ◆ GetMKIconFit()

IconFit foxit::pdf::annots::Widget::GetMKIconFit | ( |  | ) | const

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

Returns
  An icon fit object, which contains the icon fit information in MK dictionary. If scale way type of icon fit object is value IconFit::e_ScaleWayNone, that means no icon fit information in MK dictionary.

## ◆ GetMKNormalCaption()

WString foxit::pdf::annots::Widget::GetMKNormalCaption | ( |  | ) | const

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

Returns
  Normal caption string. An empty string may means no normal caption in MK dictionary. In this case, please call function Widget::HasMKEntry with value Annot::e_MKEntryNormalCaption to check.

## ◆ GetMKNormalIconBitmap()

common::Bitmap foxit::pdf::annots::Widget::GetMKNormalIconBitmap | ( |  | ) |

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

Returns
  Normal icon bitmap. If function common::Bitmap::IsEmpty for the returned bitmap object returns true, that means current widget annotation does not have normal icon bitmap.

## ◆ GetMKRolloverCaption()

WString foxit::pdf::annots::Widget::GetMKRolloverCaption | ( |  | ) | const

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

Returns
  Rollover caption string. An empty string may means no rollover caption in MK dictionary. In this case, please call function Widget::HasMKEntry with value Annot::e_MKEntryRolloverCaption to check.

## ◆ GetMKRolloverIconBitmap()

common::Bitmap foxit::pdf::annots::Widget::GetMKRolloverIconBitmap | ( |  | ) |

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

Returns
  Rollover icon bitmap. If function common::Bitmap::IsEmpty for the returned bitmap object returns true, that means current widget annotation does not have rollover icon bitmap.

## ◆ GetMKRotation()

common::Rotation foxit::pdf::annots::Widget::GetMKRotation | ( |  | ) | const

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

Returns
  The rotation value in MK dictionary. Please refer to values starting from common::e_Rotation0 and this would be one of these values. Value common::e_RotationUnknown means no rotation in MK dictionary. Specially, returned rotation value represents in counterclockwise.

## ◆ HasMKEntry()

bool foxit::pdf::annots::Widget::HasMKEntry | ( | MKEntry | 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 Annot::e_MKEntryRotation and this should be one of these values.

Returns
  true means the specified entry exists in the MK dictionary, while false means not.

## ◆ RemoveAction()

void foxit::pdf::annots::Widget::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 actions::AdditionalAction for more details.

Returns
  None.

## ◆ RemoveMKEntry()

void foxit::pdf::annots::Widget::RemoveMKEntry | ( | MKEntry | 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 Annot::e_MKEntryRotation and this should be one of these values.

Returns
  None.

## ◆ SetAction()

void foxit::pdf::annots::Widget::SetAction | ( | const actions::Action & | action | ) |

Set action.

This function cannot be used to set action which is used as additional action. If user wants to set any additional action, please refer to class actions::AdditionalAction for more details.

Parameters

  [in] | action | New action to be set. It should be valid. Currently only support following types as the new action: actions::Action::e_TypeGoto, actions::Action::e_TypeURI, actions::Action::e_TypeJavaScript, actions::Action::e_TypeNamed, actions::Action::e_TypeGoToR, actions::Action::e_TypeGoToE, actions::Action::e_TypeSubmitForm, actions::Action::e_TypeResetForm, actions::Action::e_TypeHide, actions::Action::e_TypeLaunch, actions::Action::e_TypeImportData, actions::Action::e_TypeRendition.

Returns
  None.

## ◆ SetAppearanceState()

void foxit::pdf::annots::Widget::SetAppearanceState | ( | const String & | appearance_state | ) |

Set the annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary.

Parameters

  [in] | appearance_state | The annotation's appearance state.

Returns
  None.

## ◆ SetHighlightingMode()

void foxit::pdf::annots::Widget::SetHighlightingMode | ( | HighlightingMode | mode | ) |

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.

Parameters

  [in] | mode | New highlighting mode value. Please refer to values starting from Annot::e_HighlightingNone and this should be one of these values.

Returns
  None.

## ◆ SetLineSpacing()

void foxit::pdf::annots::Widget::SetLineSpacing | ( | LineSpacingStyle | line_spacing_style,
|  | float | line_spacing_value
| ) |  |

Set line spacing for current widget.

This is only applicable for widget associated with text fields which contain the flag interform::Field::e_FlagTextMultiline. 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 Widget::e_LineSpacingSingle 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 Widget::e_LineSpacingExactValue. 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.

## ◆ SetMKBackgroundColor()

void foxit::pdf::annots::Widget::SetMKBackgroundColor | ( | RGB | color | ) |

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.

Parameters

  [in] | color | The background color to be set in MK dictionary. Value format: 0xRRGGBB.

Returns
  None.

## ◆ SetMKBorderColor()

void foxit::pdf::annots::Widget::SetMKBorderColor | ( | RGB | color | ) |

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.

Parameters

  [in] | color | The border color to be set in MK dictionary. Value format: 0xRRGGBB.

Returns
  None.

## ◆ SetMKDownCaption()

void foxit::pdf::annots::Widget::SetMKDownCaption | ( | const wchar_t * | caption | ) |

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.

Parameters

  [in] | caption | Down caption string to be set in MK dictionary. It can be an empty string.

Returns
  None.

## ◆ SetMKDownIconBitmap()

void foxit::pdf::annots::Widget::SetMKDownIconBitmap | ( | const common::Bitmap & | bitmap | ) |

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.

Parameters

  [in] | bitmap | A valid bitmap to be set as down icon in MK dictionary.

Returns
  None.

## ◆ SetMKDownIconImage()

void foxit::pdf::annots::Widget::SetMKDownIconImage | ( | const common::Image & | image,
|  | 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 common::Image::e_Unknown.
  [in] | frame_index | Frame index. Valid range: from 0 to (count-1). count is returned by function common::Image::GetFrameCount.

## ◆ SetMKIconCaptionRelation()

void foxit::pdf::annots::Widget::SetMKIconCaptionRelation | ( | MKIconCaptionRelation | relation | ) |

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.

Parameters

  [in] | relation | The relation position of caption and icon. Please refer to values starting from Annot::e_MKRelationNoIcon and this should be one of these values.

Returns
  None.

## ◆ SetMKIconFit()

void foxit::pdf::annots::Widget::SetMKIconFit | ( | const IconFit & | icon_fit | ) |

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.

Parameters

  [in] | icon_fit | An icon fit object which represents the icon fit information to be set in MK dictionary. If value of any member in this object is invalid, this function will throw exception foxit::e_ErrParam. Please refer to class IconFit to check the valid value range for each member.

Returns
  None.

## ◆ SetMKNormalCaption()

void foxit::pdf::annots::Widget::SetMKNormalCaption | ( | const wchar_t * | caption | ) |

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 widgets associated with pushbutton field, check box field or radio button field. For other type of fields, this will be useless.

Parameters

  [in] | caption | Normal caption string to be set in MK dictionary. It can be an empty string.

Returns
  None.

## ◆ SetMKNormalIconBitmap()

void foxit::pdf::annots::Widget::SetMKNormalIconBitmap | ( | const common::Bitmap & | bitmap | ) |

Set a bitmap 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] | bitmap | A valid bitmap to be set as normal icon in MK dictionary.

Returns
  None.

## ◆ SetMKNormalIconImage()

void foxit::pdf::annots::Widget::SetMKNormalIconImage | ( | const common::Image & | image,
|  | 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 common::Image::e_Unknown.
  [in] | frame_index | Frame index. Valid range: from 0 to (count-1). count is returned by function common::Image::GetFrameCount.

## ◆ SetMKRolloverCaption()

void foxit::pdf::annots::Widget::SetMKRolloverCaption | ( | const wchar_t * | caption | ) |

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.

Parameters

  [in] | caption | Rollover caption string to be set in MK dictionary. It can be an empty string.

Returns
  None.

## ◆ SetMKRolloverIconBitmap()

void foxit::pdf::annots::Widget::SetMKRolloverIconBitmap | ( | const common::Bitmap & | bitmap | ) |

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.

Parameters

  [in] | bitmap | A valid bitmap to be set as rollover icon in MK dictionary.

Returns
  None.

## ◆ SetMKRolloverIconImage()

void foxit::pdf::annots::Widget::SetMKRolloverIconImage | ( | const common::Image & | image,
|  | 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 common::Image::e_Unknown.
  [in] | frame_index | Frame index. Valid range: from 0 to (count-1). count is returned by function common::Image::GetFrameCount.

## ◆ SetMKRotation()

void foxit::pdf::annots::Widget::SetMKRotation | ( | common::Rotation | rotation | ) |

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.

Parameters

  [in] | rotation | The rotation value to be set in MK dictionary. Please refer to values starting from common::e_Rotation0 and this should be one of these values except common::e_RotationUnknown. Specially, rotation value here represents in counterclockwise.