FSPDF_ACTION_HANDLER Struct Reference

Structure for action handler information. More...

#include <fs_obsolete.h>

Public Attributes

FS_LPVOID clientData
 User-defined data. More...
 
FS_RESULT(* Release )(FS_LPVOID clientData)
 Optional callback function to release data. More...
 
FS_RESULT(* InvalidateRect )(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 pageIndex, FSCRT_RECTF *pdfRect)
 Required callback function to invalidate the client area within the specified rectangle. More...
 
FS_RESULT(* GetCurrentPageIndex )(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 *pageIndex)
 Optional callback function to receives the current page index. More...
 
FS_RESULT(* SetCurrentPageIndex )(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 pageIndex)
 Optional callback function to set the current page index. More...
 
FS_RESULT(* GetRotation )(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 pageIndex, FS_INT32 *rotation)
 Optional callback function to receive current rotation of the page view. More...
 
FS_RESULT(* ExecuteNamedAction )(FS_LPVOID clientData, FSCRT_DOCUMENT document, const FSCRT_BSTR *namedAction)
 Optional callback function to execute a named action. More...
 
FS_RESULT(* SetChangeMark )(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL changeMark)
 Optional callback function to set the change mark which indicates whether the content of document is changed or not. More...
 
FS_RESULT(* GetChangeMark )(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL *changeMark)
 Optional callback function to receive the change mark which indicates whether the content of document is changed or not. More...
 
FS_RESULT(* GetOpenedDocs )(FS_LPVOID clientData, FSCRT_DOCUMENT *docs, FS_INT32 *count)
 Optional callback function to receives handles of all documents which are opened now. More...
 
FS_RESULT(* Alert )(FS_LPVOID clientData, const FSCRT_BSTR *msg, const FSCRT_BSTR *title, FS_INT32 type, FS_INT32 icon, FS_INT32 *retCode)
 Optional callback function to pop up a dialogue to show warnings or hints. More...
 
FS_RESULT(* Beep )(FS_LPVOID clientData, FS_INT32 type)
 Optional callback function to cause the system to play a sound. More...
 
FS_RESULT(* Response )(FS_LPVOID clientData, const FSCRT_BSTR *question, const FSCRT_BSTR *title, const FSCRT_BSTR *defaultValue, const FSCRT_BSTR *label, FS_BOOL isPassword, FSCRT_BSTR *response)
 Optional callback function to display a dialogue box containing a question and an entry field for the user to reply to the question. More...
 
FS_RESULT(* GetFilePath )(FS_LPVOID clientData, FSCRT_DOCUMENT document, FSCRT_BSTR *filePath)
 Optional callback function to get the file path of current document. More...
 
FS_RESULT(* Mail )(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL bUI, const FSCRT_BSTR *To, const FSCRT_BSTR *Subject, const FSCRT_BSTR *CC, const FSCRT_BSTR *BCC, const FSCRT_BSTR *Msg)
 Optional callback function to mail current PDF document as an attachment to all recipients, with or without user interaction. More...
 
FS_RESULT(* Print )(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL isUI, FS_INT32 start, FS_INT32 end, FS_BOOL isSilent, FS_BOOL isShrinkToFit, FS_BOOL isPrintAsImage, FS_BOOL isReverse, FS_BOOL isAnnotations)
 Optional callback function to print all or a specific number of pages of the document. More...
 
FS_RESULT(* SubmitForm )(FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_LPVOID formData, FS_DWORD length, const FSCRT_BSTR *URL)
 Optional callback function to submit the form data to a specified URL. More...
 
FS_RESULT(* LaunchURL )(FS_LPVOID clientData, const FSCRT_BSTR *URL)
 Optional callback function to launch to a specified URL. More...
 
FS_RESULT(* BrowseFile )(FS_LPVOID clientData, FSCRT_BSTR *filePath)
 Optional callback function to show a file selection dialogue, and return the selected file path. More...
 
FS_RESULT(* GetLanguage )(FS_LPVOID clientData, FS_INT32 *language)
 Optional callback function to get the language of the running viewer application. More...
 
