Foxit PDF RDK

Public Member Functions | List of all members
uiextensions.UIExtensionsManager Class Reference
Inheritance diagram for uiextensions.UIExtensionsManager:

## Public Member Functions
< boolean > async | _handleSingleTapConfirmed (motionEvent)
| canAddAnnot ()
| canAssemble ()
| canModifyContents ()
| canUpdateAnnotDefaultProperties ()
| enableAutoFullScreen (enable)
| enableBottomToolbar (isEnabled)
| enableFormHighlight (enable)
| enableLinkHighlight (enable)
| enableLinks (enable)
| enableModification (isEnabled)
| enableSmallBottomToolbar (isEnabled)
| enableSmallTopToolbar (isEnabled)
| enableTopToolbar (isEnabled)
| exitPanZoomMode ()
| getAnnotAuthor ()
| getAnnotHandlerByType (type)
| getConfig ()
| getCurrentAnnotHandler ()
| getCurrentSelectedText ()
| getCurrentToolHandler ()
| getFormHighlightColor ()
| getLinkEventListener ()
| getLinkHighlightColor ()
| getModuleByName (name)
| getNightColorMode ()
| getPageColorMode ()
| getPanelManager ()
| getSaveDocFlag ()
| getSavePath ()
| getSaveWriter ()
| getSelectionHighlightColor ()
| getToolHandlerByType (type)
| isAutoSaveDoc ()
| isContinueAddAnnot ()
| isEnableModification ()
| isFormHighlightEnable ()
| isLinkHighlightEnabled ()
| isLinksEnabled ()
| isLoadAnnotModule (annot)
| isUseLogicalPageNumbers ()
| onBackPress ()
| onXFAPageRemoved (isSuccess, pageIndex)
| onXFAPagesInserted (isSuccess, pageIndex)
| onXFAWidgetAdded (xfaWidget)
| onXFAWidgetWillRemove (xfaWidget)
| openDocument (path, password, cb(errorCode);)
| openDocumentWithReader (fileReader, password, cb(errorCode);)
| registerAnnotHandler (handler)
| registerDocModifiedEventListener (listener)
| registerInteractionListener (listener)
| registerLifecycleListener (listener)
| registerMenuEventListener (listener)
| registerModule (module)
| registerStateChangeListener (listener)
| registerToolHandler (handler)
| registerToolHandlerChangedListener (listener)
| registerXFAPageEventListener (listener)
| registerXFAWidgetEventListener (listener)
| setAnnotAuthor (author)
| setAutoSaveDoc (autoSaveDoc)
| setContinueAddAnnot (continueAddAnnot)
| setCurrentToolHandler (toolHandler)
| setFilePath (path)
| setFormHighlightColor (color)
| setLinkEventListener (listener)
| setLinkHighlightColor (color)
| setNightColorMode (nightColorMode)
| setOnFinishListener (listener)
| setPageColorMode (pageColorMode)
| setSaveDocFlag (flag)
| setSavePath (savePath)
| setSaveWriter (writer)
| setSelectionHighlightColor (color)
| setUpdateAnnotDefaultProperties (update)
| setUseLogicalPageNumbers (useLogicalPageNumbers)
| triggerDismissMenuEvent ()
| unregisterAnnotHandler (handler)
| unregisterDocModifiedEventListener (listener)
| unregisterInteractionListener (listener)
| unregisterLifecycleListener (listener)
| unregisterMenuEventListener (listener)
| unregisterModule (module)
| unregisterStateChangeListener (listener)
| unregisterToolHandler (handler)
| unregisterToolHandlerChangedListener (listener)
| unregisterXFAPageEventListener (listener)
| unregisterXFAWidgetEventListener (listener)

## Detailed Description

Class `UIExtensionsManager` represents a UI extensions manager.

The `UIExtensionsManager` class is mainly used for the UI extensions which implement IPDFReader interface, it implements the IPDFUIExtensionsManager interface that is a listener to listen common interaction events and view event, and will dispatch some events to UI extensions, it also defines functions to manage the UI extensions.

## Member Function Documentation

## ◆ _handleSingleTapConfirmed()

<boolean> async uiextensions.UIExtensionsManager._handleSingleTapConfirmed | ( | motionEvent |  | ) |

