Foxit PDF SDK  9.1
<FSIconProviderCallback> Protocol Reference
Inheritance diagram for <FSIconProviderCallback>:

Instance Methods

(BOOL) - canChangeColor:iconName:
 A callback function used to check if current icon provider supports to change color for a specified type. More...
 
(NSNumber *) - getDisplayHeight:iconName:
 A callback function used to get the height for display of a specified icon, in device size(pixel normally). More...
 
(NSNumber *) - getDisplayWidth:iconName:
 A callback function used to get the width for display of a specified icon, in device size(pixel normally). More...
 
(FSPDFPage *) - getIcon:iconName:color:
 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:iconName:refColor:shadingIndex:ShadingColor:
 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:iconName:
 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:iconName:

- (BOOL) canChangeColor: (FSAnnotType annotType
iconName: (NSString *)  iconName 
required

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

Parameters
[in]annotTypeThe annotation type. It should be one of FSActionCallbackMailTypeMsg, FSAnnotFileAttachment and FSAnnotStamp.
[in]iconNameIcon 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:iconName:

- (NSNumber*) getDisplayHeight: (FSAnnotType annotType
iconName: (NSString *)  iconName 
required

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

This can be triggered during rendering process only when function FSRenderer::setTransformAnnotIcon: is called with value NO before rendering.

Parameters
[in]annotTypeThe annotation type. It should be one of FSActionCallbackMailTypeMsg, FSAnnotFileAttachment and FSAnnotStamp.
[in]iconNameIcon name of the annotation.
Returns
The height for display.

◆ getDisplayWidth:iconName:

- (NSNumber*) getDisplayWidth: (FSAnnotType annotType
iconName: (NSString *)  iconName 
required

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

This can be triggered during rendering process only when function FSRenderer::setTransformAnnotIcon: is called with value NO before rendering.

Parameters
[in]annotTypeThe annotation type. It should be one of FSActionCallbackMailTypeMsg, FSAnnotFileAttachment and FSAnnotStamp.
[in]iconNameIcon name of the annotation.
Returns
The width for display.

◆ getIcon:iconName:color:

- (FSPDFPage*) getIcon: (FSAnnotType annotType
iconName: (NSString *)  iconName
color: (unsigned int)  color 
required

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

Parameters
[in]annotTypeThe annotation type. It should be one of FSActionCallbackMailTypeMsg, FSAnnotFileAttachment and FSAnnotStamp.
[in]iconNameIcon name of the annotation.
[in]colorThe icon color of the annotation. Format: 0xAARRGGBB.
Returns
A pdf::PDFPage 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:iconName:refColor:shadingIndex:ShadingColor:

- (FSShadingColor*) getShadingColor: (FSAnnotType annotType
iconName: (NSString *)  iconName
refColor: (unsigned int)  refColor
shadingIndex: (int)  shadingIndex
ShadingColor: (FSShadingColor *)  out_shading_color 
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]annotTypeThe annotation type. It should be one of FSActionCallbackMailTypeMsg, FSAnnotFileAttachment and FSAnnotStamp.
[in]iconNameIcon name of the annotation.
[in]refColorReferenced color. Format: 0xRRGGBB.
[in]shadingIndexIndex color of shading, starting from 0. If shading colors are more than one, this function will be called multiple times.
[out]out_shading_colorThe two shading color value, returned by this function.
Returns
YES means success, while NO means failure.

◆ hasIcon:iconName:

- (BOOL) hasIcon: (FSAnnotType annotType
iconName: (NSString *)  iconName 
required

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

Parameters
[in]annotTypeThe annotation type. It should be one of FSActionCallbackMailTypeMsg, FSAnnotFileAttachment and FSAnnotStamp.
[in]iconNameIcon name of the annotation.
Returns
YES means current icon provider supports the specified icon, while NO means not support.