FS_RESULT(* PopupMenu )(FS_LPVOID clientData, const FSPDF_MENULIST *menus, FS_INT32 count, FSCRT_BSTR *seletedMenu)
 Optional callback function to pop up a menu window. More...
 

Detailed Description

Structure for action handler information.

Deprecated:
Current structure has been deprecated with function FSPDF_Doc_SetActionHandler since Foxit PDF SDK 4.5. So, not recommend to use current structure any more. User can use structure FSPDF_JAVASCRIPTACTION_HANDLER instead.

This is a handler and should be implemented by caller.
Action handler provides a number of interfaces to implement the actions.

Member Data Documentation

FS_RESULT(* FSPDF_ACTION_HANDLER::Alert) (FS_LPVOID clientData, const FSCRT_BSTR *msg, const FSCRT_BSTR *title, FS_INT32 type, FS_INT32 icon, FS_INT32 *retCode)

Optional callback function to pop up a dialogue to show warnings or hints.

Parameters
[in]clientDataPointer to the interface structure itself.
[in]msgPointer to a FSCRT_BSTR structure to specify the message to be displayed. It should be a UTF-8 string.
[in]titlePointer to a FSCRT_BSTR structure to specify the title of the dialogue. It should be a UTF-8 string.
[in]typeType of button group. Its value can be:
  • 0: OK;(default value.)
  • 1: OK, Cancel;
  • 2: Yes, NO;
  • 3: Yes, NO, Cancel.
[in]iconIcon type. Its value can be:
  • 0: Error;(default value.)
  • 1: Warning;
  • 2: Question;
  • 3: Status.
[out]retCodePointer to a FS_INT32 object. It can be:
  • 1: OK;
  • 2: Cancel;
  • 3: NO;
  • 4: Yes;
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::Beep) (FS_LPVOID clientData, FS_INT32 type)

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

Parameters
[in]clientDataPointer to the interface structure itself.
[in]typeSound type. Its value can be:
  • 0: Error
  • 1: Warning
  • 2: Question
  • 3: Status
  • 4: Default (default value)
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::BrowseFile) (FS_LPVOID clientData, FSCRT_BSTR *filePath)

Optional callback function to show a file selection dialogue, and return the selected file path.

Parameters
[in]clientDataThe user-supplied data.
[out]filePathPointer to a FSCRT_BSTR structure that receives the file path. It can be NULL And it should be a UTF-8 string if it is not NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
The filePath should be always inputted in the local encoding.
FS_LPVOID FSPDF_ACTION_HANDLER::clientData

User-defined data.

Note
Caller can use this field to track controls.
FS_RESULT(* FSPDF_ACTION_HANDLER::ExecuteNamedAction) (FS_LPVOID clientData, FSCRT_DOCUMENT document, const FSCRT_BSTR *namedAction)

Optional callback function to execute a named action.

Please refer to description of named actions description in PDF Reference 1.7 for more details.

Parameters
[in]clientDataPointer to the interface structure itself.
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid.
[in]namedActionPointer to a FSCRT_BSTR structure to specify the named action. It would be a UTF-8 string.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::GetChangeMark) (FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL *changeMark)

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

Parameters
[in]clientDataPointer to the interface structure itself.
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid.
[out]changeMarkPointer to a FS_BOOL object that receives the change mark.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::GetCurrentPageIndex) (FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 *pageIndex)

Optional callback function to receives the current page index.

Parameters
[in]clientDataPointer to user-defined data.
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid.
[out]pageIndexPointer to a FS_INT32 object that receive the index of current PDF page. This should be stared from 0 and less than page count of current document.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::GetFilePath) (FS_LPVOID clientData, FSCRT_DOCUMENT document, FSCRT_BSTR *filePath)

Optional callback function to get the file path of current document.

Parameters
[in]clientDataThe user-supplied data.
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid.
[out]filePathPointer to a FSCRT_BSTR structure that receives the file path. It can be NULL And it should be a UTF-8 string if it is not NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::GetLanguage) (FS_LPVOID clientData, FS_INT32 *language)

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