Receive and handle the single tap event.

Parameters

  motionEvent | `MotionEvent` object which species the event.

Returns
  true if the event is consumed, false otherwise.

## ◆ canAddAnnot()

uiextensions.UIExtensionsManager.canAddAnnot | ( |  | ) |

Check whether the document can add annotation

Returns
  true means The document can add annotation

## ◆ canAssemble()

uiextensions.UIExtensionsManager.canAssemble | ( |  | ) |

Check whether the document can be assemble.

Returns
  true means The document can be assemble

## ◆ canModifyContents()

uiextensions.UIExtensionsManager.canModifyContents | ( |  | ) |

Check whether the document can be modified.

Returns
  true means The document can be modified

## ◆ canUpdateAnnotDefaultProperties()

uiextensions.UIExtensionsManager.canUpdateAnnotDefaultProperties | ( |  | ) |

Whether to update the default properties of creating annot.

Returns
  True if you modify some properties of an annot, those properties will be used the next time when you create the same type of annot, false otherwise.

## ◆ enableAutoFullScreen()

uiextensions.UIExtensionsManager.enableAutoFullScreen | ( | enable |  | ) |

Set whether to automatically full screen, the default is true.

Parameters

  enable | If you set true, it will automatically full screen after a few seconds, hiding topbar and bottommbar,false otherwise.

## ◆ enableBottomToolbar()

uiextensions.UIExtensionsManager.enableBottomToolbar | ( | isEnabled |  | ) |

Whether show the bottom tool bar

Parameters

  isEnabled | `True` show the bottom tool bar, or otherwise.

## ◆ enableFormHighlight()

uiextensions.UIExtensionsManager.enableFormHighlight | ( | enable |  | ) |

Enable the highlight color of form field. If the document is opened, please call function PDFViewCtrl#updatePagesLayout() after setting the new value.

Parameters

  enable | True means highlight color of form field. can be displayed, false for else.

## ◆ enableLinkHighlight()

uiextensions.UIExtensionsManager.enableLinkHighlight | ( | enable |  | ) |

Enable highlight color of link annotation

Parameters

  enable | True means highlight color of link annotation can be displayed, false for else.

## ◆ enableLinks()

uiextensions.UIExtensionsManager.enableLinks | ( | enable |  | ) |

Enable link annotation action event.

Parameters

  enable | True means link annotation action event can be triggered, false for else.

## ◆ enableModification()

uiextensions.UIExtensionsManager.enableModification | ( | isEnabled |  | ) |

Set whether the pdf document can be modified. The default is allow modification.

Parameters

  isEnabled | whether the pdf document can be modified

## ◆ enableSmallBottomToolbar()

uiextensions.UIExtensionsManager.enableSmallBottomToolbar | ( | isEnabled |  | ) |

Enable or disable small bottom toolbar.

Parameters

  isEnabled | Whether small bottom toolbar is enabled or not.

## ◆ enableSmallTopToolbar()

uiextensions.UIExtensionsManager.enableSmallTopToolbar | ( | isEnabled |  | ) |

Enable or disable small top toolbar.

Parameters

  isEnabled | Whether small top toolbar is enabled or not.

## ◆ enableTopToolbar()

uiextensions.UIExtensionsManager.enableTopToolbar | ( | isEnabled |  | ) |

Whether show the top tool bar

Parameters

  isEnabled | `True` show the top tool bar, or otherwise.

## ◆ exitPanZoomMode()

uiextensions.UIExtensionsManager.exitPanZoomMode | ( |  | ) |

Exit the pan zoom mode.

## ◆ getAnnotAuthor()

uiextensions.UIExtensionsManager.getAnnotAuthor | ( |  | ) |

Get annotation author string. The default author is "foxit sdk"

Returns
  Annotation author string

## ◆ getAnnotHandlerByType()

uiextensions.UIExtensionsManager.getAnnotHandlerByType | ( | type |  | ) |

Get the specified AnnotHandler from current UI extensions manager.

Parameters

  type | The type of AnnotHandler, refer to AnnotHandler#getType();

Returns
  A AnnotHandler object with specified type.

## ◆ getConfig()

uiextensions.UIExtensionsManager.getConfig | ( |  | ) |

Get a property config

