Foxit PDF SDK
foxit::ActionCallback Class Referenceabstract

Public Types

enum  AppInfoType {
  e_AppInfoTypeFormsVersion = 0x0, e_AppInfoTypeViewerType = 0x01, e_AppInfoTypeViewerVariation = 0x02, e_AppInfoTypeViewerVersion = 0x03,
  e_AppInfoTypeAppVersion = 0x04
}
 Enumeration for application's information type. More...
 
enum  JSFieldValueChangeType { e_JSFieldValueChangedByFormat = 0, e_JSFieldValueChangedByCalculation = 1, e_JSFieldValueChangedBySet = 2 }
 Enumeration for javascript field value change type. More...
 
enum  JsMailResult { e_JSMailResultFailed = 0, e_JSMailResultSuccess = 1, e_JSMailResultUserAbort = 2 }
 Enumeration for result of the mail. More...
 
enum  JSMediaPlayerState {
  e_JSMediaPlayerStateOpen = 0, e_JSMediaPlayerStateClose = 1, e_JSMediaPlayerStatePlaying = 2, e_JSMediaPlayerStateStop = 3,
  e_JSMediaPlayerStateSuspend = 4
}
 Enumeration for media player state. More...
 
enum  Language {
  e_LanguageUnknown = 0, e_LanguageCHS = 1, e_LanguageCHT = 2, e_LanguageDAN = 3,
  e_LanguageDEU = 4, e_LanguageENU = 5, e_LanguageESP = 6, e_LanguageFRA = 7,
  e_LanguageITA = 8, e_LanguageKOR = 9, e_LanguageJPN = 10, e_LanguageNLD = 11,
  e_LanguageNOR = 12, e_LanguagePTB = 13, e_LanguageSUO = 14, e_LanguageSVE = 15
}
 Enumeration for language. More...
 
enum  LayoutMode { e_LayoutModeSinglePage = 0, e_LayoutModeContinuous = 1, e_LayoutModeFacing = 2, e_LayoutModeContinuousFacing = 3 }
 Enumeration for layout mode. More...
 
enum  MailType { e_MailTypeDoc = 0, e_MailTypeForm = 1, e_MailTypeMsg = 2 }
 Enumeration for data type to be mailed. More...
 

Public Member Functions

virtual bool AddMenuItem (const MenuItemConfig &menu_item_config, bool is_prepend)=0
 A callback function to adds a menu item to a menu. More...
 
virtual bool AddSubMenu (const MenuItemConfig &menu_item_config)=0
 A callback function to add a menu item with a submenu to the application. More...
 
virtual bool AddToolButton (const ButtonItem &button_item)=0
 A callback function to add a tool button. More...
 
virtual int Alert (const wchar_t *msg, const wchar_t *title, int type, int icon)=0
 A callback function used to pop up a dialog to show warnings or hints. More...
 
virtual bool Beep (int type)=0
 A callback function to cause the system to play a sound. More...
 
virtual WString BrowseFile ()=0
 A callback function to show a file selection dialog, and the selected file path should be returned. More...
 
virtual WString BrowseFile (bool is_open_dialog, const wchar_t *file_format, const wchar_t *file_filter)=0
 A callback function to show a file selection dialog. More...
 
virtual void CloseDoc (const pdf::PDFDoc &document, bool is_prompt_to_save)=0
 A callback function to close document. More...
 
virtual pdf::PDFDoc CreateBlankDoc ()=0
 A callback function to create a blank PDF document object. More...
 
virtual bool ExecuteNamedAction (const pdf::PDFDoc &document, const char *named_action)=0
 A callback function to execute a named action. More...
 
virtual WString GetAppInfo (AppInfoType type)=0
 A callback function to get application information. More...
 
virtual WString GetAttachmentsFilePath (const pdf::PDFDoc &pdf_doc, const wchar_t *name)=0
 A callback function to get the file path of attachments file. More...
 
virtual pdf::PDFDoc GetCurrentDoc ()=0
 A callback function to receive current PDF document object. More...
 
virtual int GetCurrentPage (const pdf::PDFDoc &document)=0
 A callback function used to receive current page index. More...
 
virtual bool GetDocChangeMark (const pdf::PDFDoc &document)=0
 A callback function to receive the change mark which indicates whether the content of document is changed or not. More...
 
virtual WString GetExtractedEmbeddedFilePath (const pdf::PDFDoc &pdf_doc, const wchar_t *name)=0
 A callback function to get the file path of extracted embedded file. More...
 
virtual WString GetFilePath (const pdf::PDFDoc &document)=0
 A callback function to get the file path of current PDF document. More...
 
virtual bool GetFullScreen ()=0
 A callback function to get whether the full screen mode is set. More...
 
virtual IdentityProperties GetIdentityProperties ()=0
 A callback function used to get identity properties of current user. More...
 
virtual Language GetLanguage ()=0
 A callback function to get the language of the running viewer application. More...
 
virtual LayoutMode GetLayoutMode ()=0
 A callback function to get the page layout of the current document. More...
 
virtual MenuListArray GetMenuItemNameList ()=0
 A callback function to get the menu item name list. More...
 
virtual PointF GetMousePosition ()=0
 A callback function to get current mouse position. More...
 
virtual pdf::PDFDoc GetOpenedDoc (int index)=0
 A callback function to receive an opened PDF document object by index. More...
 
virtual int GetOpenedDocCount ()=0
 A callback function to receive the count of opened documents. More...
 
virtual common::Rotation GetPageRotation (const pdf::PDFDoc &document, int page_index)=0
 A callback function used to receive current displaying rotation of a page on PDF viewer. More...
 
virtual float GetPageScale ()=0
 A callback function to get current page zoom value. More...
 
virtual RectF GetPageWindowRect ()=0
 A callback function to get the rectangle for the page view window. The page view window is the area inside the inner document window in which the PDF content is displayed. More...
 
virtual foxit::pdf::Destination::ZoomMode GetPageZoomMode ()=0
 A callback function to get the current page zoom mode. More...
 
virtual WStringArray GetPrinterNameList ()=0
 A callback function to get the printer name list. More...
 
virtual WString GetTemporaryDirectory ()=0
 A callback function to get temporary directory. More...
 
virtual WString GetTemporaryFileName (const pdf::PDFDoc &document, const wchar_t *file_suffix_name)=0
 A callback function to get the temporary file path. The temporary file name combine the document name with the file suffix name. More...
 
virtual WString GetUntitledBookmarkName ()=0
 A callback function to get the new name for an untitled bookmark. More...
 
virtual bool InvalidateRect (const pdf::PDFDoc &document, int page_index, const RectF &pdf_rect)=0
 A callback function to invalidate the client area within the specified rectangle. More...
 
virtual bool IsLocalFile (const pdf::PDFDoc &document)=0
 A callback function to check whether the file is local file. More...
 
virtual bool LaunchURL (const char *url)=0
 A callback function to launch to a specified URL. More...
 
virtual bool MailData (void *data, MailType data_type, bool is_ui, const wchar_t *to, const wchar_t *subject, const wchar_t *cc, const wchar_t *bcc, const wchar_t *message)=0
 A callback function to mail data or message, with or without user interaction. More...
 
virtual JsMailResult MailDoc (const pdf::PDFDoc &document, const wchar_t *to_address, const wchar_t *cc_address, const wchar_t *bcc_address, const wchar_t *subject, const wchar_t *message, bool is_ui)=0
 A callback function to mails a document as an attachment. More...
 
virtual void OnFieldValueChanged (const wchar_t *field_name, JSFieldValueChangeType type, const WStringArray &value_before_changed, const WStringArray &value_after_changed)=0
 A callback function to notify the value change of the field. More...
 
virtual bool OpenDoc (const WString &file_path, const WString &password)=0
 A callback function to open a PDF file. More...
 
virtual MediaPlayerCallbackOpenMediaPlayer (const PlayerArgs &player_args)=0
 A callback function to open media player. More...
 
virtual WString PopupMenu (const MenuListArray &menus, bool &is_selected_item)=0
 A callback function to pop up a menu window. More...
 
virtual MenuItemEx PopupMenuEx (const MenuItemExArray &menus, bool &is_selected_item)=0
 A callback function to pop up a menu window. More...
 
virtual bool Print (const pdf::PDFDoc &document, bool is_ui, const common::Range &page_range, bool is_silent, bool is_shrunk_to_fit, bool is_printed_as_image, bool is_reversed, bool is_to_print_annots)=0
 A callback function to print pages within a specified index range. More...
 
virtual bool Print (const pdf::PDFDoc &document, const PrintParams &print_params)=0
 A callback function to print document with print parameters. More...
 
virtual void Release ()=0
 A callback function used to release current callback object itself. More...
 
virtual bool RemoveToolButtom (const wchar_t *button_name)=0
 A callback function to remove a tool button added by the function ActionCallback::AddToolButton. More...
 
virtual WString Response (const wchar_t *question, const wchar_t *title, const wchar_t *default_value, const wchar_t *label, bool is_password)=0
 A callback function to display a dialog box containing a question and an entry field for the user to reply to the question. More...
 
virtual void Scroll (const PointF &point)=0
 A callback function to scroll the specified point on the current page into the middle of the current view. More...
 
virtual void SelectPageNthWord (int page_index, int word_index, bool is_show_selection)=0
 A callback function to change the current page number and selects the specified word on the page. More...
 
virtual void SetCurrentPage (const pdf::PDFDoc &document, int page_index)=0
 A callback function used to set the current page by index. More...
 
virtual void SetCurrentPage (const pdf::PDFDoc &document, const foxit::pdf::Destination &destination)=0
 A callback function used to set the current page by destination. More...
 
virtual bool SetDocChangeMark (const pdf::PDFDoc &document, bool change_mark)=0
 A callback function to set the change mark which indicates whether the content of document is changed or not. More...
 
virtual void SetFullScreen (bool is_full_screen)=0
 A callback function to set full screen mode. More...
 
virtual bool SetIdentityProperties (const IdentityProperties &identity_properties)=0
 A callback function used to set identity properties of current user. More...
 
virtual void SetLayoutMode (LayoutMode layout_mode, bool is_cover_mode)=0
 A callback function to set the page layout of the current document. More...
 