Parameters
[in]clientDataThe user-supplied data.
[out]languagePointer to a FS_INT32 object that receives the language. Please refer to macro definitions FSCRT_LANGUAGE_XXX and this would be one of these macros.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::GetOpenedDocs) (FS_LPVOID clientData, FSCRT_DOCUMENT *docs, FS_INT32 *count)

Optional callback function to receives handles of all documents which are opened now.

This function would be called by Foxit PDF SDK twice to get handles of opened document:
For the first time, set parameter docs to NULL to get the actual count of opened document. The count value will be set to parameter count as a result returned by first calling. Then use count to allocate docs.
For the second time, input the allocated docs and its size count. When this function returns successfully, docs will get an array of opened documents and count will get the actual count.
The size of the input array should not be less than the actual count.

Parameters
[in]clientDataPointer to the interface structure itself.
[in,out]docsPointer to a FSCRT_DOCUMENT handle that receives a array storing handles of all opened documents. This can be NULL for getting actual count of opened documents before allocate this array.
Please see detail description about how this callback function will be used.
[in,out]countPointer to a FS_INT32 object.
When this function is called, it should be the size of array docs if the parameter docs is not NULL.
When this function returns, it will receive actual count of opened documents which are got.
Please see detail description about how this callback function will be used.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_BUFFEROVERFLOW if the parameter docs is valid but count is less than required amount.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::GetRotation) (FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 pageIndex, FS_INT32 *rotation)

Optional callback function to receive current rotation of the page view.

Parameters
[in]clientDataPointer to the interface structure itself.
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid.
[in]pageIndexThe page index which starts from 0.
[out]rotationThe rotation of the page being displayed. Please refer to macro definitions FSCRT_PAGEROTATION_XXX and this would be one of these macros.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::InvalidateRect) (FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 pageIndex, FSCRT_RECTF *pdfRect)

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

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

Parameters
[in]clientDataPointer to user-defined data.
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid.
[in]pageIndexThe page index which start from 0.
[in]pdfRectPointer to a FSCRT_RECTF structure, which specify the page area in PDF page coordinate.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::LaunchURL) (FS_LPVOID clientData, const FSCRT_BSTR *URL)

Optional callback function to launch to a specified URL.

Parameters
[in]clientDataThe user-supplied data.
[in]URLPointer to a FSCRT_BSTR structure to specify a URL. It should be a UTF-8 string.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::Mail) (FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL bUI, const FSCRT_BSTR *To, const FSCRT_BSTR *Subject, const FSCRT_BSTR *CC, const FSCRT_BSTR *BCC, const FSCRT_BSTR *Msg)

Optional callback function to mail current PDF document as an attachment to all recipients, with or without user interaction.

Parameters
[in]clientDataThe user-supplied data.
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid.
[in]bUIA boolean value:
TRUE means that the rest of the parameters are used in a compose-new-message window which is displayed to the user.
FALSE means that the parameter To is required and all others are optional.
[in]ToPointer to a FSCRT_BSTR structure to specify a semicolon-delimited list of recipients for the message. It should be a UTF-8 string.
[in]SubjectPointer to a FSCRT_BSTR structure to specify the subject of the message. It should be a UTF-8 string.
The limit of its length is 64 KB.
[in]CCPointer to a FSCRT_BSTR structure to specify a semicolon-delimited list of CC recipients for the message. It should be a UTF-8 string.
[in]BCCPointer to a FSCRT_BSTR structure to specify a semicolon-delimited list of BCC recipients for the message. It should be a UTF-8 string.
[in]MsgPointer to a FSCRT_BSTR structure to specify the content of the message. It should be a UTF-8 string.
The limit of its length is 64 KB.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::PopupMenu) (FS_LPVOID clientData, const FSPDF_MENULIST *menus, FS_INT32 count, FSCRT_BSTR *seletedMenu)