Returns
  Config

## ◆ getCurrentAnnotHandler()

uiextensions.UIExtensionsManager.getCurrentAnnotHandler | ( |  | ) |

Returns
  Get the current AnnotHandler

## ◆ getCurrentSelectedText()

uiextensions.UIExtensionsManager.getCurrentSelectedText | ( |  | ) |

Get current selected text content from text select tool handler.

Returns
  The current selected text content.

## ◆ getCurrentToolHandler()

uiextensions.UIExtensionsManager.getCurrentToolHandler | ( |  | ) |

Get the current tool handler.

Returns
  A `ToolHandler` object which specifies the current tool handler.

## ◆ getFormHighlightColor()

uiextensions.UIExtensionsManager.getFormHighlightColor | ( |  | ) |

Get the highlight color of form field.

Returns
  the highlight color of form field.

## ◆ getLinkEventListener()

uiextensions.UIExtensionsManager.getLinkEventListener | ( |  | ) |

Get link event listener object.

Returns
  The link event listener object.

## ◆ getLinkHighlightColor()

uiextensions.UIExtensionsManager.getLinkHighlightColor | ( |  | ) |

get the highlight color of link annotation.

Returns
  the highlight color

## ◆ getModuleByName()

uiextensions.UIExtensionsManager.getModuleByName | ( | name |  | ) |

Get the specified module from current UI extensions manager.

Parameters

  name | The specified module name, refer to Module#getName().

Returns
  A `Module` object with specified module name.

## ◆ getNightColorMode()

uiextensions.UIExtensionsManager.getNightColorMode | ( |  | ) |

Get the night color mode.

Returns
  The NightColorMode night color mode. It would be one of NightColorMode.DEFAULT, NightColorMode.MAPPING_GRAY.

## ◆ getPageColorMode()

uiextensions.UIExtensionsManager.getPageColorMode | ( |  | ) |

Get the page color mode.

Returns
  The color mode. It would be one of NightColorMode.DEFAULT, NightColorMode.MAPPING_GRAY.

## ◆ getPanelManager()

uiextensions.UIExtensionsManager.getPanelManager | ( |  | ) |

Get the interface to handle the creation, display, hiding, layout, and interaction of panels.

Returns
  IPanelManager

## ◆ getSaveDocFlag()

uiextensions.UIExtensionsManager.getSaveDocFlag | ( |  | ) |

Get the flag while saving a document has used

## ◆ getSavePath()

uiextensions.UIExtensionsManager.getSavePath | ( |  | ) |

Retrieves the path where the document is saved.

If the user has set a save path using setSavePath(), this method returns the user-defined path. Otherwise, it returns the actual save path based on user actions.

Returns
  the path where the document is saved.

## ◆ getSaveWriter()

uiextensions.UIExtensionsManager.getSaveWriter | ( |  | ) |

Returns
  Get the file writer callback where the document will be saved.

## ◆ getSelectionHighlightColor()

uiextensions.UIExtensionsManager.getSelectionHighlightColor | ( |  | ) |

Get highlight color (including alpha) when text has selected.

Returns
  The highlight color.

## ◆ getToolHandlerByType()

uiextensions.UIExtensionsManager.getToolHandlerByType | ( | type |  | ) |

get the specified ToolHandler from current UI extensions manager.

Parameters

  type | The tool handler type, refer to function ToolHandler#getType().

Returns
  A `ToolHandler` object with specified type.

## ◆ isAutoSaveDoc()

uiextensions.UIExtensionsManager.isAutoSaveDoc | ( |  | ) |

Returns true if the document is automatically saved.

Returns
  True if the document is automatically saved, false otherwise.

## ◆ isContinueAddAnnot()

uiextensions.UIExtensionsManager.isContinueAddAnnot | ( |  | ) |

Whether or not the annotation can be created continuously.

Returns
  `True` the annotation can be created continuously or otherwise.

## ◆ isEnableModification()

uiextensions.UIExtensionsManager.isEnableModification | ( |  | ) |

whether the pdf document can be modified

Returns
  whether the pdf document can be modified

## ◆ isFormHighlightEnable()

uiextensions.UIExtensionsManager.isFormHighlightEnable | ( |  | ) |

Check whether form highlight can be displayed.

