public abstract class FormActionHandler
extends java.lang.Object
FormActionHandler
represents as interface for action
triggered by form filling.
This is a handler and should be implemented by caller. Action handler provides a number of interfaces to implement the actions.
Modifier and Type | Field and Description |
---|---|
java.lang.Object |
clientData
User-defined data.
|
Constructor and Description |
---|
FormActionHandler() |
Modifier and Type | Method and Description |
---|---|
int |
alert(java.lang.Object clientData,
java.lang.String msg,
java.lang.String title,
int type,
int icon)
Optional callback function to pop up a dialogue to show warnings or hints.
|
void |
beep(java.lang.Object clientData,
int type)
Optional callback function to cause the system to play a sound.
|
java.lang.String |
browseFile(java.lang.Object clientData)
Optional callback function to show a file selection dialogue, and return the
selected file path.
|
void |
executeNamedAction(java.lang.Object clientData,
PDFDocument document,
java.lang.String namedAction)
Optional callback function to execute a named action.
|
boolean |
getChangeMark(java.lang.Object clientData,
PDFDocument document)
Optional callback function to receive the change mark which indicates whether the
content of document is changed or not.
|
int |
getCurrentPageIndex(java.lang.Object clientData,
PDFDocument document)
Optional callback function to receives the current page index.
|
java.lang.String |
getFilePath(java.lang.Object clientData,
PDFDocument document)
Optional callback function to get the file path of current document.
|
PDFDocument[] |
getOpenedDocs(java.lang.Object clientData)
Optional callback function to receives handles of all documents which are opened now.
|
int |
getRotation(java.lang.Object clientData,
PDFDocument document,
int pageIndex)
Optional callback function to receive current rotation of the page view.
|
abstract void |
invalidateRect(java.lang.Object clientData,
PDFDocument document,
int pageIndex,
android.graphics.RectF pdfRect)
Required callback function to invalidate the client area within the specified
rectangle.
|
void |
launchURL(java.lang.Object clientData,
java.lang.String URL)
Optional callback function to launch to a specified URL.
|
void |
mail(java.lang.Object clientData,
PDFDocument document,
boolean bUI,
java.lang.String To,
java.lang.String Subject,
java.lang.String CC,
java.lang.String BCC,
java.lang.String Msg)
Optional callback function to mail current PDF document as an attachment to all
recipients, with or without user interaction.
|
void |
print(java.lang.Object clientData,
PDFDocument document,
boolean isUI,
int start,
int end,
boolean isSilent,
boolean isShrinkToFit,
boolean isPrintAsImage,
boolean isReverse,
boolean isAnnotations)
Optional callback function to print all or a specific number of pages of the document.
|
void |
release(java.lang.Object clientData)
Optional callback function to release data.
|
java.lang.String |
response(java.lang.Object clientData,
java.lang.String question,
java.lang.String title,
java.lang.String defaultValue,
java.lang.String label,
boolean isPassword)
Optional callback function to display a dialogue box containing a question and an
entry field for the user to reply to the question.
|
void |
setChangeMark(java.lang.Object clientData,
PDFDocument document,
boolean changeMark)
Optional callback function to set the change mark which indicates whether the
content of document is changed or not.
|
void |
setCurrentPageIndex(java.lang.Object clientData,
PDFDocument document,
int pageIndex)
Optional callback function to set the current page index.
|
void |
submitForm(java.lang.Object clientData,
PDFDocument document,
byte[] formData,
java.lang.String URL)
Optional callback function to submit the form data to a specified URL.
|
public java.lang.Object clientData
Caller can use this field to track controls.
public void release(java.lang.Object clientData) throws PDFException
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.
clientData
- User-defined data.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public abstract void invalidateRect(java.lang.Object clientData, PDFDocument document, int pageIndex, android.graphics.RectF pdfRect) throws PDFException
All positions are measured in PDF "user space". Implementation should call function
or other rendering methods to repainting a specified page area.PDFPage.startRender(RenderContext, Renderer, int)
clientData
- User-defined data.document
- A PDFDocument
object which is a PDF document
object. It should be valid.pageIndex
- The page index which start from 0.pdfRect
- A RectF
object, which specify the page area in
PDF page coordinate.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
,
RenderContext
,
Renderer
,
PDFPage
public int getCurrentPageIndex(java.lang.Object clientData, PDFDocument document) throws PDFException
clientData
- User-defined data.document
- A PDFDocument
object which is a PDF document
object. It should be valid.integer
value that receive the index of current
PDF page. This should be stared from 0 and less than page count
of current document.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
public void setCurrentPageIndex(java.lang.Object clientData, PDFDocument document, int pageIndex) throws PDFException
clientData
- User-defined data.document
- A PDFDocument
object which is a PDF document
object. It should be valid.pageIndex
- Index of page index which is to be set to current PDF page,
starting from 0.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
public int getRotation(java.lang.Object clientData, PDFDocument document, int pageIndex) throws PDFException
clientData
- User-defined data.document
- A PDFDocument
object which is a PDF document
object. It should be valid.pageIndex
- The page index which starts from 0.ROTATION_XXX
and this should be one of these constants.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
,
PDFPage
public void executeNamedAction(java.lang.Object clientData, PDFDocument document, java.lang.String namedAction) throws PDFException
Please refer to description of named actions description in PDF Reference 1.7 for more details.
clientData
- User-defined data.document
- A PDFDocument
object which is a PDF document
object. It should be valid.namedAction
- A String
object to specify the named action.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
public void setChangeMark(java.lang.Object clientData, PDFDocument document, boolean changeMark) throws PDFException
clientData
- User-defined data.document
- A PDFDocument
object which is a PDF document
object. It should be valid.changeMark
- A boolean
value that indicates whether the
content of document is changed or not.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
public boolean getChangeMark(java.lang.Object clientData, PDFDocument document) throws PDFException
clientData
- User-defined data.document
- A PDFDocument
object which is a PDF document
object. It should be valid.boolean
value that indicates whether the
content of document is changed or not.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
public PDFDocument[] getOpenedDocs(java.lang.Object clientData) throws PDFException
clientData
- Pointer to the interface object itself.PDFDocument
objects array that receives all opened
documents.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
public int alert(java.lang.Object clientData, java.lang.String msg, java.lang.String title, int type, int icon) throws PDFException
clientData
- The interface object itself.msg
- A String
object to specify the message to be
displayed.title
- A String
object to specify the title of the
dialogue.type
- Type of button group. Its value can be:0: OK;(default value.)
1: OK, Cancel;
2: Yes, NO;
3: Yes, NO, Cancel.
icon
- Icon type. Its value can be:0: Error;(default value.)
1: Warning;
2: Question;
3: Status.
integer
value. It can be:1: OK;
2: Cancel;
3: NO;
4: Yes.
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void beep(java.lang.Object clientData, int type) throws PDFException
clientData
- The interface object itself.type
- Sound type. Its value can be:0: Error
1: Warning
2: Question
3: Status
4: Default (default value)
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String response(java.lang.Object clientData, java.lang.String question, java.lang.String title, java.lang.String defaultValue, java.lang.String label, boolean isPassword) throws PDFException
clientData
- The User-supplied data.question
- A String
object to specify the question to be
posed to the user.title
- A String
object to specify the title of the
dialogue box.defaultValue
- A String
object to specify a default value for
the answer to the question. If the answer is not specified, no
default value is presented.label
- A String
object to specify a short string to
appear in front of the edit text field.isPassword
- A 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
.String
object that receives the user's
response. It can be null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String getFilePath(java.lang.Object clientData, PDFDocument document) throws PDFException
clientData
- The user-supplied data.document
- A PDFDocument
object which is a PDF document
object. It should be valid.String
object that receives the file path. It can
be null
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
public void mail(java.lang.Object clientData, PDFDocument document, boolean bUI, java.lang.String To, java.lang.String Subject, java.lang.String CC, java.lang.String BCC, java.lang.String Msg) throws PDFException
clientData
- The user-supplied data.document
- A PDFDocument
object which is a PDF document
object. It should be valid.bUI
- A 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.To
- A String
object to specify a semicolon-delimited
list of recipients for the message.Subject
- A String
object to specify the subject of the
message. The limit of its length is 64 KB.CC
- A String
object to specify a semicolon-delimited
list of CC recipients for the message.BCC
- A String
object to specify a semicolon-delimited
list of BCC recipients for the message.Msg
- A String
object to specify the content of the
message. The limit of its length is 64 KB.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
public void print(java.lang.Object clientData, PDFDocument document, boolean isUI, int start, int end, boolean isSilent, boolean isShrinkToFit, boolean isPrintAsImage, boolean isReverse, boolean isAnnotations) throws PDFException
clientData
- The user-supplied data.document
- A PDFDocument
object which is a PDF document
object. It should be valid.isUI
- true
means that a UI will be presented to the
user to obtain printing information and confirm the action.start
- A zero-based index of the start of an inclusive range of pages.end
- A zero-based index of the end of an inclusive page range.isSilent
- true
means that the cancel dialogue box will be
suppressed while the document is printing. The default is
false
.isShrinkToFit
- true
means that the page is shrunk (if necessary)
to fit within the area of the printed page.isPrintAsImage
- true
means that it will print pages as an image.isReverse
- true
means that it will print from
end
to start
.isAnnotations
- true
means that annotations will be printed.The
default is true
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
public void submitForm(java.lang.Object clientData, PDFDocument document, byte[] formData, java.lang.String URL) throws PDFException
clientData
- The user-supplied data.document
- A PDFDocument
object which is a PDF document
object. It should be valid.formData
- A data buffer which is to be submit.URL
- A String
object to specify a URL, to which the
form data will be submit.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFDocument
public void launchURL(java.lang.Object clientData, java.lang.String URL) throws PDFException
clientData
- The user-supplied data.URL
- A String
object to specify a URL.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String browseFile(java.lang.Object clientData) throws PDFException
clientData
- The user-supplied data.String
object that receives the file path. It can
be null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException