Foxit PDF SDK

Instance Methods | List of all members
<FSIconProviderCallback> Protocol Reference

Inherits <NSObject>.

## Instance Methods
(BOOL) | - canChangeColor:icon_name:
| A callback function used to check if current icon provider supports to change color for a specified type. More...
(NSNumber *) | - getDisplayHeight:icon_name:
| A callback function used to get the height for display of a specified icon, in device size(pixel normally). More...
(NSNumber *) | - getDisplayWidth:icon_name:
| A callback function used to get the width for display of a specified icon, in device size(pixel normally). More...
(FSPDFPage *) | - getIcon:icon_name:color:annot_dict:
| A callback function used to get the icon as PDF page contents for a specified type. More...
(NSString *) | - getProviderID
| A callback function used to get provider ID. More...
(NSString *) | - getProviderVersion
| A callback function used to get provider version. More...
(FSShadingColor *) | - getShadingColor:icon_name:referenced_color:shading_index:
| A callback function used to get the shading colors if current icon provider supports for a specified type. Currently, only support Type-2 shading settings with two color values. More...
(BOOL) | - hasIcon:icon_name:
| A callback function used to check if current icon provider supports icon for a specified type. More...

## Detailed Description

This class represents a callback object as customized annotation icon provider. All the functions in this class are used as callback functions. Pure virtual functions should be implemented by user and user can also choose to implement some or all the reset virtual functions when necessary. Icon provider can only be used for note, file attachment, stamp annotations.
Icon provider's ID and version are treated as the name of the icon provider, so please offer different "ID + version" for different icon providers by callback functions FSIconProviderCallback::getProviderID and FSIconProviderCallback::getProviderVersion.

## Method Documentation

## ◆ canChangeColor:icon_name:()

- (BOOL) canChangeColor: |  | (FSAnnotType) | annot_type
icon_name: |  | (NSString *) | icon_name
| required

A callback function used to check if current icon provider supports to change color for a specified type.

Parameters

  [in] | annot_type | The annotation type. It should be one of FSActionCallbackMailTypeMsg, FSAnnotFileAttachment and FSAnnotStamp.
  [in] | icon_name | Icon name of the annotation.

Returns
  YES means current icon provider supports to change color for a specified icon type, while NO means not support.

## ◆ getDisplayHeight:icon_name:()

- (NSNumber*) getDisplayHeight: |  | (FSAnnotType) | annot_type
icon_name: |  | (NSString *) | icon_name
| required

A callback function used to get the height for display of a specified icon, in device size(pixel normally).

Parameters

  [in] | annot_type | The annotation type. It should be one of FSActionCallbackMailTypeMsg, FSAnnotFileAttachment and FSAnnotStamp.
  [in] | icon_name | Icon name of the annotation.

Returns
  The height for display.

## ◆ getDisplayWidth:icon_name:()

- (NSNumber*) getDisplayWidth: |  | (FSAnnotType) | annot_type
icon_name: |  | (NSString *) | icon_name
| required

A callback function used to get the width for display of a specified icon, in device size(pixel normally).

Parameters

  [in] | annot_type | The annotation type. It should be one of FSActionCallbackMailTypeMsg, FSAnnotFileAttachment and FSAnnotStamp.
  [in] | icon_name | Icon name of the annotation.

Returns
  The width for display.

## ◆ getIcon:icon_name:color:annot_dict:()

- (FSPDFPage*) getIcon: |  | (FSAnnotType) | annot_type
icon_name: |  | (NSString *) | icon_name
color: |  | (unsigned int) | color
annot_dict: |  | (FSPDFDictionary *) | annot_dict
| required

A callback function used to get the icon as PDF page contents for a specified type.

Parameters

  [in] | annot_type | The annotation type. It should be one of FSActionCallbackMailTypeMsg, FSAnnotFileAttachment and FSAnnotStamp.
  [in] | icon_name | Icon name of the annotation.
  [in] | color | The icon color of the annotation. Format: 0xAARRGGBB.
  [in] | annot_dict | The annotation dict.

Returns
  A PDF page object whose content would be used as the icon.

## ◆ getProviderID()

- (NSString*) getProviderID |  |  |
| required

A callback function used to get provider ID.

Icon provider's ID and version are treated as the name of the icon provider, so please offer different "ID + version" for different icon providers.

Returns
  The provider ID.

## ◆ getProviderVersion()

- (NSString*) getProviderVersion |  |  |
| required

A callback function used to get provider version.

Icon provider's ID and version are treated as the name of the icon provider, so please offer different "ID + version" for different icon providers.

Returns
  Version string.

## ◆ getShadingColor:icon_name:referenced_color:shading_index:()

- (FSShadingColor*) getShadingColor: |  | (FSAnnotType) | annot_type
icon_name: |  | (NSString *) | icon_name
referenced_color: |  | (unsigned int) | referenced_color
shading_index: |  | (int) | shading_index
| required

A callback function used to get the shading colors if current icon provider supports for a specified type. Currently, only support Type-2 shading settings with two color values.

Parameters

  [in] | annot_type | The annotation type. It should be one of FSActionCallbackMailTypeMsg, FSAnnotFileAttachment and FSAnnotStamp.
  [in] | icon_name | Icon name of the annotation.
  [in] | referenced_color | Referenced color. Format: 0xRRGGBB.
  [in] | shading_index | Index color of shading, starting from 0. If shading colors are more than one, this function will be called multiple times.

Returns
  The shading color.

## ◆ hasIcon:icon_name:()

- (BOOL) hasIcon: |  | (FSAnnotType) | annot_type
icon_name: |  | (NSString *) | icon_name
| required

A callback function used to check if current icon provider supports icon for a specified type.

Parameters

  [in] | annot_type | The annotation type. It should be one of FSActionCallbackMailTypeMsg, FSAnnotFileAttachment and FSAnnotStamp.
  [in] | icon_name | Icon name of the annotation.

Returns
  YES means current icon provider supports the specified icon, while NO means not support.