virtual bool SetPageRotation (const pdf::PDFDoc &document, int page_index, common::Rotation rotation)=0
 A callback function used to set the rotation value of a page on PDF viewer. More...
 
virtual void SetPageScale (foxit::pdf::Destination::ZoomMode zoom_mode, const foxit::pdf::Destination &dest)=0
 A callback function to set current page zoom value. More...
 
virtual bool ShowDialog (const DialogDescriptionConfig &dlg_config)=0
 A callback function to show the dialog. More...
 
virtual bool SubmitForm (const pdf::PDFDoc &document, void *form_data, uint32 length, const char *url, common::FileFormatType file_format_type)=0
 A callback function to submit the form data to a specified URL. More...
 
virtual void UpdateLogicalLabel ()=0
 A callback function to update logical label. More...
 
virtual uint32 VerifySignature (const pdf::PDFDoc &document, const pdf::Signature &pdf_signature)=0
 A callback function to verify specified signature.. More...
 

Detailed Description

This class represents a callback object for performing PDF actions. All the pure virtual functions in this class are used as callback functions and should be implemented by user, to perform PDF actions, such as javascript actions.

Member Enumeration Documentation

◆ AppInfoType

Enumeration for application's information type.

Values of this enumeration should be used alone.

Enumerator
e_AppInfoTypeFormsVersion 

Application's forms version information.

e_AppInfoTypeViewerType 

Application's viewer type information.

e_AppInfoTypeViewerVariation 

Application's viewer variation information.

e_AppInfoTypeViewerVersion 

Application's viewer version information.

e_AppInfoTypeAppVersion 

Application's app version information.

◆ JSFieldValueChangeType

Enumeration for javascript field value change type.

Values of this enumeration should be used alone.

Enumerator
e_JSFieldValueChangedByFormat 

javascript field value changed type: format.

e_JSFieldValueChangedByCalculation 

javascript field value changed type : calculation.

e_JSFieldValueChangedBySet 

javascript field value changed type: field set.

◆ JsMailResult

Enumeration for result of the mail.

Values of this enumeration should be used alone.

Enumerator
e_JSMailResultFailed 

Mailed result: mail failed.

e_JSMailResultSuccess 

Mailed result: mail success.

e_JSMailResultUserAbort 

Mailed result: user abort.

◆ JSMediaPlayerState

Enumeration for media player state.

Values of this enumeration should be used alone.

Enumerator
e_JSMediaPlayerStateOpen 

media player state: Open.

e_JSMediaPlayerStateClose 

media player state: Close.

e_JSMediaPlayerStatePlaying 

media player state: Playing.

e_JSMediaPlayerStateStop 

media player state: Stop.

e_JSMediaPlayerStateSuspend 

media player state: Suspend.

◆ Language

Enumeration for language.

Values of this enumeration should be used alone.

Enumerator
e_LanguageUnknown 

Unknown language.

e_LanguageCHS 

Chinese Simplified.

e_LanguageCHT 

Chinese Traditional.

e_LanguageDAN 

Danish.

e_LanguageDEU 

German.

e_LanguageENU 

English.

e_LanguageESP 

Spanish.

e_LanguageFRA 

French.

e_LanguageITA 

Italian.

e_LanguageKOR 

Korean.

e_LanguageJPN 

Japanese.

e_LanguageNLD 

Dutch.

e_LanguageNOR 

Norwegian.

e_LanguagePTB 

Brazilian Portuguese.

e_LanguageSUO 

Finnish.

e_LanguageSVE 

Swedish.

◆ LayoutMode

Enumeration for layout mode.

Values of this enumeration should be used alone.

Enumerator
e_LayoutModeSinglePage 

Layout mode: single page.

e_LayoutModeContinuous 

Layout mode: continuous page.

e_LayoutModeFacing 

Layout mode: two pages.

e_LayoutModeContinuousFacing 

Layout mode: continuous two pages.

◆ MailType

Enumeration for data type to be mailed.

Values of this enumeration should be used alone.

Enumerator
e_MailTypeDoc 

Mailed data type: document.

e_MailTypeForm 

Mailed data type: form.

e_MailTypeMsg 

Mailed data type: string message.

Member Function Documentation

◆ AddMenuItem()

virtual bool foxit::ActionCallback::AddMenuItem ( const MenuItemConfig menu_item_config,
bool  is_prepend 
)
pure virtual

A callback function to adds a menu item to a menu.

This callback function will be triggered by the javascript method "app.addMenuItem".

Parameters
[in]menu_item_configThe config of the menu item.
[in]is_prependDetermines the position of the new menu item relative to the position specified by MenuItemConfig::pos or MenuItemConfig::pos_str. The default value is false. If this parameter is true, the rules for insertion are as follows:
  • If MenuItemConfig::pos_str is used, the new item is placed before the named item.
  • If MenuItemConfig::pos is used, the new item is placed before the numbered item.
  • If the named item cannot be found or position is not between zero and the number of items in the list, inclusive, the new item is inserted as the first item in the menu (rather than at the end of the menu).

    parameter is useful when the named item is the first item in a group.

Returns
true means success, while false means failure.