Optional callback function to pop up a menu window.

Application should call function FSCRT_BStr_Set to set the value of seletedMenu, and do not call function FSCRT_BStr_Clear to free seletedMenu. The position of menu window is same as cursor's.

Parameters
[in]clientDataThe user-supplied data.
[in]menusPointer to an array of FSPDF_MENULIST object which is the menus.
[in]countThe size of menus.
[out]seletedMenuPointer to a FSCRT_BSTR structure that receives selected menu.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::Print) (FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL isUI, FS_INT32 start, FS_INT32 end, FS_BOOL isSilent, FS_BOOL isShrinkToFit, FS_BOOL isPrintAsImage, FS_BOOL isReverse, FS_BOOL isAnnotations)

Optional callback function to print all or a specific number of pages of the document.

Parameters
[in]clientDataThe user-supplied data.
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid.
[in]isUITRUE means that a UI will be presented to the user to obtain printing information and confirm the action.
[in]startA zero-based index of the start of an inclusive range of pages.
[in]endA zero-based index of the end of an inclusive page range.
[in]isSilentTRUE means that the cancel dialogue box will be suppressed while the document is printing. The default is FALSE.
[in]isShrinkToFitTRUE means that the page is shrunk (if necessary) to fit within the area of the printed page.
[in]isPrintAsImageTRUE means that it will print pages as an image.
[in]isReverseTRUE means that it will print from nEnd to nStart.
[in]isAnnotationsTRUE means that annotations will be printed.The default is TRUE.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::Release) (FS_LPVOID clientData)

Optional callback function to release data.

This callback function gives the implementation a chance to release any data after the interface is no longer used. An this will be called by Foxit PDF SDK during the final cleanup process.

Parameters
[in]clientDataPointer to user-defined data.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::Response) (FS_LPVOID clientData, const FSCRT_BSTR *question, const FSCRT_BSTR *title, const FSCRT_BSTR *defaultValue, const FSCRT_BSTR *label, FS_BOOL isPassword, FSCRT_BSTR *response)

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

Parameters
[in]clientDataThe user-supplied data.
[in]questionPointer to a FSCRT_BSTR structure to specify the question to be posed to the user. It should be a UTF-8 string.
[in]titlePointer to a FSCRT_BSTR structure to specify the title of the dialogue box. It should be a UTF-8 string.
[in]defaultValuePointer to a FSCRT_BSTR structure to specify a default value for the answer to the question. It should be a UTF-8 string. If the answer is not specified, no default value is presented.
[in]labelPointer to a FSCRT_BSTR structure to specify a short string to appear in front of the edit text field. It should be a UTF-8 string.
[in]isPasswordA 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.
Default: FALSE.
[out]responsePointer to a FSCRT_BSTR structure that receives the user's response. It can be NULL. And it should be a UTF-8 string if it is not NULL.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::SetChangeMark) (FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_BOOL changeMark)

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

Parameters
[in]clientDataPointer to the interface structure itself.
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid.
[in]changeMarkA boolean value that indicates whether the content of document is changed or not.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::SetCurrentPageIndex) (FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_INT32 pageIndex)

Optional callback function to set the current page index.

Parameters
[in]clientDataPointer to the interface structure itself.
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid.
[in]pageIndexIndex of page index which is to be set to current PDF page, starting from 0.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_ACTION_HANDLER::SubmitForm) (FS_LPVOID clientData, FSCRT_DOCUMENT document, FS_LPVOID formData, FS_DWORD length, const FSCRT_BSTR *URL)

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

Parameters
[in]clientDataThe user-supplied data.
[in]documentHandle to a FSCRT_DOCUMENT object which is a PDF document object. It should be valid.
[in]formDataPointer to a data buffer which is to be submit.
[in]lengthThe size(in bytes) of the buffer parameterformData.
[in]URLPointer to a FSCRT_BSTR structure to specify a URL, to which the form data will be submit. It should be a UTF-8 string.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.

The documentation for this struct was generated from the following file:

Foxit Corporation