Returns
  True means form highlight can be displayed, false for else.

## ◆ isLinkHighlightEnabled()

uiextensions.UIExtensionsManager.isLinkHighlightEnabled | ( |  | ) |

Check whether link highlight can be display.

Returns
  True means link highlight can be displayed, false for else.

## ◆ isLinksEnabled()

uiextensions.UIExtensionsManager.isLinksEnabled | ( |  | ) |

Check whether link annotation action event can be triggered.

Returns
  True means link annotation action event can be triggered, false for else.

## ◆ isLoadAnnotModule()

uiextensions.UIExtensionsManager.isLoadAnnotModule | ( | annot |  | ) |

Check whether the specified annotation module that is loaded.

## ◆ isUseLogicalPageNumbers()

uiextensions.UIExtensionsManager.isUseLogicalPageNumbers | ( |  | ) |

Whether to use logical pages.

Returns
  True means use logical page numbers, false for else.

## ◆ onBackPress()

uiextensions.UIExtensionsManager.onBackPress | ( |  | ) |

Handles the back button press event.

Returns
  {boolean} Always returns `true`, indicating that the back press event is handled.

## ◆ onXFAPageRemoved()

uiextensions.UIExtensionsManager.onXFAPageRemoved | ( | isSuccess | ,
|  | pageIndex |
| ) |  |

Called when the specified xfa page has removed.

## ◆ onXFAPagesInserted()

uiextensions.UIExtensionsManager.onXFAPagesInserted | ( | isSuccess | ,
|  | pageIndex |
| ) |  |

Called when a xfa page has added in the specified position.

## ◆ onXFAWidgetAdded()

uiextensions.UIExtensionsManager.onXFAWidgetAdded | ( | xfaWidget |  | ) |

Called when a XFAWidget has added.

## ◆ onXFAWidgetWillRemove()

uiextensions.UIExtensionsManager.onXFAWidgetWillRemove | ( | xfaWidget |  | ) |

Called when a XFAWidget will be removed.

## ◆ openDocument()

uiextensions.UIExtensionsManager.openDocument | ( | path | ,
|  | password | ,
|  | cb(errorCode); |
| ) |  |

Open a PDF document from a specified PDF file path.

Parameters

  path | A PDF file path.
  password | A byte array which specifies the password used to load the PDF document content. It can be either user password or owner password. If the PDF document is not encrypted by password, just pass an empty string.
  cb | The callback will be called when current document object becomes available or the view control fail to open the document FoxitRDKNative.common.

## ◆ openDocumentWithReader()

uiextensions.UIExtensionsManager.openDocumentWithReader | ( | fileReader | ,
|  | password | ,
|  | cb(errorCode); |
| ) |  |

Open a PDF document with a file read callback object.

Parameters

  fileReader | A FoxitRDKNative.common.file.ReaderCallback object which is implemented by user to load a PDF document. It should not be null.
  password | A byte array which specifies the password used to load the PDF document content. It can be either user password or owner password. If the PDF document is not encrypted by password, just pass an empty string.
  cb | The callback will be called when current document object becomes available or the view control fail to open the document FoxitRDKNative.common.

## ◆ registerAnnotHandler()

uiextensions.UIExtensionsManager.registerAnnotHandler | ( | handler |  | ) |

Register the specified AnnotHandler to current UI extensions manager.

Parameters

  handler | A AnnotHandler to use.

## ◆ registerDocModifiedEventListener()

uiextensions.UIExtensionsManager.registerDocModifiedEventListener | ( | listener |  | ) |

Register a document modified event listener.

Parameters

  listener | An `IDocModifiedEventListener` object to be registered.

## ◆ registerInteractionListener()

uiextensions.UIExtensionsManager.registerInteractionListener | ( | listener |  | ) |

Register a callback to be invoked when the interaction event happened.

Parameters

  listener | the interaction event IInteractionEventListener

## ◆ registerLifecycleListener()

uiextensions.UIExtensionsManager.registerLifecycleListener | ( | listener |  | ) |

Register the specified ILifecycleEventListener

## ◆ registerMenuEventListener()

uiextensions.UIExtensionsManager.registerMenuEventListener | ( | listener |  | ) |

Register a callback to be invoked when the menu event has triggered.

