public class

ToolConfig

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.config.ToolConfig

Class Overview

Helper class for config tools and tool related customize stuffs

Summary

Nested Classes
interface ToolConfig.PanLongPressSwitchToolCallback A functional interface for pan tool switch tool when long pressing on annotation  
Public Methods
void addQMHideItem(int itemId)
Add quick menu item to no annotation permission list
ToolManager.ToolModeBase getAnnotationHandlerToolMode(int annotType)
get annotation handler tool mode
ArrayList<FontResource> getFontList()
Gets list of font to use for free text annotation
static ToolConfig getInstance()
ToolConfig.PanLongPressSwitchToolCallback getPanLongPressSwitchToolCallback()
Gets the Pan tool long-press switch-tool custom callback.
ToolManager.ToolMode getToolModeByAnnotationToolbarItemId(int itemId)
Gets tool mode by annotation toolbar item id
ToolManager.ToolMode getToolModeByQMItemId(int qmItemId)
Gets tool mode by quick menu item id
boolean isHideQMItem(int itemId)
Check if quick menu item should be hidden by a given item id
boolean isRichContentEnabledForFreeText()
boolean isSnappingEnabledForMeasurementTools()
void putAnnotationToolModePair(int annotType, ToolManager.ToolModeBase toolMode)
Put annotation type and tool mode into annotation tool mode pair
void putCustomToolAnnotationToolbarItemPair(int itemId, ToolManager.ToolMode mode)
put custom tool mode and annotation toolbar item view id pair
void putCustomToolQMItemPair(int qmItemId, ToolManager.ToolMode mode)
put custom tool mode and quick menu item pair
boolean removeQMHideItem(int itemId)
remove quick menu item from no annotation permission list
void setFontList(ArrayList<FontResource> fonts)
Sets list of font to use for free text annotation
void setPanToolLongPressSwitchToolCallback(ToolConfig.PanLongPressSwitchToolCallback callback)
Sets customized callback for pan tool switch tool when long press
void setRichContentEnabledForFreeText(boolean enabled)
void setSnappingEnabledForMeasurementTools(boolean enabled)
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public void addQMHideItem (int itemId)

Add quick menu item to no annotation permission list

Parameters
itemId quick menu item id

public ToolManager.ToolModeBase getAnnotationHandlerToolMode (int annotType)

get annotation handler tool mode

Parameters
annotType annotation type
Returns
  • tool mode

public ArrayList<FontResource> getFontList ()

Gets list of font to use for free text annotation

Returns
  • the list of fonts

public static ToolConfig getInstance ()

public ToolConfig.PanLongPressSwitchToolCallback getPanLongPressSwitchToolCallback ()

Gets the Pan tool long-press switch-tool custom callback.

If no custom callback has been defined via setPanToolLongPressSwitchToolCallback(PanLongPressSwitchToolCallback), this method returns null. In that case, the default long-press behavior is handled internally by the Pan tool itself.

Returns
  • the pan tool long-press switch-tool custom callback, or null if no custom callback is set

public ToolManager.ToolMode getToolModeByAnnotationToolbarItemId (int itemId)

Gets tool mode by annotation toolbar item id

Parameters
itemId annotation toolbar item view id
Returns
  • tool mode

public ToolManager.ToolMode getToolModeByQMItemId (int qmItemId)

Gets tool mode by quick menu item id

Parameters
qmItemId quick menu item id
Returns
  • tool mode

public boolean isHideQMItem (int itemId)

Check if quick menu item should be hidden by a given item id

Parameters
itemId quick menu item id
Returns
  • true then hide quick menu item, else otherwise

public boolean isRichContentEnabledForFreeText ()

public boolean isSnappingEnabledForMeasurementTools ()

public void putAnnotationToolModePair (int annotType, ToolManager.ToolModeBase toolMode)

Put annotation type and tool mode into annotation tool mode pair

Parameters
annotType annotation type
toolMode tool mode

public void putCustomToolAnnotationToolbarItemPair (int itemId, ToolManager.ToolMode mode)

put custom tool mode and annotation toolbar item view id pair

Parameters
itemId annotation toolbar item view id
mode tool mode

public void putCustomToolQMItemPair (int qmItemId, ToolManager.ToolMode mode)

put custom tool mode and quick menu item pair

Parameters
qmItemId quick menu item id
mode tool mode

public boolean removeQMHideItem (int itemId)

remove quick menu item from no annotation permission list

Parameters
itemId quick menu item id
Returns
  • true if removed successfully, else otherwise

public void setFontList (ArrayList<FontResource> fonts)

Sets list of font to use for free text annotation

Parameters
fonts the list of fonts

public void setPanToolLongPressSwitchToolCallback (ToolConfig.PanLongPressSwitchToolCallback callback)

Sets customized callback for pan tool switch tool when long press

Parameters
callback pan tool long press switch tool tool callback

public void setRichContentEnabledForFreeText (boolean enabled)

public void setSnappingEnabledForMeasurementTools (boolean enabled)