◆ AddSubMenu()

virtual bool foxit::ActionCallback::AddSubMenu ( const MenuItemConfig menu_item_config)
pure virtual

A callback function to add a menu item with a submenu to the application.

This callback function will be triggered by the javascript method "app.addSubMenu".

Parameters
[in]menu_item_configThe config of the menu item.
Returns
true means success, while false means failure.

◆ AddToolButton()

virtual bool foxit::ActionCallback::AddToolButton ( const ButtonItem button_item)
pure virtual

A callback function to add a tool button.

This callback function will be triggered by the javascript method "app.addToolButton".

Parameters
[in]button_itemThe ButtonItem object of the tool button.
Returns
true means success, while false means failure.

◆ Alert()

virtual int foxit::ActionCallback::Alert ( const wchar_t *  msg,
const wchar_t *  title,
int  type,
int  icon 
)
pure virtual

A callback function used to pop up a dialog to show warnings or hints.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]msgThe message string to be displayed in the dialog.
[in]titleThe title of the dialog.
[in]typeType of button group. It would be one of following values:
  • 0: OK;(default value.)
  • 1: OK, Cancel;
  • 2: Yes, NO;
  • 3: Yes, NO, Cancel.
[in]iconIcon type. It would be one of following values:
  • 0: Error;(default value.)
  • 1: Warning;
  • 2: Question;
  • 3: Status.
Returns
The return value should be one of following values:
  • 1: OK;
  • 2: Cancel;
  • 3: NO;
  • 4: Yes;

◆ Beep()

virtual bool foxit::ActionCallback::Beep ( int  type)
pure virtual

A callback function to cause the system to play a sound.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]typeSound type. The value would be on of following values:
  • 0: Error
  • 1: Warning
  • 2: Question
  • 3: Status
  • 4: Default (default value)
Returns
true means success, while false means failure.

◆ BrowseFile() [1/2]

virtual WString foxit::ActionCallback::BrowseFile ( )
pure virtual

A callback function to show a file selection dialog, and the selected file path should be returned.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
The file path. It can be an empty string.

◆ BrowseFile() [2/2]

virtual WString foxit::ActionCallback::BrowseFile ( bool  is_open_dialog,
const wchar_t *  file_format,
const wchar_t *  file_filter 
)
pure virtual

A callback function to show a file selection dialog.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]is_open_dialogA boolean value to specify whether the dialog is for opening file or saving file. true means the dialog should be used to open file, while false means the dialog should be used to save file.
[in]file_formatThe file format string.
[in]file_filterThe file filter string.
Returns
The file path. It can be an empty string.

◆ CloseDoc()

virtual void foxit::ActionCallback::CloseDoc ( const pdf::PDFDoc document,
bool  is_prompt_to_save 
)
pure virtual

A callback function to close document.

This callback function will be triggered by the javascript method "Doc.closeDoc". This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]documentA PDF document object. It would be valid.
[in]is_prompt_to_savetrue means show save prompt, while false means not.
Returns
None.

◆ CreateBlankDoc()

virtual pdf::PDFDoc foxit::ActionCallback::CreateBlankDoc ( )
pure virtual

A callback function to create a blank PDF document object.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
The newly created blank PDF document object.

◆ ExecuteNamedAction()

virtual bool foxit::ActionCallback::ExecuteNamedAction ( const pdf::PDFDoc document,
const char *  named_action 
)
pure virtual

A callback function to execute a named action.

Please refer to description of "Named Actions" in Section 8.5.3 of <PDF Reference 1.7> for more details. This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]named_actionA string to specify a named action.
Returns
true means success, while false means failure.

◆ GetAppInfo()

virtual WString foxit::ActionCallback::GetAppInfo ( AppInfoType  type)
pure virtual

A callback function to get application information.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.
For the digital information like ActionCallback::e_AppInfoTypeViewerVersion, ActionCallback::e_AppInfoTypeAppVersion and ActionCallback::e_AppInfoTypeFormsVersion, please use string to represent it.

Parameters
[in]typeType of information. Please refer to values starting from ActionCallback::e_AppInfoTypeFormsVersion and this would be one of these values.
Returns
The application information.

◆ GetAttachmentsFilePath()

virtual WString foxit::ActionCallback::GetAttachmentsFilePath ( const pdf::PDFDoc pdf_doc,
const wchar_t *  name 
)
pure virtual

A callback function to get the file path of attachments file.

This callback function will be triggered by the javascript method "Doc.importDataObject". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]pdf_docA PDF document object. It will embed with a data object.
[in]nameThe name to associate with the data object. It's the parameter "cName" of the method "Doc.importDataObject".
Returns
The path of the file which will be embedded as a data object.

◆ GetCurrentDoc()

virtual pdf::PDFDoc foxit::ActionCallback::GetCurrentDoc ( )
pure virtual

A callback function to receive current PDF document object.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
Current PDF document object.

◆ GetCurrentPage()

virtual int foxit::ActionCallback::GetCurrentPage ( const pdf::PDFDoc document)
pure virtual

A callback function used to receive current page index.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
Returns
Current page index. The value should be stared from 0 and less than page count of the specified document.