## ◆ registerModule()

uiextensions.UIExtensionsManager.registerModule | ( | module |  | ) |

Register the specified module to current UI extensions manager.

Note: This method is only used within RDK

Parameters

  module | A `Module` object to be registered.

## ◆ registerStateChangeListener()

uiextensions.UIExtensionsManager.registerStateChangeListener | ( | listener |  | ) |

Register the specified IStateChangeListener

## ◆ registerToolHandler()

uiextensions.UIExtensionsManager.registerToolHandler | ( | handler |  | ) |

Register the specified ToolHandler to current UI extensions manager.

Parameters

  handler | A `ToolHandler` object to be registered.

## ◆ registerToolHandlerChangedListener()

uiextensions.UIExtensionsManager.registerToolHandlerChangedListener | ( | listener |  | ) |

Register a callback to be invoked when the tool handler changed.

Note: This method is only used within RDK

## ◆ registerXFAPageEventListener()

uiextensions.UIExtensionsManager.registerXFAPageEventListener | ( | listener |  | ) |

Register a xfa page event listener.

Parameters

  listener | An `IPageEventListener` object to be registered.

## ◆ registerXFAWidgetEventListener()

uiextensions.UIExtensionsManager.registerXFAWidgetEventListener | ( | listener |  | ) |

Register a xfa widget event listener.

Parameters

  listener | An `IXFAWidgetEventListener` object to be registered.

## ◆ setAnnotAuthor()

uiextensions.UIExtensionsManager.setAnnotAuthor | ( | author |  | ) |

Set annotation author

Parameters

  author | the author string to be set

## ◆ setAutoSaveDoc()

uiextensions.UIExtensionsManager.setAutoSaveDoc | ( | autoSaveDoc |  | ) |

Set to automatically save the document to the original file

Parameters

  autoSaveDoc | True auto save document, false otherwise.

## ◆ setContinueAddAnnot()

uiextensions.UIExtensionsManager.setContinueAddAnnot | ( | continueAddAnnot |  | ) |

Set whether the annotation can be created continuously. The default is false.

Parameters

  continueAddAnnot | whether the annot can be created continuously.

## ◆ setCurrentToolHandler()

uiextensions.UIExtensionsManager.setCurrentToolHandler | ( | toolHandler |  | ) |

Set the current tool handler.

Parameters

  toolHandler | A `ToolHandler` object which specifies the current tool handler.

## ◆ setFilePath()

uiextensions.UIExtensionsManager.setFilePath | ( | path |  | ) |

Set the file path

## ◆ setFormHighlightColor()

uiextensions.UIExtensionsManager.setFormHighlightColor | ( | color |  | ) |

Set form highlight color. If the document is opened, please call function PDFViewCtrl#updatePagesLayout() after setting the new value.

Parameters

  color | the form highlight color to be set

## ◆ setLinkEventListener()

uiextensions.UIExtensionsManager.setLinkEventListener | ( | listener |  | ) |

Set link event listener.

Parameters

  listener | The specified link event listener.

## ◆ setLinkHighlightColor()

uiextensions.UIExtensionsManager.setLinkHighlightColor | ( | color |  | ) |

Set the highlight color of link annotation.

Parameters

  color | the highlight color to be set

## ◆ setNightColorMode()

uiextensions.UIExtensionsManager.setNightColorMode | ( | nightColorMode |  | ) |

Set the night color mode.

Parameters

  nightColorMode | The night color mode. It should be one of NightColorMode.DEFAULT, NightColorMode.MAPPING_GRAY.

## ◆ setOnFinishListener()

uiextensions.UIExtensionsManager.setOnFinishListener | ( | listener |  | ) |

Set the OnFinishListener to be invoked when the document closed and current activity has exited.

Parameters

  listener | the OnFinishListener to use.

## ◆ setPageColorMode()

uiextensions.UIExtensionsManager.setPageColorMode | ( | pageColorMode |  | ) |

Set the page color mode.

Parameters

  pageColorMode | The page color mode. It should be one of NightColorMode.DEFAULT, NightColorMode.MAPPING_GRAY.

## ◆ setSaveDocFlag()

uiextensions.UIExtensionsManager.setSaveDocFlag | ( | flag |  | ) |

