FoxitPDFSDKforWeb  v10.0.0
Foxit PDF SDK for Web
IViewerUI Class Reference

This class provides an ability for user to customize the several UI like contextmenu which may be triggered from PDFViewCtrl module, that stuffs should be customized like the example:

new PDFViewer({
...otherOptions,
viewerUI: class extends PDFViewCtrl.IViewerUI {
...implementations
}
})

. More...

Inheritance diagram for IViewerUI:
TinyViewerUI XViewerUI

Public Member Functions

 alert (message)
 Display an alert dialog with the optional content and an OK button, then returns an fullfilled Promise after alert dialog closed. More...
 
 confirm (message)
 Displays a modal dialog with an optional message and two buttons: OK and Cancel, then returns an Promise, that will be fullfilled if user clicks OK, and be rejected if user clicks Cancel. More...
 
 createContextMenu (key, anchor, config)
 A method used to create the contextmenu component and registers the right-click event. You can override this method to customize the right-click menus. More...
 
 createTextSelectionTooltip (pageRender)
 Creates a tooltip component that displays when user select texts. More...
 
 destroy ()
 A method will be called when PDFViewer is destroyed. You should override this method to perform the operation of destroy resources.
 
 loading (coverOn)
 Displays a loading layer to indicate the loading state of a page or a component. More...
 
 prompt (defaultValue, message, title)
 Displays a dialog with an optional message prompting the user to input some text. More...
 
 promptPassword (defaultValue, message, title)
 Displays a dialog with a optional message prompting the user to input password. More...
 

Detailed Description

This class provides an ability for user to customize the several UI like contextmenu which may be triggered from PDFViewCtrl module, that stuffs should be customized like the example:

new PDFViewer({
...otherOptions,
viewerUI: class extends PDFViewCtrl.IViewerUI {
...implementations
}
})

.

Member Function Documentation

◆ alert()

IViewerUI::alert (   message)
inline

Display an alert dialog with the optional content and an OK button, then returns an fullfilled Promise after alert dialog closed.

Parameters
messagestring - The alert dialog message, i18nect.js entry format.
Returns
Promise<void>

◆ confirm()

IViewerUI::confirm (   message)
inline

Displays a modal dialog with an optional message and two buttons: OK and Cancel, then returns an Promise, that will be fullfilled if user clicks OK, and be rejected if user clicks Cancel.

Parameters
messagestring - The confirm dialog message, i18next.js entry format.
Returns
Promise<void>

◆ createContextMenu()

IViewerUI::createContextMenu (   key,
  anchor,
  config 
)
inline

A method used to create the contextmenu component and registers the right-click event. You can override this method to customize the right-click menus.

Parameters
keyany - Indicates the owner of the contextmneu instance returned by this method , which can be the name of a state-handler or an instance of AnnotComponent.
anchorHTMLElement - An html element used to respond to right-click events.
configobject
config.selectorstring - A css selector of an element where to trigger this menu, this element should be the anchor or it's children.
config.itemsArray<{nameI18nKey:string}> - The default menu items, Refer to JQuery contextmenu plugin
config.items[].nameI18nKeystring - Menu text in i18next.js entry format.
Returns
IContextMenu|undefined - An context menu component including show/hide and destroy API and returning undefined means that the right-click menu of the specified target will not be displayed

◆ createTextSelectionTooltip()

IViewerUI::createTextSelectionTooltip (   pageRender)
inline

Creates a tooltip component that displays when user select texts.

Parameters
pageRenderPDFPageRender
Returns
IFloatingTooltip

◆ loading()

IViewerUI::loading (   coverOn)
inline

Displays a loading layer to indicate the loading state of a page or a component.

Parameters
coverOnHTMLElement - the target layer
Returns
Function - A function used to close the loading layer.

◆ prompt()

IViewerUI::prompt (   defaultValue,
  message,
  title 
)
inline

Displays a dialog with an optional message prompting the user to input some text.

Parameters
defaultValuestring - A string contains the default value displayed in the text input.
messagestring - A string of text to display to user.
titlestring - A string of the dialog title.
Returns
Promise<string> - Returns a promise that fullfilled with the value in the input.

◆ promptPassword()

Promise< string > IViewerUI::promptPassword (   defaultValue,
  message,
  title 
)
inline

Displays a dialog with a optional message prompting the user to input password.

Parameters
defaultValuestring - A string value of password displayed in the password input
messagestring - A string of text to display to user.
titlestring - A string of the dialog title
Returns
Promise<string> - Returns a promise that fullfilled with the value in the password input.

Foxit Software Corporation Logo
@2024 Foxit Software Incorporated. All rights reserved.