◆ GetDocChangeMark()

virtual bool foxit::ActionCallback::GetDocChangeMark ( const pdf::PDFDoc document)
pure virtual

A callback function to receive the change mark which indicates whether the content of document is changed or not.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
Returns
true means the PDF document is changed, while false means not.

◆ GetExtractedEmbeddedFilePath()

virtual WString foxit::ActionCallback::GetExtractedEmbeddedFilePath ( const pdf::PDFDoc pdf_doc,
const wchar_t *  name 
)
pure virtual

A callback function to get the file path of extracted embedded file.

This callback function will be triggered by the javascript method "Doc.exportDataObject". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]pdf_docA PDF document object. It will be embedded as a data object to the file .
[in]nameThe name of the data object to extract. It's the parameter "cName" of the method "Doc.exportDataObject".
Returns
The path of the file which will embed with a data object.

◆ GetFilePath()

virtual WString foxit::ActionCallback::GetFilePath ( const pdf::PDFDoc document)
pure virtual

A callback function to get the file path of current PDF document.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
Returns
The file path.

◆ GetFullScreen()

virtual bool foxit::ActionCallback::GetFullScreen ( )
pure virtual

A callback function to get whether the full screen mode is set.

This callback function will be triggered by the javascript property "app.fullScreen" or "app.fs.isFullScreen".

Returns
true means the full screen mode is set, while false means not.

◆ GetIdentityProperties()

virtual IdentityProperties foxit::ActionCallback::GetIdentityProperties ( )
pure virtual

A callback function used to get identity properties of current user.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
An identity properties object that specifies the identity properties of current user.

◆ GetLanguage()

virtual Language foxit::ActionCallback::GetLanguage ( )
pure virtual

A callback function to get the language of the running viewer application.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
The language type. Please refer to values starting from ActionCallback::e_LanguageUnknown and this should be one of these values.

◆ GetLayoutMode()

virtual LayoutMode foxit::ActionCallback::GetLayoutMode ( )
pure virtual

A callback function to get the page layout of the current document.

This callback function will be triggered by the javascript properties "Doc.layout". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
The layout mode. Please refer to values starting from ActionCallback::e_LayoutModeSinglePage and this should be one of these values.

◆ GetMenuItemNameList()

virtual MenuListArray foxit::ActionCallback::GetMenuItemNameList ( )
pure virtual

A callback function to get the menu item name list.

This callback function will be triggered by the javascript method "app.listMenuItems".

Returns
An array of menu list objects.

◆ GetMousePosition()

virtual PointF foxit::ActionCallback::GetMousePosition ( )
pure virtual

A callback function to get current mouse position.

This callback function will be triggered by the javascript properties "doc.mouseX" or "doc.mouseY". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
A position in device coordinate system.

◆ GetOpenedDoc()

virtual pdf::PDFDoc foxit::ActionCallback::GetOpenedDoc ( int  index)
pure virtual

A callback function to receive an opened PDF document object by index.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]indexThe index of an opened PDF documents. Valid range: from 0 to count-1. count is returned by callback function ActionCallback::GetOpenedDocCount;
Returns
A opened PDF document object.

◆ GetOpenedDocCount()

virtual int foxit::ActionCallback::GetOpenedDocCount ( )
pure virtual

A callback function to receive the count of opened documents.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
The count of opened documents.

◆ GetPageRotation()

virtual common::Rotation foxit::ActionCallback::GetPageRotation ( const pdf::PDFDoc document,
int  page_index 
)
pure virtual

A callback function used to receive current displaying rotation of a page on PDF viewer.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]page_indexA page index, used to specify which page's rotation is to be retrieved. The index would start from 0 and less than page count of the specified document.
Returns
The rotation of specified page. Please refer to values starting from common::e_Rotation0 and this should be one of these values.

◆ GetPageScale()

virtual float foxit::ActionCallback::GetPageScale ( )
pure virtual

A callback function to get current page zoom value.

This callback function will be triggered by the javascript properties "Doc.zoom". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
A zoom value. For example, a zoom value of 1.0 specifies 100%. It should be a positive number.

◆ GetPageWindowRect()

virtual RectF foxit::ActionCallback::GetPageWindowRect ( )
pure virtual

A callback function to get the rectangle for the page view window. The page view window is the area inside the inner document window in which the PDF content is displayed.

This callback function will be triggered by the javascript property "Doc.pageWindowRect". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
A rectangle for the page view window.

◆ GetPageZoomMode()

virtual foxit::pdf::Destination::ZoomMode foxit::ActionCallback::GetPageZoomMode ( )
pure virtual

A callback function to get the current page zoom mode.

This callback function will be triggered by the javascript properties "Doc.zoom" or "Doc.zoomType". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
The zoom mode. Please refer to values starting from pdf::Destination::e_ZoomXYZ and this should be one of these values.

◆ GetPrinterNameList()

virtual WStringArray foxit::ActionCallback::GetPrinterNameList ( )
pure virtual

A callback function to get the printer name list.

This callback function will be triggered by the javascript property "app.printerNames". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
An array of the printer name.

◆ GetTemporaryDirectory()

virtual WString foxit::ActionCallback::GetTemporaryDirectory ( )
pure virtual

A callback function to get temporary directory.

This callback function will be triggered by the javascript method "Doc.extractpages". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
The temporary directory.

◆ GetTemporaryFileName()

virtual WString foxit::ActionCallback::GetTemporaryFileName ( const pdf::PDFDoc document,
const wchar_t *  file_suffix_name 
)
pure virtual

A callback function to get the temporary file path. The temporary file name combine the document name with the file suffix name.

This callback function will be triggered by the javascript method "Doc.mailForm". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]file_suffix_nameFile suffix name.
Returns
The temporary file path.

◆ GetUntitledBookmarkName()

virtual WString foxit::ActionCallback::GetUntitledBookmarkName ( )
pure virtual

A callback function to get the new name for an untitled bookmark.

This callback function will be triggered by the javascript mothod "bookmark.createChild" when the parameter "cName" of the method is an empty string. This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
A new name for an untitled bookmark.

◆ InvalidateRect()

virtual bool foxit::ActionCallback::InvalidateRect ( const pdf::PDFDoc document,
int  page_index,
const RectF pdf_rect 
)
pure virtual

A callback function to invalidate the client area within the specified rectangle.

All positions are measured in PDF "user space". Implementation should call function common::Renderer::StartRender for repainting a specified page area.

Parameters
[in]documentA PDF document object. It would be valid.
[in]page_indexA page index. It would start from 0 and less than page count of the specified document.
[in]pdf_rectA rectangle that specifies the page area in PDF coordinate system. If this is an empty rectangle, that means to refresh the whole page.
Returns
true means success, while false means failure.

◆ IsLocalFile()

virtual bool foxit::ActionCallback::IsLocalFile ( const pdf::PDFDoc document)
pure virtual

A callback function to check whether the file is local file.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
Returns
true means the PDF file is loacl file.

◆ LaunchURL()

virtual bool foxit::ActionCallback::LaunchURL ( const char *  url)
pure virtual

A callback function to launch to a specified URL.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]urlA URL.
Returns
true means success, while false means failure.

◆ MailData()

virtual bool foxit::ActionCallback::MailData ( void *  data,
MailType  data_type,
bool  is_ui,
const wchar_t *  to,
const wchar_t *  subject,
const wchar_t *  cc,
const wchar_t *  bcc,
const wchar_t *  message 
)
pure virtual

A callback function to mail data or message, with or without user interaction.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]dataA data which is to be mailed. The value and type of the data depends on parameter data_type:
[in]data_typeMail type. Please refer to values starting from ActionCallback::e_MailTypeDoc and this would be one of these values.
[in]is_uitrue means that the remaining parameters are used to seed the compose-new-message window which is displayed to the user.
false means that the parameter to is required and all other parameters are optional.
[in]toA string that specifies a semicolon-delimited list of recipients for the message.
[in]subjectA string that specifies the subject of the message. The limit of this string's length is 64 KB.
[in]ccA string that specifies a semicolon-delimited list of CC recipients for the message.
[in]bccA string that specifies a semicolon-delimited list of BCC recipients for the message.
[in]messageA string that specifies the content of the message. The limit of this string's length is 64 KB.
Returns
true means success, while false means failure.

◆ MailDoc()

virtual JsMailResult foxit::ActionCallback::MailDoc ( const pdf::PDFDoc document,
const wchar_t *  to_address,
const wchar_t *  cc_address,
const wchar_t *  bcc_address,
const wchar_t *  subject,
const wchar_t *  message,
bool  is_ui 
)
pure virtual

A callback function to mails a document as an attachment.

This callback function will be triggered by the javascript method "Doc.mailDoc". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]to_addressTo address.
[in]cc_addressCc address.
[in]bcc_addressBcc address.
[in]subjectMail subject.
[in]messageMail message.
[in]is_uitrue means to show mail dialog, while false means not.
Returns
The mail result. Please refer to values starting from ActionCallback::e_JSMailResultFailed and this should be one of these values.

◆ OnFieldValueChanged()

virtual void foxit::ActionCallback::OnFieldValueChanged ( const wchar_t *  field_name,
JSFieldValueChangeType  type,
const WStringArray value_before_changed,
const WStringArray value_after_changed 
)
pure virtual

A callback function to notify the value change of the field.

This callback function will be triggered when the field's value is changed via JavaScript.

Parameters
[in]field_nameA string that specifies the field name.
[in]typeField value change type. Please refer to values starting from ActionCallback::e_JSFieldValueChangedByFormat and this would be one of these values.
[in]value_before_changedA string array that specifies the field's value before the change.

For a list box, the parameter represent one or more than one of the field's items which be selected simultaneously.

Parameters
[in]value_after_changedA string array that specifies the field's value after the change. For a list box, the parameter represent one or more than one of the field's items which be selected simultaneously.
Returns
None.

◆ OpenDoc()

virtual bool foxit::ActionCallback::OpenDoc ( const WString file_path,
const WString password 
)
pure virtual

A callback function to open a PDF file.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]file_pathA full path of an existing PDF file.
[in]passwordPassword for input PDF file. This may be an empty string.
Returns
true means success, while false means failure.