Set the flag to be used when the document has saved

## ◆ setSavePath()

uiextensions.UIExtensionsManager.setSavePath | ( | savePath |  | ) |

Set the path where the document will be saved

## ◆ setSaveWriter()

uiextensions.UIExtensionsManager.setSaveWriter | ( | writer |  | ) |

set the file writer callback where the document will be saved.

Parameters

  writer | File writer callbackFileWriterCallback for the new saved PDF file.

## ◆ setSelectionHighlightColor()

uiextensions.UIExtensionsManager.setSelectionHighlightColor | ( | color |  | ) |

Set highlight color (including alpha) when select text.

Parameters

  color | The highlight color to be set.

## ◆ setUpdateAnnotDefaultProperties()

uiextensions.UIExtensionsManager.setUpdateAnnotDefaultProperties | ( | update |  | ) |

Set whether to update the default properties of creating annot.

Parameters

  update | True if you modify some properties of an annot, those properties will be used the next time when you create the same type of annot, false otherwise.

## ◆ setUseLogicalPageNumbers()

uiextensions.UIExtensionsManager.setUseLogicalPageNumbers | ( | useLogicalPageNumbers |  | ) |

Whether to use logical pages, default is false.

Parameters

  useLogicalPageNumbers | True means use logical page numbers, false for else.

## ◆ triggerDismissMenuEvent()

uiextensions.UIExtensionsManager.triggerDismissMenuEvent | ( |  | ) |

Called when menu has dismissed.

## ◆ unregisterAnnotHandler()

uiextensions.UIExtensionsManager.unregisterAnnotHandler | ( | handler |  | ) |

Unregister the specified AnnotHandler from current UI extensions manager.

Parameters

  handler | A AnnotHandler to use.

## ◆ unregisterDocModifiedEventListener()

uiextensions.UIExtensionsManager.unregisterDocModifiedEventListener | ( | listener |  | ) |

Unregister a document modified event listener.

Parameters

  listener | An `IDocModifiedEventListener` object to be unregistered.

## ◆ unregisterInteractionListener()

uiextensions.UIExtensionsManager.unregisterInteractionListener | ( | listener |  | ) |

Unregister the interaction event listener.

Parameters

  listener | the interaction event IInteractionEventListener

## ◆ unregisterLifecycleListener()

uiextensions.UIExtensionsManager.unregisterLifecycleListener | ( | listener |  | ) |

Unregister the specified ILifecycleEventListener

## ◆ unregisterMenuEventListener()

uiextensions.UIExtensionsManager.unregisterMenuEventListener | ( | listener |  | ) |

Unregister the specified MenuEventListener

## ◆ unregisterModule()

uiextensions.UIExtensionsManager.unregisterModule | ( | module |  | ) |

Unregister the specified module from current UI extensions manager. Note: This method is only used within RDK

Parameters

  module | A `Module` object to be unregistered.

## ◆ unregisterStateChangeListener()

uiextensions.UIExtensionsManager.unregisterStateChangeListener | ( | listener |  | ) |

Unregister the specified IStateChangeListener

## ◆ unregisterToolHandler()

uiextensions.UIExtensionsManager.unregisterToolHandler | ( | handler |  | ) |

Unregister the specified ToolHandler from current UI extensions manager.

Note: This method is only used within RDK

Parameters

  handler | A `ToolHandler` object to be unregistered.

## ◆ unregisterToolHandlerChangedListener()

uiextensions.UIExtensionsManager.unregisterToolHandlerChangedListener | ( | listener |  | ) |

Unregister the ToolHandler changed listener.

Note: This method is only used within RDK

Parameters

  listener | a ToolHandlerChangedListener to use.

## ◆ unregisterXFAPageEventListener()

uiextensions.UIExtensionsManager.unregisterXFAPageEventListener | ( | listener |  | ) |

Unregister a xfa page event listener.

Parameters

  listener | An `IPageEventListener` object to be unregistered.

## ◆ unregisterXFAWidgetEventListener()

uiextensions.UIExtensionsManager.unregisterXFAWidgetEventListener | ( | listener |  | ) |

Unregister a xfa widget event listener.

Parameters

  listener | An `IXFAWidgetEventListener` object to be unregistered.