Merge to XFA: Fix a bunch of -Wunused-but-set-variable warnings.
[pdfium.git] / fpdfsdk / include / fpdfformfill.h
index b69a8f6..5191fd7 100644 (file)
 
 typedef void* FPDF_FORMHANDLE;
 
+#define DOCTYPE_PDF          0 //Normal pdf Document
+#define DOCTYPE_DYNIMIC_XFA  1 //Dynimic xfa Document Type
+#define DOCTYPE_STATIC_XFA   2 //Static xfa Document Type
+
 // Exported Functions
 #ifdef __cplusplus
 extern "C" {
@@ -44,6 +48,8 @@ typedef struct _IPDF_JsPlatform
        *                                                       1-Warning;
        *                                                       2-Question;
        *                                                       3-Status.
+       *                                                       4-Asterisk
+
        * Return Value:
        *                       The return value could be the folowing type:
        *                                                       1-OK;
@@ -216,7 +222,7 @@ typedef struct _IPDF_JsPlatform
        * Comments:
        *               The filePath shoule be always input in local encoding.
        */
-       int  (*Field_browse)(struct _IPDF_JsPlatform* pThis,void* filePath, int length);
+       int  (*Field_browse)(struct _IPDF_JsPlatform* pThis, void* filePath, int length);
 
        /**
        *       pointer to FPDF_FORMFILLINFO interface.
@@ -256,11 +262,43 @@ typedef struct _FPDF_SYSTEMTIME
     unsigned short wMilliseconds;      /* milliseconds after the second - [0,999] */
 }FPDF_SYSTEMTIME;
 