◆ OpenMediaPlayer()

virtual MediaPlayerCallback* foxit::ActionCallback::OpenMediaPlayer ( const PlayerArgs player_args)
pure virtual

A callback function to open media player.

This callback function will be triggered by the javascript method "app.media.openPlayer" or "app.media.createPlayer".

Parameters
[in]player_argsThe PlayerArgs object.
Returns
A MediaPlayerCallback object.

◆ PopupMenu()

virtual WString foxit::ActionCallback::PopupMenu ( const MenuListArray menus,
bool &  is_selected_item 
)
pure virtual

A callback function to pop up a menu window.

The position of menu window is the same as cursor's. This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]menusAn array of menu list objects.
[out]is_selected_itemOutput parameter that receives the value of whether a menu item is selected or not. true means that the menu item is selected, while false means that the menu item is not selected.
Returns
The name of the menu item that was selected.

◆ PopupMenuEx()

virtual MenuItemEx foxit::ActionCallback::PopupMenuEx ( const MenuItemExArray &  menus,
bool &  is_selected_item 
)
pure virtual

A callback function to pop up a menu window.

The position of menu window is the same as cursor's. This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]menusAn array of MenuItemEx objects.
[out]is_selected_itemOutput parameter that receives the value of whether a menu item is selected or not. true means that the menu item is selected, while false means that the menu item is not selected.
Returns
The MenuItemEx object of the menu item that was selected.

◆ Print() [1/2]

virtual bool foxit::ActionCallback::Print ( const pdf::PDFDoc document,
bool  is_ui,
const common::Range page_range,
bool  is_silent,
bool  is_shrunk_to_fit,
bool  is_printed_as_image,
bool  is_reversed,
bool  is_to_print_annots 
)
pure virtual

A callback function to print pages within a specified index range.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]is_uitrue means that a UI should be presented to the user to obtain printing information and confirm the action.
[in]page_rangeA range object to specify the page range for printing. All the indexes represented in this range would start from 0 and less than page count of the specified document.
[in]is_silenttrue means that the cancel dialog box should be suppressed while the document is printing.
[in]is_shrunk_to_fittrue means that the page should be shrunk (if necessary) to fit within the area of the printed page.
[in]is_printed_as_imagetrue means that pages should be printed as image.
[in]is_reversedtrue means that the printing order should be from parameter end to parameter start.
[in]is_to_print_annotstrue means that annotations should be printed with page.
Returns
true means success, while false means failure.

◆ Print() [2/2]

virtual bool foxit::ActionCallback::Print ( const pdf::PDFDoc document,
const PrintParams print_params 
)
pure virtual

A callback function to print document with print parameters.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]print_paramsA PrintParams object.
Returns
true means success, while false means failure.

◆ Release()

virtual void foxit::ActionCallback::Release ( )
pure virtual

A callback function used to release current callback object itself.

Returns
None.

◆ RemoveToolButtom()

virtual bool foxit::ActionCallback::RemoveToolButtom ( const wchar_t *  button_name)
pure virtual

A callback function to remove a tool button added by the function ActionCallback::AddToolButton.

This callback function will be triggered by the javascript method "app.removeToolButton".

Parameters
[in]button_nameThe name of the tool button.
Returns
true means success, while false means failure.

◆ Response()

virtual WString foxit::ActionCallback::Response ( const wchar_t *  question,
const wchar_t *  title,
const wchar_t *  default_value,
const wchar_t *  label,
bool  is_password 
)
pure virtual

A callback function to display a dialog box containing a question and an entry field for the user to reply to the question.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]questionA string that specifies the question to be posed to the user.
[in]titleA string that specifies the title of the dialog box.
[in]default_valueA string that specifies a default value as the answer to the question. If the answer is not specified, no default value is presented.
[in]labelA string that specifies a short string to appear in front of the edit text field.
[in]is_passwordA boolean value that indicates whether user's response should be masked to show:
true means that the user's response should show as asterisks (*) or bullets (?) to mask the response, which might be sensitive information.
Returns
User's response. It can be an empty string.

◆ Scroll()

virtual void foxit::ActionCallback::Scroll ( const PointF point)
pure virtual

A callback function to scroll the specified point on the current page into the middle of the current view.

This callback function will be triggered by the javascript method "Doc.scroll". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]pointThe specified point[PDF coordinate system].
Returns
None.

◆ SelectPageNthWord()

virtual void foxit::ActionCallback::SelectPageNthWord ( int  page_index,
int  word_index,
bool  is_show_selection 
)
pure virtual

A callback function to change the current page number and selects the specified word on the page.

This callback function will be triggered by the javascript method "Doc.selectPageNthWord". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]page_indexThe page index.
[in]word_indexThe word index.
[in]is_show_selectiontrue means to show selection, while false means not.
Returns
None.

◆ SetCurrentPage() [1/2]

virtual void foxit::ActionCallback::SetCurrentPage ( const pdf::PDFDoc document,
int  page_index 
)
pure virtual

A callback function used to set the current page by index.

This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]documentA PDF document object. It would be valid.
[in]page_indexA page index which is used to change current page. The index would start from 0 and less than page count of the specified document.
Returns
None.

◆ SetCurrentPage() [2/2]

virtual void foxit::ActionCallback::SetCurrentPage ( const pdf::PDFDoc document,
const foxit::pdf::Destination destination 
)
pure virtual

A callback function used to set the current page by destination.

This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]documentA PDF document object. It would be valid.
[in]destinationA object. None.

◆ SetDocChangeMark()

virtual bool foxit::ActionCallback::SetDocChangeMark ( const pdf::PDFDoc document,
bool  change_mark 
)
pure virtual

A callback function to set the change mark which indicates whether the content of document is changed or not.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]change_markA boolean value that indicates whether the content of document is changed or not.
Returns
true means success, while false means failure.

◆ SetFullScreen()

virtual void foxit::ActionCallback::SetFullScreen ( bool  is_full_screen)
pure virtual

A callback function to set full screen mode.

This callback function will be triggered when the javascript property "app.fullScreen" or "app.fs.isFullScreen" is to be set.

Parameters
[in]is_full_screentrue means to set full screen mode, while false means not.
Returns
None.

◆ SetIdentityProperties()

virtual bool foxit::ActionCallback::SetIdentityProperties ( const IdentityProperties identity_properties)
pure virtual

A callback function used to set identity properties of current user.

This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]identity_propertiesAn identity properties object used to be set.
Returns
true means success, while false means failure.

◆ SetLayoutMode()

virtual void foxit::ActionCallback::SetLayoutMode ( LayoutMode  layout_mode,
bool  is_cover_mode 
)
pure virtual

A callback function to set the page layout of the current document.

This callback function will be triggered by the javascript properties "Doc.layout". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]layout_modeThe layout mode. Please refer to values starting from ActionCallback::e_LayoutModeSinglePage and this should be one of these values.
[in]is_cover_modetrue means that the cover will always displayed separately, while false means not.
Returns
None.

◆ SetPageRotation()

virtual bool foxit::ActionCallback::SetPageRotation ( const pdf::PDFDoc document,
int  page_index,
common::Rotation  rotation 
)
pure virtual

A callback function used to set the rotation value of a page on PDF viewer.

This callback function is optional, so it can be implemented to do nothing.

Parameters
[in]documentA PDF document object. It would be valid.
[in]page_indexA page index, used to specify which page's rotation is to be changed. The index would start from 0 and less than page count of the specified document.
[in]rotationNew rotation value. Please refer to values starting from common::e_Rotation0 and this should be one of these values except common::e_RotationUnknown.
Returns
true means success, while false means failure.

◆ SetPageScale()

virtual void foxit::ActionCallback::SetPageScale ( foxit::pdf::Destination::ZoomMode  zoom_mode,
const foxit::pdf::Destination dest 
)
pure virtual

A callback function to set current page zoom value.

This callback function will be triggered by the javascript properties "Doc.zoom" or "Doc.zoomType". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]zoom_modeThe zoom mode. Please refer to values starting from pdf::Destination::e_ZoomXYZ and this should be one of these values.
[in]destA pdf::Destination object that represents destination data.
Returns
None.

◆ ShowDialog()

virtual bool foxit::ActionCallback::ShowDialog ( const DialogDescriptionConfig dlg_config)
pure virtual

A callback function to show the dialog.

This callback function will be triggered by the javascript method "app.execDialog".

Parameters
[in]dlg_configThe DialogDescriptionConfig object.
Returns
true means success, while false means failure.

◆ SubmitForm()

virtual bool foxit::ActionCallback::SubmitForm ( const pdf::PDFDoc document,
void *  form_data,
uint32  length,
const char *  url,
common::FileFormatType  file_format_type 
)
pure virtual

A callback function to submit the form data to a specified URL.

This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Parameters
[in]documentA PDF document object. It would be valid.
[in]form_dataA form data buffer which is to be submitted.
[in]lengthThe size (in bytes) of the buffer parameterform_data.
[in]urlA URL, to which the form data will be submitted.
[in]file_format_typeFile format type for submission form. Please refer to values starting from foxit::common::e_FileFormatTypeFDF and this would be one of these values.
Returns
true means success, while false means failure.

◆ UpdateLogicalLabel()

virtual void foxit::ActionCallback::UpdateLogicalLabel ( )
pure virtual

A callback function to update logical label.

This callback function will be triggered by the javascript method "Doc.setPageLabels". This callback function is optional, so it can be implemented to do nothing and just return a useless value.

Returns
None.

◆ VerifySignature()

virtual uint32 foxit::ActionCallback::VerifySignature ( const pdf::PDFDoc document,
const pdf::Signature pdf_signature 
)
pure virtual

A callback function to verify specified signature..

This callback function will be triggered when a signature is to be verified by an action. If user does not want to verify the signature, just implement this function to do nothing and just return pdf::Signature::e_StateUnknown. User is recommended to use class pdf::LTVVerifier to verify if a signed signature is valid or not.

Parameters
[in]documentA PDF document object. It would be valid.
[in]pdf_signatureA PDF signature which is signed. This signature belongs to input parameter document.
Returns
The signature verified state. Please refer to values starting from pdf::Signature::e_StateUnknown and this would be one or combination of them.