+//XFA
+/**
+ * @name Pageview  event flags
+ */
+/*@{*/
+/** @brief After a new pageview is added. */
+#define  FXFA_PAGEVIEWEVENT_POSTADDED          1
+/** @brief After a pageview is removed. */
+#define  FXFA_PAGEVIEWEVENT_POSTREMOVED        3
+/*@}*/
+
+// menu
+/**
+ * @name Macro Definitions for Right Context Menu Features Of XFA Fields
+ */
+/*@{*/
+#define         FXFA_MEMU_COPY                 1
+#define  FXFA_MEMU_CUT                 2
+#define  FXFA_MEMU_SELECTALL   4
+#define  FXFA_MEMU_UNDO                        8
+#define  FXFA_MEMU_REDO                        16
+#define  FXFA_MEMU_PASTE               32
+/*@}*/
+
+// file type
+/**
+ * @name Macro Definitions for File Type.
+ */
+/*@{*/
+#define FXFA_SAVEAS_XML                1
+#define FXFA_SAVEAS_XDP                2
+/*@}*/
 
 typedef struct  _FPDF_FORMFILLINFO
 {
        /**
-        * Version number of the interface. Currently must be 1.
+        * Version number of the interface. Currently must be 2 (with XFA module).
         **/
        int     version;
 
@@ -525,17 +563,248 @@ typedef struct  _FPDF_FORMFILLINFO
        *               See the Destinations description of <<PDF Reference, version 1.7>> in 8.2.1 for more details.  
        **/
        void    (*FFI_DoGoToAction)(struct _FPDF_FORMFILLINFO* pThis, int nPageIndex, int zoomMode, float* fPosArray, int sizeofArray);
-       /**
-       *       pointer to IPDF_JSPLATFORM interface
+
+  /**
+  *   pointer to IPDF_JSPLATFORM interface
+  **/
+  IPDF_JSPLATFORM*     m_pJsPlatform;
+
+  /**
+       * Method: FFI_DisplayCaret
+       *                       This method will show the caret at specified position.
+       * Interface Version:
+       *                       1
+       * Implementation Required:
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               page                    -       Handle to page. Returned by FPDF_LoadPage function.
+       *               left                    -       Left position of the client area in PDF page coordinate. 
+       *               top                             -       Top position of the client area in PDF page coordinate.
+       *               right                   -       Right position of the client area in PDF page coordinate.
+       *               bottom                  -       Bottom position of the client area in PDF page coordinate.
+       * Return value:
+       *               None.
        **/
-       IPDF_JSPLATFORM*        m_pJsPlatform;
+       void    (*FFI_DisplayCaret)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page, FPDF_BOOL bVisible, double left, double top, double right, double bottom);
+       /** 
+       * Method: FFI_GetCurrentPageIndex
+       *                       This method will get the current page index.
+       * Interface Version:
+       *                       1
+       * Implementation Required:
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               document                -       Handle to document. Returned by FPDF_LoadDocument function.
+       * Return value:
+       *               The index of current page.
+       **/
+       int             (*FFI_GetCurrentPageIndex)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document);
+       /** 
+       * Method: FFI_SetCurrentPage
+       *                       This method will set the current page.
+       * Interface Version:
+       *                       1
+       * Implementation Required:
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               document                -       Handle to document. Returned by FPDF_LoadDocument function.
+       *               iCurPage                -       The index of the PDF page.
+       * Return value:
+       *               None.
+       **/
+       void    (*FFI_SetCurrentPage)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document, int iCurPage);
+       /** 
+       * Method: FFI_GotoURL
+       *                       This method will link to the specified URL.
+       * Interface Version:
+       *                       1
+       * Implementation Required:
+       *                       no
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               document                -       Handle to document. Returned by FPDF_LoadDocument function.
+       *               wsURL                   -       The string value of the URL, in UTF-16LE format.
+       * Return value:
+       *               None.
+       **/
+       void    (*FFI_GotoURL)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document, FPDF_WIDESTRING wsURL);
+       /** 
+       * Method: FFI_GetPageViewRect
+       *                       This method will get the current page view rectangle.
+       * Interface Version:
+       *                       1
+       * Implementation Required:
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               page                    -       Handle to page. Returned by FPDF_LoadPage function.
+       *               left                    -       The pointer to receive left position of the page view area in PDF page coordinate. 
+       *               top                             -       The pointer to receive top position of the page view area in PDF page coordinate.
+       *               right                   -       The pointer to receive right position of the client area in PDF page coordinate.
+       *               bottom                  -       The pointer to receive bottom position of the client area in PDF page coordinate.
+       * Return value:
+       *               None.
+       **/
+       void    (*FFI_GetPageViewRect)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page, double* left, double* top, double* right, double* bottom);
+       /** 
+       * Method: FFI_PopupMenu
+       *                       This method will track the right context menu for XFA fields.
+       * Interface Version:
+       *                       1
+       * Implementation Required:
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               page                    -       Handle to page. Returned by FPDF_LoadPage function.
+       *               hWidget                 -       Handle to XFA fields.
+       *               menuFlag                -       The menu flags. Please refer to macro definition of FXFA_MEMU_XXX and this can be one or a combination of these macros.
+       *               x                               -       X position of the client area in PDF page coordinate.
+       *               y                               -       Y position of the client area in PDF page coordinate.
+       * Return value:
+       *               TRUE indicates success; otherwise false.
+       **/
+       FPDF_BOOL (*FFI_PopupMenu)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page, FPDF_WIDGET hWidget, int menuFlag, float x, float y);
+       /** 
+       * Method: FFI_OpenFile
+       *                       This method will open the specified file with the specified mode.
+       * Interface Version
+       *                       1
+       * Implementation Required:
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               fileFlag                -       The file flag.Please refer to macro definition of FXFA_SAVEAS_XXX and this can be one of these macros.
+       *               wsURL                   -       The string value of the file URL, in UTF-16LE format.
+       *               mode                    -       The mode for open file.
+       * Return value:
+       *               The handle to FPDF_FILEHANDLER.
+       **/
+       FPDF_FILEHANDLER* (*FFI_OpenFile)(struct _FPDF_FORMFILLINFO* pThis, int fileFlag, FPDF_WIDESTRING wsURL, const char* mode);
+       /** 
+       * Method: FFI_EmailTo
+       *                       This method will email the specified file stream to the specified contacter.
+       * Interface Version:
+       *                       1
+       * Implementation Required:
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               pFileHandler    -       Handle to the FPDF_FILEHANDLER.
+       *               pTo                             -       A semicolon-delimited list of recipients for the message,in UTF-16LE format.
+       *               pSubject                -   The subject of the message,in UTF-16LE format. 
+       *               pCC                             -       A semicolon-delimited list of CC recipients for the message,in UTF-16LE format.
+       *               pBcc                    -       A semicolon-delimited list of BCC recipients for the message,in UTF-16LE format. 
+       *               pMsg                    -       Pointer to the data buffer to be sent.Can be NULL,in UTF-16LE format.
+       * Return value:
+       *               None.
+       **/
+       void    (*FFI_EmailTo)(struct _FPDF_FORMFILLINFO* pThis, FPDF_FILEHANDLER* fileHandler, FPDF_WIDESTRING pTo, FPDF_WIDESTRING pSubject, FPDF_WIDESTRING pCC, FPDF_WIDESTRING pBcc, FPDF_WIDESTRING pMsg);
+       /** 
+       * Method: FFI_UploadTo
+       *                       This method will get upload the specified file stream to the specified URL.
+       * Interface Version:
+       *                       1
+       * Implementation Required: 
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               pFileHandler    -       Handle to the FPDF_FILEHANDLER.
+       *               fileFlag                -       The file flag.Please refer to macro definition of FXFA_SAVEAS_XXX and this can be one of these macros.
+       *               uploadTo                -       Pointer to the URL path, in UTF-16LE format.
+       * Return value:
+       *               None.
+       **/
+       void    (*FFI_UploadTo)(struct _FPDF_FORMFILLINFO* pThis, FPDF_FILEHANDLER* fileHandler, int fileFlag, FPDF_WIDESTRING uploadTo);
+       
+       /** 
+       * Method: FFI_GetPlatform
+       *                       This method will get the current platform.
+       * Interface Version:
+       *                       1
+       * Implementation Required: 
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               platform                -       Pointer to the data buffer to receive the platform.Can be NULL,in UTF-16LE format.
+       *               length                  -   The length of the buffer, number of bytes. Can be 0.
+       * Return value:
+       *               The length of the buffer, number of bytes.
+       **/
+       int             (*FFI_GetPlatform)(struct _FPDF_FORMFILLINFO* pThis, void* platform, int length);
+       /** 
+       * Method: FFI_GetLanguage
+       *                       This method will get the current language.
+       * Interface Version:
+       *                       1
+       * Implementation Required: 
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               language                -       Pointer to the data buffer to receive the current language.Can be NULL.
+       *               length                  -   The length of the buffer, number of bytes. Can be 0.
+       * Return value:
+       *               The length of the buffer, number of bytes.
+       **/
+       int             (*FFI_GetLanguage)(struct _FPDF_FORMFILLINFO* pThis, void* language, int length);
+       /** 
+       * Method: FFI_DownloadFromURL
+       *                       This method will download the specified file from the URL.
+       * Interface Version:
+       *                       1
+       * Implementation Required: 
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               URL                             -       The string value of the file URL, in UTF-16LE format.
+       * Return value:
+       *               The handle to FPDF_FILEHANDLER.
+       **/
+       FPDF_LPFILEHANDLER      (*FFI_DownloadFromURL)(struct _FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRING URL);
+       /** 
+       * Method: FFI_PostRequestURL
+       *                       This method will post the request to the server URL.
+       * Interface Version:
+       *                       1
+       * Implementation Required: 
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               wsURL                   -       The string value of the server URL, in UTF-16LE format.
+       *               wsData                  -       The post data,in UTF-16LE format.
+       *               wsContentType   -       The content type of the request data,in UTF-16LE format.
+       *               wsEncode                -       The encode type,in UTF-16LE format.
+       *               wsHeader                -       The request header,in UTF-16LE format.
+       *               response                -       Pointer to the FPDF_BSTR to receive the response data from server,,in UTF-16LE format.
+       * Return value:
+       *               TRUE indicates success, otherwise FALSE.
+       **/
+       FPDF_BOOL       (*FFI_PostRequestURL)(struct _FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRING wsURL, FPDF_WIDESTRING wsData, FPDF_WIDESTRING wsContentType, FPDF_WIDESTRING wsEncode, FPDF_WIDESTRING wsHeader, FPDF_BSTR* respone);
+       /** 
+       * Method: FFI_PutRequestURL
+       *                       This method will put the request to the server URL.
+       * Interface Version:
+       *                       1
+       * Implementation Required: 
+       *                       yes
+       * Parameters:
+       *               pThis                   -       Pointer to the interface structure itself.
+       *               wsURL                   -       The string value of the server URL, in UTF-16LE format.
+       *               wsData                  -       The put data, in UTF-16LE format.
+       *               wsEncode                -       The encode type, in UTR-16LE format.
+       * Return value:
+       *               TRUE indicates success, otherwise FALSE.
+       **/
+       FPDF_BOOL       (*FFI_PutRequestURL)(struct _FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRING wsURL, FPDF_WIDESTRING wsData, FPDF_WIDESTRING wsEncode);
 
 } FPDF_FORMFILLINFO;
 
 
 
 /**
- * Function: FPDFDOC_InitFormFillEnviroument
+ * Function: FPDFDOC_InitFormFillEnvironment
  *                     Init form fill environment. 
  * Comments:
  *                     This function should be called before any form fill operation.
@@ -545,24 +814,24 @@ typedef struct  _FPDF_FORMFILLINFO
  * Return Value:
  *                     Return handler to the form fill module. NULL means fails. 
  **/
-DLLEXPORT FPDF_FORMHANDLE STDCALL FPDFDOC_InitFormFillEnviroument(FPDF_DOCUMENT document, FPDF_FORMFILLINFO* formInfo);
+DLLEXPORT FPDF_FORMHANDLE STDCALL FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, FPDF_FORMFILLINFO* formInfo);
 
 /**
- * Function: FPDFDOC_ExitFormFillEnviroument
+ * Function: FPDFDOC_ExitFormFillEnvironment
  *                     Exit form fill environment. 
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  * Return Value:
  *                     NULL.
  **/
-DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnviroument(FPDF_FORMHANDLE hHandle);
+DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle);
 
 /**
  * Function: FORM_OnAfterLoadPage
  *                     This method is required for implementing all the form related functions. Should be invoked after user 
- *                     successfully loaded a PDF page, and method FPDFDOC_InitFormFillEnviroument had been invoked.
+ *                     successfully loaded a PDF page, and method FPDFDOC_InitFormFillEnvironment had been invoked.
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  * Return Value:
  *                     NONE.
  **/
@@ -574,7 +843,7 @@ DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, FPDF_FORMHANDLE hHan
  *                     close the PDF page.
  * Parameters:
  *                     page            -       Handle to the page. Returned by FPDF_LoadPage function.
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  * Return Value:
  *                     NONE.
  **/
@@ -585,7 +854,7 @@ DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hH
 *                      This method is required for performing Document-level JavaScript action. It should be invoked after the PDF document
 *                      had been loaded.
 * Parameters:
-*                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+*                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
 * Return Value:
 *                      NONE
 * Comments:
@@ -599,7 +868,7 @@ DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle);
 * Function: FORM_DoDocumentOpenAction
 *                      This method is required for performing open-action when the document is opened.
 * Parameters:
-*                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+*                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
 * Return Value:
 *                      NONE
 * Comments:
@@ -618,7 +887,7 @@ DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle);
 * Function: FORM_DoDocumentAAction
 *                      This method is required for performing the document's additional-action.
 * Parameters:
-*                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+*                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
 *                      aaType      -   The type of the additional-actions which defined above.
 * Return Value:
 *                      NONE
@@ -637,7 +906,7 @@ DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, int aaTyp
 *                      This method is required for performing the page object's additional-action when opened or closed.
 * Parameters:
 *                      page            -       Handle to the page. Returned by FPDF_LoadPage function.
-*                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+*                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
 *                      aaType      -   The type of the page object's additional-actions which defined above.
 * Return Value:
 *                      NONE
@@ -650,7 +919,7 @@ DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandl
  * Function: FORM_OnMouseMove
  *                     You can call this member function when the mouse cursor moves. 
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  *                     page            -       Handle to the page. Returned by FPDF_LoadPage function.
  *                     modifier                -       Indicates whether various virtual keys are down. 
  *                     page_x          -       Specifies the x-coordinate of the cursor in PDF user space. 
@@ -664,7 +933,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle,FPDF_PAGE p
  * Function: FORM_OnLButtonDown
  *                     You can call this member function when the user presses the left mouse button.
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  *                     page            -       Handle to the page. Returned by FPDF_LoadPage function.
  *                     modifier                -       Indicates whether various virtual keys are down. 
  *                     page_x          -       Specifies the x-coordinate of the cursor in PDF user space. 
@@ -678,7 +947,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle,FPDF_PAGE
  * Function: FORM_OnLButtonUp
  *                     You can call this member function when the user releases the left mouse button.
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  *                     page            -       Handle to the page. Returned by FPDF_LoadPage function.
  *                     modifier        -       Indicates whether various virtual keys are down. 
  *                     page_x          -       Specifies the x-coordinate of the cursor in device. 
@@ -688,11 +957,14 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle,FPDF_PAGE
  **/
 DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
 
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y);
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y);
+
 /**
  * Function: FORM_OnKeyDown
  *                     You can call this member function when a nonsystem key is pressed. 
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  *                     page            -       Handle to the page. Returned by FPDF_LoadPage function.
  *                     nKeyCode        -       Indicates whether various virtual keys are down. 
  *                     modifier        -       Contains the scan code, key-transition code, previous key state, and context code.
@@ -705,7 +977,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle,FPDF_PAGE pag
  * Function: FORM_OnKeyUp
  *                     You can call this member function when a nonsystem key is released. 
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  *                     page            -       Handle to the page. Returned by FPDF_LoadPage function.
  *                     nKeyCode        -       The virtual-key code of the given key.
  *                     modifier        -       Contains the scan code, key-transition code, previous key state, and context code.
@@ -718,7 +990,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle,FPDF_PAGE page,
  * Function: FORM_OnChar
  *                     You can call this member function when a keystroke translates to a nonsystem character.
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  *                     page            -       Handle to the page. Returned by FPDF_LoadPage function.
  *                     nChar           -       The character code value of the key.  
  *                     modifier        -       Contains the scan code, key-transition code, previous key state, and context code.
@@ -732,7 +1004,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle,FPDF_PAGE page,
  *                     You can call this member function to force to kill the focus of the form field which got focus.
  *                     It would kill the focus on the form field, save the value of form field if it's changed by user.
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  * Return Value:
  *                     TRUE indicates success; otherwise false.
  **/
@@ -746,12 +1018,12 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle);
 #define FPDF_FORMFIELD_COMBOBOX                4               // combo box type.
 #define FPDF_FORMFIELD_LISTBOX         5               // list box type.
 #define FPDF_FORMFIELD_TEXTFIELD       6               // text field type.
-
+#define FPDF_FORMFIELD_XFA                     7               // text field type.
 /**
  * Function: FPDPage_HasFormFieldAtPoint
  *                     Check the form filed position by point.
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  *                     page            -       Handle to the page. Returned by FPDF_LoadPage function.
  *                     page_x          -       X position in PDF "user space".
  *                     page_y          -       Y position in PDF "user space".
@@ -764,7 +1036,7 @@ DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,FPDF_P
  * Function: FPDF_SetFormFieldHighlightColor
  *                     Set the highlight color of specified or all the form fields in the document.
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  *                     doc                     -       Handle to the document. Returned by FPDF_LoadDocument function.
  *                     fieldType       -       A 32-bit integer indicating the type of a form field(defined above).
  *                     color           -       The highlight color of the form field.Constructed by 0xxxrrggbb.
@@ -781,7 +1053,7 @@ DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle,
  * Function: FPDF_SetFormFieldHighlightAlpha
  *                     Set the transparency of the form field highlight color in the document.
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  *                     doc                     -       Handle to the document. Returned by FPDF_LoadDocument function.
  *                     alpha           -       The transparency of the form field highlight color. between 0-255.
  * Return Value:
@@ -794,7 +1066,7 @@ DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle,
  * Function: FPDF_RemoveFormFieldHighlight
  *                     Remove the form field highlight color in the document.
  * Parameters:
- *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ *                     hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
  * Return Value:
  *                     NONE.
  * Comments:
@@ -806,7 +1078,7 @@ DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle);
 * Function: FPDF_FFLDraw
 *                      Render FormFeilds on a page to a device independent bitmap.                     
 * Parameters:
-*                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+*                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
 *                      bitmap          -       Handle to the device independent bitmap (as the output buffer).
 *                                                      Bitmap handle can be created by FPDFBitmap_Create function.
 *                      page            -       Handle to the page. Returned by FPDF_LoadPage function.
@@ -826,8 +1098,160 @@ DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle);
 **/
 DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle,FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, 
                                                int size_x, int size_y, int rotate, int flags);
+/**
+ * Function: FPDF_HasXFAField
+ *                      This method is designed to check whether a pdf document has XFA fields.
+ * Parameters:
+ *                      document                -       Handle to document. Returned by FPDF_LoadDocument function.
+ *                      docType                 -       Document type defined as DOCTYPE_xxx.
+ * Return Value:
+ *                      TRUE indicates that the input document has XFA fields, otherwise FALSE.
+ **/
+DLLEXPORT FPDF_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document, int& docType);
 
+/**
+ * Function: FPDF_LoadXFA
+ *                     If the document consists of XFA fields, there should call this method to load XFA fields.
+ * Parameters:
+ *                     document                -       Handle to document. Returned by FPDF_LoadDocument function.
+ * Return Value:
+ *                     TRUE indicates success,otherwise FALSE.
+ **/
+DLLEXPORT FPDF_BOOL STDCALL FPDF_LoadXFA(FPDF_DOCUMENT document);
 
+/**
+ * Function: FPDF_Widget_Undo
+ *                     This method will implement the undo feature for the specified xfa field.
+ * Parameters:
+ *                     document                -       Handle to document. Returned by FPDF_LoadDocument function.
+ *                     hWidget                 -       Handle to the xfa field.
+ * Return Value:
+ *                     None.
+ **/
+DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, FPDF_WIDGET hWidget);
+/**
+ * Function: FPDF_Widget_Redo
+ *                     This method will implement the redo feature for the specified xfa field.
+ * Parameters:
+ *                     document                -       Handle to document. Returned by FPDF_LoadDocument function.
+ *                     hWidget                 -       Handle to the xfa field.
+ * Return Value:
+ *                     None.
+ **/
+DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document, FPDF_WIDGET hWidget);
+/**
+ * Function: FPDF_Widget_SelectAll
+ *                     This method will implement the select all feature for the specified xfa field.
+ * Parameters:
+ *                     document                -       Handle to document. Returned by FPDF_LoadDocument function.
+ *                     hWidget                 -       Handle to the xfa field.
+ * Return Value:
+ *                     None.
+ **/
+DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document, FPDF_WIDGET hWidget);
+/**
+ * Function: FPDF_Widget_Copy
+ *                     This method will implement the copy feature for the specified xfa field.
+ * Parameters:
+ *                     document                -       Handle to document. Returned by FPDF_LoadDocument function.
+ *                     hWidget                 -       Handle to the xfa field.
+ *                     wsText                  -       Pointer to data buffer to receive the copied data, in UTF-16LE format.
+ *                     size                    -       The data buffer size.
+ * Return Value:
+ *                     None.
+ **/
+DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, FPDF_WIDESTRING wsText, FPDF_DWORD* size);
+/**
+ * Function: FPDF_Widget_Cut
+ *                     This method will implement the cut feature for the specified xfa field.
+ * Parameters:
+ *                     document                -       Handle to document. Returned by FPDF_LoadDocument function.
+ *                     hWidget                 -       Handle to the xfa field.
+ *                     wsText                  -       Pointer to data buffer to receive the cut data,in UTF-16LE format.
+ *                     size                    -       The data buffer size,not the byte number.
+ * Return Value:
+ *                     None.
+ **/
+DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, FPDF_WIDESTRING wsText, FPDF_DWORD* size);
+/**
+ * Function: FPDF_Widget_Paste
+ *                     This method will implement the paste feature for the specified xfa field.
+ * Parameters:
+ *                     document                -       Handle to document. Returned by FPDF_LoadDocument function.
+ *                     hWidget                 -       Handle to the xfa field.
+ *                     wsText                  -       The paste text buffer, in UTF-16LE format.
+ *                     size                    -       The data buffer size,not the byte number.
+ * Return Value:
+ *                     None.
+ **/
+DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, FPDF_WIDESTRING wsText, FPDF_DWORD size);
+/**
+ * Function: FPDF_Widget_ReplaceSpellCheckWord
+ *                     This method will implement the spell check feature for the specified xfa field.
+ * Parameters:
+ *                     document                -       Handle to document. Returned by FPDF_LoadDocument function.
+ *                     hWidget                 -       Handle to the xfa field.
+ *                     x                               -       The x value of the specified point.
+ *                     y                               -       The y value of the specified point.
+ *                     bsText                  -       The text buffer needed to be speck check, in UTF-16LE format.
+ * Return Value:
+ *                     None.
+ **/
+DLLEXPORT void STDCALL FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, float x, float y, FPDF_BYTESTRING bsText);
+/**
+ * Function: FPDF_Widget_GetSpellCheckWords
+ *                     This method will implement the spell check feature for the specified xfa field.
+ * Parameters:
+ *                     document                -       Handle to document. Returned by FPDF_LoadDocument function.
+ *                     hWidget                 -       Handle to the xfa field.
+ *                     x                               -       The x value of the specified point.
+ *                     y                               -       The y value of the specified point.
+ *                     stringHandle    -       Pointer to FPDF_STRINGHANDLE to receive the speck check text buffer, in UTF-16LE format.
+ * Return Value:
+ *                     None.
+ **/
+DLLEXPORT void STDCALL FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, float x, float y, FPDF_STRINGHANDLE* stringHandle);
+/**
+ * Function: FPDF_StringHandleCounts
+ *                     This method will get the count of the text buffer.
+ * Parameters:
+ *                     stringHandle    -       Pointer to FPDF_STRINGHANDLE.
+ * Return Value:
+ *                     None.
+ **/
+DLLEXPORT int STDCALL FPDF_StringHandleCounts(FPDF_STRINGHANDLE stringHandle);
+/**
+ * Function: FPDF_StringHandleGetStringByIndex
+ *                     This method will get the specified index of the text buffer.
+ * Parameters:
+ *                     stringHandle    -       Pointer to FPDF_STRINGHANDLE.
+ *                     index                   -       The specified index of text buffer.
+ *                     bsText                  -       Pointer to data buffer to receive the text buffer, in UTF-16LE format.
+ *                     size                    -       The byte size of data buffer.
+ * Return Value:
+ *                     TRUE indicates success, otherwise FALSE.
+ **/
+DLLEXPORT FPDF_BOOL STDCALL FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE stringHandle, int index, FPDF_BYTESTRING bsText, FPDF_DWORD* size);
+/**
+ * Function: FPDF_StringHandleRelease
+ *                     This method will release the FPDF_STRINGHANDLE.
+ * Parameters:
+ *                     stringHandle    -       Pointer to FPDF_STRINGHANDLE.
+ * Return Value:
+ *                     None.
+ **/
+DLLEXPORT void STDCALL FPDF_StringHandleRelease(FPDF_STRINGHANDLE stringHandle);
+/**
+ * Function: FPDF_StringHandleAddString
+ *                     This method will add the specified text buffer.
+ * Parameters:
+ *                     stringHandle    -       Pointer to FPDF_STRINGHANDLE.
+ *                     bsText                  -       Pointer to data buffer of the text buffer, in UTF-16LE format.
+ *                     size                    -       The byte size of data buffer.
+ * Return Value:
+ *                     TRUE indicates success, otherwise FALSE.
+ **/
+DLLEXPORT FPDF_BOOL STDCALL FPDF_StringHandleAddString(FPDF_STRINGHANDLE stringHandle, FPDF_BYTESTRING bsText, FPDF_DWORD size);
 
 #ifdef __cplusplus
 };