Merge to XFA: Fix IWYU in formfiller/ directory.
[pdfium.git] / fpdfsdk / include / fpdfformfill.h
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4  
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7
8 #ifndef _FPDFORMFILL_H
9 #define _FPDFORMFILL_H
10 #include "fpdfview.h"
11
12 typedef void* FPDF_FORMHANDLE;
13
14 #define DOCTYPE_PDF          0 //Normal pdf Document
15 #define DOCTYPE_DYNIMIC_XFA  1 //Dynimic xfa Document Type
16 #define DOCTYPE_STATIC_XFA   2 //Static xfa Document Type
17
18 // Exported Functions
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 typedef struct _IPDF_JsPlatform
24 {
25 /**
26 * Version number of the interface. Currently must be 1.
27         **/
28         int version;
29         
30         /** 
31         * Method: app_alert
32         *                       pop up a dialog to show warning or hint.
33         * Interface Version:
34         *                       1
35         * Implementation Required:
36         *                       yes
37         * Parameters:
38         *                       pThis           -       Pointer to the interface structure itself
39         *                       Msg                     -       A string containing the message to be displayed.
40         *                       Title           -   The title of the dialog.
41         *                       Type            -       The stype of button group. 
42         *                                                       0-OK(default);
43         *                                                       1-OK,Cancel;
44         *                                                       2-Yes,NO; 
45         *                                                       3-Yes, NO, Cancel.
46         *           nIcon               -   The Icon type. 
47         *                                                       0-Error(default);
48         *                                                       1-Warning;
49         *                                                       2-Question;
50         *                                                       3-Status.
51         *                                                       4-Asterisk
52
53         * Return Value:
54         *                       The return value could be the folowing type:
55         *                                                       1-OK;
56         *                                                       2-Cancel; 
57         *                                                       3-NO;
58         *                                                       4-Yes;
59         */
60         int (*app_alert)(struct _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Msg, FPDF_WIDESTRING Title, int Type, int Icon);
61         
62         /** 
63         * Method: app_beep
64         *                       Causes the system to play a sound. 
65         * Interface Version:
66         *                       1
67         * Implementation Required:
68         *                       yes
69         * Parameters:
70         *                       pThis           -       Pointer to the interface structure itself
71         *                       nType           -       The sound type.
72         *                                                       0 - Error
73         *                                                       1 - Warning
74         *                                                       2 - Question
75         *                                                       3 - Status
76         *                                                       4 - Default (default value)
77         * Return Value:
78         *                       None
79         */
80         void (*app_beep)(struct _IPDF_JsPlatform* pThis,  int nType);
81
82         /** 
83         * Method: app_response
84         *                       Displays a dialog box containing a question and an entry field for the user to reply to the question.
85         * Interface Version:
86         *                       1
87         * Implementation Required:
88         *                       yes
89         * Parameters:
90         *                       pThis           -       Pointer to the interface structure itself
91         *                       Question        -       The question to be posed to the user.
92         *                       Title           -       The title of the dialog box.
93         *                       Default         -       A default value for the answer to the question. If not specified, no default value is presented.
94         *                       cLabel          -       A short string to appear in front of and on the same line as the edit text field.
95         *                       bPassword       -       If true, indicates that the user's response should show as asterisks (*) or bullets (?) to mask the response, which might be sensitive information. The default is false.
96         *                       response        -       A string buffer allocated by SDK, to receive the user's response.
97         *                       length          -   The length of the buffer, number of bytes. Currently, It's always be 2048.
98         * Return Value:
99         *               Number of bytes the complete user input would actually require, not including trailing zeros, regardless of the value of the length
100         *               parameter or the presence of the response buffer.
101         * Comments:
102         *               No matter on what platform, the response buffer should be always written using UTF-16LE encoding. If a response buffer is
103         *               present and the size of the user input exceeds the capacity of the buffer as specified by the length parameter, only the
104         *               first "length" bytes of the user input are to be written to the buffer.
105         */
106         int (*app_response)(struct _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Question, FPDF_WIDESTRING Title, FPDF_WIDESTRING Default, FPDF_WIDESTRING cLabel, FPDF_BOOL bPassword, void* response, int length);
107
108         /*
109         * Method: Doc_getFilePath
110         *                       Get the file path of the current document. 
111         * Interface Version:
112         *                       1
113         * Implementation Required:
114         *                       yes
115         * Parameters:
116         *                       pThis           -       Pointer to the interface structure itself
117         *                       filePath        -       The string buffer to receive the file path. Can be NULL.
118         *                       length          -   The length of the buffer, number of bytes. Can be 0.
119         * Return Value:
120         *               Number of bytes the filePath consumes, including trailing zeros.
121         * Comments:
122         *               The filePath should be always input in local encoding.
123         *
124         *               The return value always indicated number of bytes required for the buffer, even when there is
125         *               no buffer specified, or the buffer size is less then required. In this case, the buffer will not
126         *               be modified.
127         */
128         int (*Doc_getFilePath)(struct _IPDF_JsPlatform* pThis, void* filePath, int length);
129         
130         
131         /*
132         * Method: Doc_mail
133         *                       Mails the data buffer as an attachment to all recipients, with or without user interaction. 
134         * Interface Version:
135         *                       1
136         * Implementation Required:
137         *                       yes
138         * Parameters:
139         *                       pThis           -       Pointer to the interface structure itself
140         *                       mailData        -       Pointer to the data buffer to be sent.Can be NULL.
141         *                       length          -       The size,in bytes, of the buffer pointed by mailData parameter.Can be 0.
142         *                       bUI                     -   If true, the rest of the parameters are used in a compose-new-message window that is displayed to the user. If false, the cTo parameter is required and all others are optional.
143         *                       To                      -       A semicolon-delimited list of recipients for the message.
144         *                       Subject         -   The subject of the message. The length limit is 64 KB.
145         *                       CC                      -       A semicolon-delimited list of CC recipients for the message. 
146         *                       BCC                     -   A semicolon-delimited list of BCC recipients for the message. 
147         *                       Msg                     -   The content of the message. The length limit is 64 KB.
148         * Return Value:
149         *                       None.
150         * Comments:
151         *                       If the parameter mailData is NULL or length is 0, the current document will be mailed as an attachment to all recipients.
152         */
153         void (*Doc_mail)(struct _IPDF_JsPlatform* pThis,void* mailData, int length,FPDF_BOOL bUI, FPDF_WIDESTRING To, FPDF_WIDESTRING Subject, FPDF_WIDESTRING CC, FPDF_WIDESTRING BCC, FPDF_WIDESTRING Msg); 
154         
155
156         /*
157         * Method: Doc_print
158         *                       Prints all or a specific number of pages of the document.
159         * Interface Version:
160         *                       1
161         * Implementation Required:
162         *                       yes
163         * Parameters:
164         *                       pThis           -       Pointer to the interface structure itself.
165         *                       bUI                     -       If true, will cause a UI to be presented to the user to obtain printing information and confirm the action.
166         *                       nStart          -       A 0-based index that defines the start of an inclusive range of pages.
167         *                       nEnd            -   A 0-based index that defines the end of an inclusive page range.
168         *                       bSilent         -   If true, suppresses the cancel dialog box while the document is printing. The default is false.
169         *                       bShrinkToFit    -       If true, the page is shrunk (if necessary) to fit within the imageable area of the printed page.
170         *                       bPrintAsImage   -       If true, print pages as an image.
171         *                       bReverse        -       If true, print from nEnd to nStart.
172         *                       bAnnotations    -       If true (the default), annotations are printed.
173         */
174         void (*Doc_print)(struct _IPDF_JsPlatform* pThis, FPDF_BOOL bUI, int nStart, int nEnd, FPDF_BOOL bSilent ,FPDF_BOOL bShrinkToFit,FPDF_BOOL bPrintAsImage ,FPDF_BOOL bReverse ,FPDF_BOOL bAnnotations);
175
176         /*
177         * Method: Doc_submitForm
178         *                       Send the form data to a specified URL.
179         * Interface Version:
180         *                       1
181         * Implementation Required:
182         *                       yes
183         * Parameters:
184         *                       pThis           -       Pointer to the interface structure itself
185         *                       formData        -       Pointer to the data buffer to be sent.
186         *                       length          -       The size,in bytes, of the buffer pointed by formData parameter.
187         *                       URL                     -       The URL to send to.
188         * Return Value:
189         *                       None.
190         *
191         */
192         void (*Doc_submitForm)(struct _IPDF_JsPlatform* pThis,void* formData, int length, FPDF_WIDESTRING URL);
193         
194         /*
195         * Method: Doc_gotoPage
196         *                       Jump to a specified page.
197         * Interface Version:
198         *                       1
199         * Implementation Required:
200         *                       yes
201         * Parameters:
202         *                       pThis           -       Pointer to the interface structure itself
203         *                       nPageNum        -       The specified page number, zero for the first page.
204         * Return Value:
205         *                       None.
206         *
207         */
208         void (*Doc_gotoPage)(struct _IPDF_JsPlatform* pThis, int nPageNum);
209         /*
210         * Method: Field_browse
211         *                       Show a file selection dialog, and return the selected file path.
212         * Interface Version:
213         *                       1
214         * Implementation Required:
215         *                       yes
216         * Parameters:
217         *                       pThis           -       Pointer to the interface structure itself.
218         *                       filePath        -       Pointer to the data buffer to receive the file path.Can be NULL.
219         *                       length          -   The length of the buffer, number of bytes. Can be 0.
220         * Return Value:
221         *               Number of bytes the filePath consumes, including trailing zeros.
222         * Comments:
223         *               The filePath shoule be always input in local encoding.
224         */
225         int  (*Field_browse)(struct _IPDF_JsPlatform* pThis, void* filePath, int length);
226
227         /**
228         *       pointer to FPDF_FORMFILLINFO interface.
229         **/
230         void*   m_pFormfillinfo;
231 } IPDF_JSPLATFORM;
232
233 // Flags for Cursor type
234 #define FXCT_ARROW      0
235 #define FXCT_NESW       1               
236 #define FXCT_NWSE       2               
237 #define FXCT_VBEAM      3               
238 #define FXCT_HBEAM      4       
239 #define FXCT_HAND       5
240
241 /**
242  * Declares of a pointer type to the callback function for the FFI_SetTimer method.
243  * Parameters:
244  *                      idEvent         -       Identifier of the timer. 
245  * Return value:
246  *                      None. 
247  **/    
248 typedef void    (*TimerCallback)(int idEvent);
249
250 /**
251  * Declares of a struct type to the local system time.
252 **/
253 typedef struct _FPDF_SYSTEMTIME 
254 {
255     unsigned short wYear;                       /* years since 1900 */
256     unsigned short wMonth;                      /* months since January - [0,11] */
257     unsigned short wDayOfWeek;          /* days since Sunday - [0,6] */
258     unsigned short wDay;                        /* day of the month - [1,31] */
259     unsigned short wHour;                       /* hours since midnight - [0,23] */
260     unsigned short wMinute;                     /* minutes after the hour - [0,59] */
261     unsigned short wSecond;                     /* seconds after the minute - [0,59] */
262     unsigned short wMilliseconds;       /* milliseconds after the second - [0,999] */
263 }FPDF_SYSTEMTIME;
264
265 //XFA
266 /**
267  * @name Pageview  event flags
268  */
269 /*@{*/
270 /** @brief After a new pageview is added. */
271 #define  FXFA_PAGEVIEWEVENT_POSTADDED           1
272 /** @brief After a pageview is removed. */
273 #define  FXFA_PAGEVIEWEVENT_POSTREMOVED         3
274 /*@}*/
275
276 // menu
277 /**
278  * @name Macro Definitions for Right Context Menu Features Of XFA Fields
279  */
280 /*@{*/
281 #define  FXFA_MEMU_COPY                 1
282 #define  FXFA_MEMU_CUT                  2
283 #define  FXFA_MEMU_SELECTALL    4
284 #define  FXFA_MEMU_UNDO                 8
285 #define  FXFA_MEMU_REDO                 16
286 #define  FXFA_MEMU_PASTE                32
287 /*@}*/
288
289 // file type
290 /**
291  * @name Macro Definitions for File Type.
292  */
293 /*@{*/
294 #define FXFA_SAVEAS_XML         1
295 #define FXFA_SAVEAS_XDP         2
296 /*@}*/
297
298 typedef struct  _FPDF_FORMFILLINFO
299 {
300         /**
301          * Version number of the interface. Currently must be 2 (with XFA module).
302          **/
303         int     version;
304
305                 /** 
306          * Method: Release
307          *                      Give implementation a chance to release any data after the interface is no longer used
308          * Interface Version:
309          *                      1
310          * Implementation Required:
311          *                      No
312          * Comments:
313          *                      Called by Foxit SDK during the final cleanup process.
314          * Parameters:
315          *                      pThis           -       Pointer to the interface structure itself
316          * Return Value:
317          *                      None
318          */
319
320         void (*Release)(struct _FPDF_FORMFILLINFO* pThis);
321
322         /** 
323          * Method: FFI_Invalidate
324          *                      Invalidate the client area within the specified rectangle.
325          * Interface Version:
326          *                      1
327          * Implementation Required:
328                 *                       yes
329          * Parameters:
330          *                      pThis           -       Pointer to the interface structure itself.
331          *                      page            -       Handle to the page. Returned by FPDF_LoadPage function.
332          *                      left            -       Left position of the client area in PDF page coordinate.
333          *                      top                     -       Top  position of the client area in PDF page coordinate.
334          *                      right           -       Right position of the client area in PDF page  coordinate.
335          *                      bottom          -       Bottom position of the client area in PDF page coordinate.
336          * Return Value:
337          *                      None.
338          *
339          *comments:
340          *                      All positions are measured in PDF "user space".
341          *                      Implementation should call FPDF_RenderPageBitmap() function for repainting a specified page area.
342         */
343         void (*FFI_Invalidate)(struct _FPDF_FORMFILLINFO* pThis,FPDF_PAGE page, double left, double top, double right, double bottom);
344         
345         /** 
346          * Method: FFI_OutputSelectedRect
347          *                      When user is taking the mouse to select texts on a form field, this callback function will keep 
348          *                      returning the selected areas to the implementation.
349          *
350          * Interface Version:
351          *                      1
352          * Implementation Required:
353          *                      No
354          * Parameters:
355          *                      pThis           -       Pointer to the interface structure itself.
356          *                      page            -       Handle to the page. Returned by FPDF_LoadPage function.
357          *                      left            -       Left position of the client area in PDF page coordinate.
358          *                      top                     -       Top  position of the client area in PDF page coordinate.
359          *                      right           -       Right position of the client area in PDF page  coordinate.
360          *                      bottom          -       Bottom position of the client area in PDF page coordinate.
361          * Return Value:
362          *                      None.
363          *
364          * comments:
365          *                      This CALLBACK function is useful for implementing special text selection effect. Implementation should
366          *                      first records the returned rectangles, then draw them one by one at the painting period, last,remove all 
367          *                      the recorded rectangles when finish painting.
368         */
369         void (*FFI_OutputSelectedRect)(struct _FPDF_FORMFILLINFO* pThis,FPDF_PAGE page, double left, double top, double right, double bottom);
370
371         /** 
372         * Method: FFI_SetCursor
373         *                       Set the Cursor shape.
374         * Interface Version:
375         *                       1
376         * Implementation Required:
377         *                       yes
378         * Parameters:
379         *               pThis           -       Pointer to the interface structure itself.
380         *               nCursorType     -       Cursor type. see Flags for Cursor type for the details.
381         *       Return value:
382         *               None.
383         * */
384         void (*FFI_SetCursor)(struct _FPDF_FORMFILLINFO* pThis, int nCursorType);
385
386         /** 
387         * Method: FFI_SetTimer
388         *                       This method installs a system timer. A time-out value is specified, 
389         *                       and every time a time-out occurs, the system passes a message to
390         *                       the TimerProc callback function. 
391         * Interface Version:
392         *                       1
393         * Implementation Required:
394         *                       yes
395         * Parameters:
396         *               pThis           -       Pointer to the interface structure itself.
397         *               uElapse         -       Specifies the time-out value, in milliseconds.
398         *               lpTimerFunc     -       A pointer to the callback function-TimerCallback.
399         *       Return value:
400         *               The timer identifier of the new timer if the function is successful.
401         *               An application passes this value to the FFI_KillTimer method to kill 
402         *               the timer. Nonzero if it is successful; otherwise, it is zero.
403         * */
404         int  (*FFI_SetTimer)(struct _FPDF_FORMFILLINFO* pThis, int uElapse, TimerCallback lpTimerFunc);
405
406         /** 
407         * Method: FFI_KillTimer
408         *                       This method kills the timer event identified by nIDEvent, set by an earlier call to FFI_SetTimer. 
409         * Interface Version:
410         *                       1
411         * Implementation Required:
412         *                       yes
413         * Parameters:
414         *               pThis           -       Pointer to the interface structure itself.
415         *               nTimerID        -       The timer ID return by FFI_SetTimer function.
416         *       Return value:
417         *               None.
418         * */
419         void (*FFI_KillTimer)(struct _FPDF_FORMFILLINFO* pThis, int nTimerID);
420
421
422         /** 
423         * Method: FFI_GetLocalTime
424         *                       This method receives the current local time on the system. 
425         * Interface Version:
426         *                       1
427         * Implementation Required:
428         *                       yes
429         * Parameters:
430         *               pThis           -       Pointer to the interface structure itself.
431         *       Return value:
432         *               None.
433         * */
434         FPDF_SYSTEMTIME (*FFI_GetLocalTime)(struct _FPDF_FORMFILLINFO* pThis);
435
436         /** 
437         * Method: FFI_OnChange
438         *                       This method will be invoked to notify implementation when the value of any FormField on the document had been changed.
439         * Interface Version:
440         *                       1
441         * Implementation Required:
442         *                       no
443         * Parameters:
444         *               pThis           -       Pointer to the interface structure itself.
445         *       Return value:
446         *               None.
447         * */
448         void (*FFI_OnChange)(struct _FPDF_FORMFILLINFO* pThis);
449
450         /** 
451         * Method: FFI_GetPage
452         *                       This method receives the page pointer associated with a specified page index.
453         * Interface Version:
454         *                       1
455         * Implementation Required:
456         *                       yes
457         * Parameters:
458         *               pThis           -       Pointer to the interface structure itself.
459         *               document        -       Handle to document. Returned by FPDF_LoadDocument function.
460         *               nPageIndex  -   Index number of the page. 0 for the first page.
461         * Return value:
462         *               Handle to the page. Returned by FPDF_LoadPage function.
463         * Comments:
464         *               In some cases, the document-level JavaScript action may refer to a page which hadn't been loaded yet.
465         *               To successfully run the javascript action, implementation need to load the page for SDK.
466         * */
467         FPDF_PAGE       (*FFI_GetPage)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document, int nPageIndex);
468
469         /** 
470         * Method: FFI_GetCurrentPage
471         *               This method receives the current page pointer.
472         * Interface Version:
473         *                       1
474         * Implementation Required:
475         *                       yes
476         * Parameters:
477         *               pThis           -       Pointer to the interface structure itself.
478         *               document        -       Handle to document. Returned by FPDF_LoadDocument function.
479         * Return value:
480         *               Handle to the page. Returned by FPDF_LoadPage function.
481         * */
482         FPDF_PAGE       (*FFI_GetCurrentPage)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document);
483
484         /** 
485         * Method: FFI_GetRotation
486         *                       This method receives currently rotation of the page view.
487         * Interface Version:
488         *                       1
489         * Implementation Required:
490         *                       yes
491         * Parameters:
492         *               pThis           -       Pointer to the interface structure itself.
493         *               page            -       Handle to page. Returned by FPDF_LoadPage function.
494         * Return value:
495         *               The page rotation. Should be 0(0 degree),1(90 degree),2(180 degree),3(270 degree), in a clockwise direction.
496         * */
497         int     (*FFI_GetRotation)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page);
498
499         /** 
500         * Method: FFI_ExecuteNamedAction
501         *                       This method will execute an named action.
502         * Interface Version:
503         *                       1
504         * Implementation Required:
505         *                       yes
506         * Parameters:
507         *               pThis                   -       Pointer to the interface structure itself.
508         *               namedAction             -       A byte string which indicates the named action, terminated by 0.
509         * Return value:
510         *               None.
511         * Comments:
512         *               See the named actions description of <<PDF Reference, version 1.7>> for more details.  
513         * */
514         void    (*FFI_ExecuteNamedAction)(struct _FPDF_FORMFILLINFO* pThis, FPDF_BYTESTRING namedAction);
515         /** 
516         * @brief This method will be called when a text field is getting or losing a focus.
517         *
518         * @param[in] pThis              Pointer to the interface structure itself.
519         * @param[in] value              The string value of the form field, in UTF-16LE format.
520         * @param[in] valueLen   The length of the string value, number of characters (not bytes).
521         * @param[in] is_focus   True if the form field is getting a focus, False for losing a focus.
522         *
523         * @return None.
524         *
525         * @note Currently,only support text field and combobox field.
526         * */
527         void    (*FFI_SetTextFieldFocus)(struct _FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRING value, FPDF_DWORD valueLen, FPDF_BOOL is_focus);
528
529         
530         /** 
531         * Method: FFI_DoURIAction
532         *                       This action resolves to a uniform resource identifier. 
533         * Interface Version:
534         *                       1
535         * Implementation Required:
536         *                       No
537         * Parameters:
538         *               pThis                   -       Pointer to the interface structure itself.
539         *               bsURI                   -       A byte string which indicates the uniform resource identifier, terminated by 0.
540         * Return value:
541         *               None.
542         * Comments:
543         *               See the URI actions description of <<PDF Reference, version 1.7>> for more details.  
544         * */
545         void    (*FFI_DoURIAction)(struct _FPDF_FORMFILLINFO* pThis, FPDF_BYTESTRING bsURI);
546         
547         /** 
548         * Method: FFI_DoGoToAction
549         *                       This action changes the view to a specified destination.
550         * Interface Version:
551         *                       1
552         * Implementation Required:
553         *                       No
554         * Parameters:
555         *               pThis                   -       Pointer to the interface structure itself.
556         *               nPageIndex              -       The index of the PDF page.
557         *               zoomMode                -       The zoom mode for viewing page.See Macros "PDFZOOM_XXX" defined in "fpdfdoc.h". 
558         *               fPosArray               -       The float array which carries the position info.
559         *               sizeofArray             -       The size of float array.
560         * Return value:
561         *               None.
562         * Comments:
563         *               See the Destinations description of <<PDF Reference, version 1.7>> in 8.2.1 for more details.  
564         **/
565         void    (*FFI_DoGoToAction)(struct _FPDF_FORMFILLINFO* pThis, int nPageIndex, int zoomMode, float* fPosArray, int sizeofArray);
566
567   /**
568   *   pointer to IPDF_JSPLATFORM interface
569   **/
570   IPDF_JSPLATFORM*      m_pJsPlatform;
571
572   /**
573         * Method: FFI_DisplayCaret
574         *                       This method will show the caret at specified position.
575         * Interface Version:
576         *                       1
577         * Implementation Required:
578         *                       yes
579         * Parameters:
580         *               pThis                   -       Pointer to the interface structure itself.
581         *               page                    -       Handle to page. Returned by FPDF_LoadPage function.
582         *               left                    -       Left position of the client area in PDF page coordinate. 
583         *               top                             -       Top position of the client area in PDF page coordinate.
584         *               right                   -       Right position of the client area in PDF page coordinate.
585         *               bottom                  -       Bottom position of the client area in PDF page coordinate.
586         * Return value:
587         *               None.
588         **/
589         void    (*FFI_DisplayCaret)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page, FPDF_BOOL bVisible, double left, double top, double right, double bottom);
590         /** 
591         * Method: FFI_GetCurrentPageIndex
592         *                       This method will get the current page index.
593         * Interface Version:
594         *                       1
595         * Implementation Required:
596         *                       yes
597         * Parameters:
598         *               pThis                   -       Pointer to the interface structure itself.
599         *               document                -       Handle to document. Returned by FPDF_LoadDocument function.
600         * Return value:
601         *               The index of current page.
602         **/
603         int             (*FFI_GetCurrentPageIndex)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document);
604         /** 
605         * Method: FFI_SetCurrentPage
606         *                       This method will set the current page.
607         * Interface Version:
608         *                       1
609         * Implementation Required:
610         *                       yes
611         * Parameters:
612         *               pThis                   -       Pointer to the interface structure itself.
613         *               document                -       Handle to document. Returned by FPDF_LoadDocument function.
614         *               iCurPage                -       The index of the PDF page.
615         * Return value:
616         *               None.
617         **/
618         void    (*FFI_SetCurrentPage)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document, int iCurPage);
619         /** 
620         * Method: FFI_GotoURL
621         *                       This method will link to the specified URL.
622         * Interface Version:
623         *                       1
624         * Implementation Required:
625         *                       no
626         * Parameters:
627         *               pThis                   -       Pointer to the interface structure itself.
628         *               document                -       Handle to document. Returned by FPDF_LoadDocument function.
629         *               wsURL                   -       The string value of the URL, in UTF-16LE format.
630         * Return value:
631         *               None.
632         **/
633         void    (*FFI_GotoURL)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document, FPDF_WIDESTRING wsURL);
634         /** 
635         * Method: FFI_GetPageViewRect
636         *                       This method will get the current page view rectangle.
637         * Interface Version:
638         *                       1
639         * Implementation Required:
640         *                       yes
641         * Parameters:
642         *               pThis                   -       Pointer to the interface structure itself.
643         *               page                    -       Handle to page. Returned by FPDF_LoadPage function.
644         *               left                    -       The pointer to receive left position of the page view area in PDF page coordinate. 
645         *               top                             -       The pointer to receive top position of the page view area in PDF page coordinate.
646         *               right                   -       The pointer to receive right position of the client area in PDF page coordinate.
647         *               bottom                  -       The pointer to receive bottom position of the client area in PDF page coordinate.
648         * Return value:
649         *               None.
650         **/
651         void    (*FFI_GetPageViewRect)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page, double* left, double* top, double* right, double* bottom);
652         /** 
653         * Method: FFI_PopupMenu
654         *                       This method will track the right context menu for XFA fields.
655         * Interface Version:
656         *                       1
657         * Implementation Required:
658         *                       yes
659         * Parameters:
660         *               pThis                   -       Pointer to the interface structure itself.
661         *               page                    -       Handle to page. Returned by FPDF_LoadPage function.
662         *               hWidget                 -       Handle to XFA fields.
663         *               menuFlag                -       The menu flags. Please refer to macro definition of FXFA_MEMU_XXX and this can be one or a combination of these macros.
664         *               x                               -       X position of the client area in PDF page coordinate.
665         *               y                               -       Y position of the client area in PDF page coordinate.
666         * Return value:
667         *               TRUE indicates success; otherwise false.
668         **/
669         FPDF_BOOL (*FFI_PopupMenu)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page, FPDF_WIDGET hWidget, int menuFlag, float x, float y);
670         /** 
671         * Method: FFI_OpenFile
672         *                       This method will open the specified file with the specified mode.
673         * Interface Version
674         *                       1
675         * Implementation Required:
676         *                       yes
677         * Parameters:
678         *               pThis                   -       Pointer to the interface structure itself.
679         *               fileFlag                -       The file flag.Please refer to macro definition of FXFA_SAVEAS_XXX and this can be one of these macros.
680         *               wsURL                   -       The string value of the file URL, in UTF-16LE format.
681         *               mode                    -       The mode for open file.
682         * Return value:
683         *               The handle to FPDF_FILEHANDLER.
684         **/
685         FPDF_FILEHANDLER* (*FFI_OpenFile)(struct _FPDF_FORMFILLINFO* pThis, int fileFlag, FPDF_WIDESTRING wsURL, const char* mode);
686         /** 
687         * Method: FFI_EmailTo
688         *                       This method will email the specified file stream to the specified contacter.
689         * Interface Version:
690         *                       1
691         * Implementation Required:
692         *                       yes
693         * Parameters:
694         *               pThis                   -       Pointer to the interface structure itself.
695         *               pFileHandler    -       Handle to the FPDF_FILEHANDLER.
696         *               pTo                             -       A semicolon-delimited list of recipients for the message,in UTF-16LE format.
697         *               pSubject                -   The subject of the message,in UTF-16LE format. 
698         *               pCC                             -       A semicolon-delimited list of CC recipients for the message,in UTF-16LE format.
699         *               pBcc                    -       A semicolon-delimited list of BCC recipients for the message,in UTF-16LE format. 
700         *               pMsg                    -       Pointer to the data buffer to be sent.Can be NULL,in UTF-16LE format.
701         * Return value:
702         *               None.
703         **/
704         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);
705         /** 
706         * Method: FFI_UploadTo
707         *                       This method will get upload the specified file stream to the specified URL.
708         * Interface Version:
709         *                       1
710         * Implementation Required: 
711         *                       yes
712         * Parameters:
713         *               pThis                   -       Pointer to the interface structure itself.
714         *               pFileHandler    -       Handle to the FPDF_FILEHANDLER.
715         *               fileFlag                -       The file flag.Please refer to macro definition of FXFA_SAVEAS_XXX and this can be one of these macros.
716         *               uploadTo                -       Pointer to the URL path, in UTF-16LE format.
717         * Return value:
718         *               None.
719         **/
720         void    (*FFI_UploadTo)(struct _FPDF_FORMFILLINFO* pThis, FPDF_FILEHANDLER* fileHandler, int fileFlag, FPDF_WIDESTRING uploadTo);
721         
722         /** 
723         * Method: FFI_GetPlatform
724         *                       This method will get the current platform.
725         * Interface Version:
726         *                       1
727         * Implementation Required: 
728         *                       yes
729         * Parameters:
730         *               pThis                   -       Pointer to the interface structure itself.
731         *               platform                -       Pointer to the data buffer to receive the platform.Can be NULL,in UTF-16LE format.
732         *               length                  -   The length of the buffer, number of bytes. Can be 0.
733         * Return value:
734         *               The length of the buffer, number of bytes.
735         **/
736         int             (*FFI_GetPlatform)(struct _FPDF_FORMFILLINFO* pThis, void* platform, int length);
737         /** 
738         * Method: FFI_GetLanguage
739         *                       This method will get the current language.
740         * Interface Version:
741         *                       1
742         * Implementation Required: 
743         *                       yes
744         * Parameters:
745         *               pThis                   -       Pointer to the interface structure itself.
746         *               language                -       Pointer to the data buffer to receive the current language.Can be NULL.
747         *               length                  -   The length of the buffer, number of bytes. Can be 0.
748         * Return value:
749         *               The length of the buffer, number of bytes.
750         **/
751         int             (*FFI_GetLanguage)(struct _FPDF_FORMFILLINFO* pThis, void* language, int length);
752         /** 
753         * Method: FFI_DownloadFromURL
754         *                       This method will download the specified file from the URL.
755         * Interface Version:
756         *                       1
757         * Implementation Required: 
758         *                       yes
759         * Parameters:
760         *               pThis                   -       Pointer to the interface structure itself.
761         *               URL                             -       The string value of the file URL, in UTF-16LE format.
762         * Return value:
763         *               The handle to FPDF_FILEHANDLER.
764         **/
765         FPDF_LPFILEHANDLER      (*FFI_DownloadFromURL)(struct _FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRING URL);
766         /** 
767         * Method: FFI_PostRequestURL
768         *                       This method will post the request to the server URL.
769         * Interface Version:
770         *                       1
771         * Implementation Required: 
772         *                       yes
773         * Parameters:
774         *               pThis                   -       Pointer to the interface structure itself.
775         *               wsURL                   -       The string value of the server URL, in UTF-16LE format.
776         *               wsData                  -       The post data,in UTF-16LE format.
777         *               wsContentType   -       The content type of the request data,in UTF-16LE format.
778         *               wsEncode                -       The encode type,in UTF-16LE format.
779         *               wsHeader                -       The request header,in UTF-16LE format.
780         *               response                -       Pointer to the FPDF_BSTR to receive the response data from server,,in UTF-16LE format.
781         * Return value:
782         *               TRUE indicates success, otherwise FALSE.
783         **/
784         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);
785         /** 
786         * Method: FFI_PutRequestURL
787         *                       This method will put the request to the server URL.
788         * Interface Version:
789         *                       1
790         * Implementation Required: 
791         *                       yes
792         * Parameters:
793         *               pThis                   -       Pointer to the interface structure itself.
794         *               wsURL                   -       The string value of the server URL, in UTF-16LE format.
795         *               wsData                  -       The put data, in UTF-16LE format.
796         *               wsEncode                -       The encode type, in UTR-16LE format.
797         * Return value:
798         *               TRUE indicates success, otherwise FALSE.
799         **/
800         FPDF_BOOL       (*FFI_PutRequestURL)(struct _FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRING wsURL, FPDF_WIDESTRING wsData, FPDF_WIDESTRING wsEncode);
801
802 } FPDF_FORMFILLINFO;
803
804
805
806 /**
807  * Function: FPDFDOC_InitFormFillEnvironment
808  *                      Init form fill environment. 
809  * Comments:
810  *                      This function should be called before any form fill operation.
811  * Parameters:
812  *                      document                -       Handle to document. Returned by FPDF_LoadDocument function.
813  *                      pFormFillInfo   -       Pointer to a FPDF_FORMFILLINFO structure.
814  * Return Value:
815  *                      Return handler to the form fill module. NULL means fails. 
816  **/
817 DLLEXPORT FPDF_FORMHANDLE STDCALL FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, FPDF_FORMFILLINFO* formInfo);
818
819 /**
820  * Function: FPDFDOC_ExitFormFillEnvironment
821  *                      Exit form fill environment. 
822  * Parameters:
823  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
824  * Return Value:
825  *                      NULL.
826  **/
827 DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle);
828
829 /**
830  * Function: FORM_OnAfterLoadPage
831  *                      This method is required for implementing all the form related functions. Should be invoked after user 
832  *                      successfully loaded a PDF page, and method FPDFDOC_InitFormFillEnvironment had been invoked.
833  * Parameters:
834  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
835  * Return Value:
836  *                      NONE.
837  **/
838 DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle);
839
840 /**
841  * Function: FORM_OnBeforeClosePage
842  *                      This method is required for implementing all the form related functions. Should be invoked before user 
843  *                      close the PDF page.
844  * Parameters:
845  *                      page            -       Handle to the page. Returned by FPDF_LoadPage function.
846  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
847  * Return Value:
848  *                      NONE.
849  **/
850 DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle);
851
852 /**
853 * Function: FORM_DoDocumentJSAction
854 *                       This method is required for performing Document-level JavaScript action. It should be invoked after the PDF document
855 *                       had been loaded.
856 * Parameters:
857 *                       hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
858 * Return Value:
859 *                       NONE
860 * Comments:
861 *                       If there is Document-level JavaScript action embedded in the document, this method will execute the javascript action;
862 *                       otherwise, the method will do nothing.
863 **/
864 DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle);
865
866
867 /**
868 * Function: FORM_DoDocumentOpenAction
869 *                       This method is required for performing open-action when the document is opened.
870 * Parameters:
871 *                       hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
872 * Return Value:
873 *                       NONE
874 * Comments:
875 *                       This method will do nothing if there is no open-actions embedded in the document. 
876 **/
877 DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle);
878
879
880 // additional actions type of document.
881 #define FPDFDOC_AACTION_WC              0x10            //WC, before closing document, JavaScript action.
882 #define FPDFDOC_AACTION_WS              0x11            //WS, before saving document, JavaScript action.
883 #define FPDFDOC_AACTION_DS              0x12            //DS, after saving document, JavaScript action.
884 #define FPDFDOC_AACTION_WP              0x13            //WP, before printing document, JavaScript action.
885 #define FPDFDOC_AACTION_DP              0x14            //DP, after printing document, JavaScript action. 
886 /**
887 * Function: FORM_DoDocumentAAction
888 *                       This method is required for performing the document's additional-action.
889 * Parameters:
890 *                       hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
891 *                       aaType      -   The type of the additional-actions which defined above.
892 * Return Value:
893 *                       NONE
894 * Comments:
895 *                       This method will do nothing if there is no document additional-action corresponding to the specified aaType.
896 **/
897
898 DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, int aaType);
899
900 // Additional-action types of page object
901 #define FPDFPAGE_AACTION_OPEN           0               // /O -- An action to be performed when the page is opened
902 #define FPDFPAGE_AACTION_CLOSE          1               // /C -- An action to be performed when the page is closed
903
904 /**
905 * Function: FORM_DoPageAAction
906 *                       This method is required for performing the page object's additional-action when opened or closed.
907 * Parameters:
908 *                       page            -       Handle to the page. Returned by FPDF_LoadPage function.
909 *                       hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
910 *                       aaType      -   The type of the page object's additional-actions which defined above.
911 * Return Value:
912 *                       NONE
913 * Comments:
914 *                       This method will do nothing if no additional-action corresponding to the specified aaType exists.
915 **/
916 DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandle, int aaType);
917
918 /**
919  * Function: FORM_OnMouseMove
920  *                      You can call this member function when the mouse cursor moves. 
921  * Parameters:
922  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
923  *                      page            -       Handle to the page. Returned by FPDF_LoadPage function.
924  *                      modifier                -       Indicates whether various virtual keys are down. 
925  *                      page_x          -       Specifies the x-coordinate of the cursor in PDF user space. 
926  *                      page_y          -       Specifies the y-coordinate of the cursor in PDF user space.
927  * Return Value:
928  *                      TRUE indicates success; otherwise false.
929  **/
930 DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
931
932 /**
933  * Function: FORM_OnLButtonDown
934  *                      You can call this member function when the user presses the left mouse button.
935  * Parameters:
936  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
937  *                      page            -       Handle to the page. Returned by FPDF_LoadPage function.
938  *                      modifier                -       Indicates whether various virtual keys are down. 
939  *                      page_x          -       Specifies the x-coordinate of the cursor in PDF user space. 
940  *                      page_y          -       Specifies the y-coordinate of the cursor in PDF user space.
941  * Return Value:
942  *                      TRUE indicates success; otherwise false.
943  **/
944 DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
945
946 /**
947  * Function: FORM_OnLButtonUp
948  *                      You can call this member function when the user releases the left mouse button.
949  * Parameters:
950  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
951  *                      page            -       Handle to the page. Returned by FPDF_LoadPage function.
952  *                      modifier        -       Indicates whether various virtual keys are down. 
953  *                      page_x          -       Specifies the x-coordinate of the cursor in device. 
954  *                      page_y          -       Specifies the y-coordinate of the cursor in device.
955  * Return Value:
956  *                      TRUE indicates success; otherwise false.
957  **/
958 DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
959
960 DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y);
961 DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y);
962
963 /**
964  * Function: FORM_OnKeyDown
965  *                      You can call this member function when a nonsystem key is pressed. 
966  * Parameters:
967  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
968  *                      page            -       Handle to the page. Returned by FPDF_LoadPage function.
969  *                      nKeyCode        -       Indicates whether various virtual keys are down. 
970  *                      modifier        -       Contains the scan code, key-transition code, previous key state, and context code.
971  * Return Value:
972  *                      TRUE indicates success; otherwise false.
973  **/
974 DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int nKeyCode, int modifier);
975
976 /**
977  * Function: FORM_OnKeyUp
978  *                      You can call this member function when a nonsystem key is released. 
979  * Parameters:
980  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
981  *                      page            -       Handle to the page. Returned by FPDF_LoadPage function.
982  *                      nKeyCode        -       The virtual-key code of the given key.
983  *                      modifier        -       Contains the scan code, key-transition code, previous key state, and context code.
984  * Return Value:
985  *                      TRUE indicates success; otherwise false.
986  **/
987 DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int nKeyCode, int modifier);
988
989 /**
990  * Function: FORM_OnChar
991  *                      You can call this member function when a keystroke translates to a nonsystem character.
992  * Parameters:
993  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
994  *                      page            -       Handle to the page. Returned by FPDF_LoadPage function.
995  *                      nChar           -       The character code value of the key.  
996  *                      modifier        -       Contains the scan code, key-transition code, previous key state, and context code.
997  * Return Value:
998  *                      TRUE indicates success; otherwise false.
999  **/
1000 DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int nChar, int modifier);
1001
1002 /**
1003  * Function: FORM_ForceToKillFocus.
1004  *                      You can call this member function to force to kill the focus of the form field which got focus.
1005  *                      It would kill the focus on the form field, save the value of form field if it's changed by user.
1006  * Parameters:
1007  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
1008  * Return Value:
1009  *                      TRUE indicates success; otherwise false.
1010  **/
1011 DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle);
1012
1013 // Field Types
1014 #define FPDF_FORMFIELD_UNKNOWN          0               // Unknown.
1015 #define FPDF_FORMFIELD_PUSHBUTTON       1               // push button type.
1016 #define FPDF_FORMFIELD_CHECKBOX         2               // check box type.
1017 #define FPDF_FORMFIELD_RADIOBUTTON      3               // radio button type.
1018 #define FPDF_FORMFIELD_COMBOBOX         4               // combo box type.
1019 #define FPDF_FORMFIELD_LISTBOX          5               // list box type.
1020 #define FPDF_FORMFIELD_TEXTFIELD        6               // text field type.
1021 #define FPDF_FORMFIELD_XFA                      7               // text field type.
1022 /**
1023  * Function: FPDPage_HasFormFieldAtPoint
1024  *                      Check the form filed position by point.
1025  * Parameters:
1026  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
1027  *                      page            -       Handle to the page. Returned by FPDF_LoadPage function.
1028  *                      page_x          -       X position in PDF "user space".
1029  *                      page_y          -       Y position in PDF "user space".
1030  * Return Value:
1031  *                      Return the type of the formfiled; -1 indicates no fields.
1032  **/
1033 DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,FPDF_PAGE page,double page_x, double page_y);
1034
1035 /**
1036  * Function: FPDF_SetFormFieldHighlightColor
1037  *                      Set the highlight color of specified or all the form fields in the document.
1038  * Parameters:
1039  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
1040  *                      doc                     -       Handle to the document. Returned by FPDF_LoadDocument function.
1041  *                      fieldType       -       A 32-bit integer indicating the type of a form field(defined above).
1042  *                      color           -       The highlight color of the form field.Constructed by 0xxxrrggbb.
1043  * Return Value:
1044  *                      NONE.
1045  * Comments:
1046  *                      When the parameter fieldType is set to zero, the highlight color will be applied to all the form fields in the 
1047  *                      document.
1048  *                      Please refresh the client window to show the highlight immediately if necessary.
1049  **/
1050 DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, int fieldType, unsigned long color);
1051
1052 /**
1053  * Function: FPDF_SetFormFieldHighlightAlpha
1054  *                      Set the transparency of the form field highlight color in the document.
1055  * Parameters:
1056  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
1057  *                      doc                     -       Handle to the document. Returned by FPDF_LoadDocument function.
1058  *                      alpha           -       The transparency of the form field highlight color. between 0-255.
1059  * Return Value:
1060  *                      NONE.
1061  **/
1062 DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, unsigned char alpha);
1063
1064
1065 /**
1066  * Function: FPDF_RemoveFormFieldHighlight
1067  *                      Remove the form field highlight color in the document.
1068  * Parameters:
1069  *                      hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
1070  * Return Value:
1071  *                      NONE.
1072  * Comments:
1073  *                      Please refresh the client window to remove the highlight immediately if necessary.
1074  **/
1075 DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle);
1076
1077 /**
1078 * Function: FPDF_FFLDraw
1079 *                       Render FormFeilds on a page to a device independent bitmap.                     
1080 * Parameters:
1081 *                       hHandle         -       Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnvironment.
1082 *                       bitmap          -       Handle to the device independent bitmap (as the output buffer).
1083 *                                                       Bitmap handle can be created by FPDFBitmap_Create function.
1084 *                       page            -       Handle to the page. Returned by FPDF_LoadPage function.
1085 *                       start_x         -       Left pixel position of the display area in the device coordinate.
1086 *                       start_y         -       Top pixel position of the display area in the device coordinate.
1087 *                       size_x          -       Horizontal size (in pixels) for displaying the page.
1088 *                       size_y          -       Vertical size (in pixels) for displaying the page.
1089 *                       rotate          -       Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
1090 *                                                               2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
1091 *                       flags           -       0 for normal display, or combination of flags defined above. 
1092 * Return Value:
1093 *                       None.
1094 * Comments: 
1095 *                       This method is designed to only render annotations and FormFields on the page. 
1096 *                       Without FPDF_ANNOT specified for flags, Rendering functions such as FPDF_RenderPageBitmap or FPDF_RenderPageBitmap_Start will only render page contents(without annotations) to a bitmap.
1097 *                       In order to implement the FormFill functions,Implementation should call this method after rendering functions finish rendering the page contents.
1098 **/
1099 DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle,FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, 
1100                                                 int size_x, int size_y, int rotate, int flags);
1101 /**
1102  * Function: FPDF_HasXFAField
1103  *                      This method is designed to check whether a pdf document has XFA fields.
1104  * Parameters:
1105  *                      document                -       Handle to document. Returned by FPDF_LoadDocument function.
1106  *                      docType                 -       Document type defined as DOCTYPE_xxx.
1107  * Return Value:
1108  *                      TRUE indicates that the input document has XFA fields, otherwise FALSE.
1109  **/
1110 DLLEXPORT FPDF_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document, int& docType);
1111
1112 /**
1113  * Function: FPDF_LoadXFA
1114  *                      If the document consists of XFA fields, there should call this method to load XFA fields.
1115  * Parameters:
1116  *                      document                -       Handle to document. Returned by FPDF_LoadDocument function.
1117  * Return Value:
1118  *                      TRUE indicates success,otherwise FALSE.
1119  **/
1120 DLLEXPORT FPDF_BOOL STDCALL FPDF_LoadXFA(FPDF_DOCUMENT document);
1121
1122 /**
1123  * Function: FPDF_Widget_Undo
1124  *                      This method will implement the undo feature for the specified xfa field.
1125  * Parameters:
1126  *                      document                -       Handle to document. Returned by FPDF_LoadDocument function.
1127  *                      hWidget                 -       Handle to the xfa field.
1128  * Return Value:
1129  *                      None.
1130  **/
1131 DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, FPDF_WIDGET hWidget);
1132 /**
1133  * Function: FPDF_Widget_Redo
1134  *                      This method will implement the redo feature for the specified xfa field.
1135  * Parameters:
1136  *                      document                -       Handle to document. Returned by FPDF_LoadDocument function.
1137  *                      hWidget                 -       Handle to the xfa field.
1138  * Return Value:
1139  *                      None.
1140  **/
1141 DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document, FPDF_WIDGET hWidget);
1142 /**
1143  * Function: FPDF_Widget_SelectAll
1144  *                      This method will implement the select all feature for the specified xfa field.
1145  * Parameters:
1146  *                      document                -       Handle to document. Returned by FPDF_LoadDocument function.
1147  *                      hWidget                 -       Handle to the xfa field.
1148  * Return Value:
1149  *                      None.
1150  **/
1151 DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document, FPDF_WIDGET hWidget);
1152 /**
1153  * Function: FPDF_Widget_Copy
1154  *                      This method will implement the copy feature for the specified xfa field.
1155  * Parameters:
1156  *                      document                -       Handle to document. Returned by FPDF_LoadDocument function.
1157  *                      hWidget                 -       Handle to the xfa field.
1158  *                      wsText                  -       Pointer to data buffer to receive the copied data, in UTF-16LE format.
1159  *                      size                    -       The data buffer size.
1160  * Return Value:
1161  *                      None.
1162  **/
1163 DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, FPDF_WIDESTRING wsText, FPDF_DWORD* size);
1164 /**
1165  * Function: FPDF_Widget_Cut
1166  *                      This method will implement the cut feature for the specified xfa field.
1167  * Parameters:
1168  *                      document                -       Handle to document. Returned by FPDF_LoadDocument function.
1169  *                      hWidget                 -       Handle to the xfa field.
1170  *                      wsText                  -       Pointer to data buffer to receive the cut data,in UTF-16LE format.
1171  *                      size                    -       The data buffer size,not the byte number.
1172  * Return Value:
1173  *                      None.
1174  **/
1175 DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, FPDF_WIDESTRING wsText, FPDF_DWORD* size);
1176 /**
1177  * Function: FPDF_Widget_Paste
1178  *                      This method will implement the paste feature for the specified xfa field.
1179  * Parameters:
1180  *                      document                -       Handle to document. Returned by FPDF_LoadDocument function.
1181  *                      hWidget                 -       Handle to the xfa field.
1182  *                      wsText                  -       The paste text buffer, in UTF-16LE format.
1183  *                      size                    -       The data buffer size,not the byte number.
1184  * Return Value:
1185  *                      None.
1186  **/
1187 DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, FPDF_WIDESTRING wsText, FPDF_DWORD size);
1188 /**
1189  * Function: FPDF_Widget_ReplaceSpellCheckWord
1190  *                      This method will implement the spell check feature for the specified xfa field.
1191  * Parameters:
1192  *                      document                -       Handle to document. Returned by FPDF_LoadDocument function.
1193  *                      hWidget                 -       Handle to the xfa field.
1194  *                      x                               -       The x value of the specified point.
1195  *                      y                               -       The y value of the specified point.
1196  *                      bsText                  -       The text buffer needed to be speck check, in UTF-16LE format.
1197  * Return Value:
1198  *                      None.
1199  **/
1200 DLLEXPORT void STDCALL FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, float x, float y, FPDF_BYTESTRING bsText);
1201 /**
1202  * Function: FPDF_Widget_GetSpellCheckWords
1203  *                      This method will implement the spell check feature for the specified xfa field.
1204  * Parameters:
1205  *                      document                -       Handle to document. Returned by FPDF_LoadDocument function.
1206  *                      hWidget                 -       Handle to the xfa field.
1207  *                      x                               -       The x value of the specified point.
1208  *                      y                               -       The y value of the specified point.
1209  *                      stringHandle    -       Pointer to FPDF_STRINGHANDLE to receive the speck check text buffer, in UTF-16LE format.
1210  * Return Value:
1211  *                      None.
1212  **/
1213 DLLEXPORT void STDCALL FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document, FPDF_WIDGET hWidget, float x, float y, FPDF_STRINGHANDLE* stringHandle);
1214 /**
1215  * Function: FPDF_StringHandleCounts
1216  *                      This method will get the count of the text buffer.
1217  * Parameters:
1218  *                      stringHandle    -       Pointer to FPDF_STRINGHANDLE.
1219  * Return Value:
1220  *                      None.
1221  **/
1222 DLLEXPORT int STDCALL FPDF_StringHandleCounts(FPDF_STRINGHANDLE stringHandle);
1223 /**
1224  * Function: FPDF_StringHandleGetStringByIndex
1225  *                      This method will get the specified index of the text buffer.
1226  * Parameters:
1227  *                      stringHandle    -       Pointer to FPDF_STRINGHANDLE.
1228  *                      index                   -       The specified index of text buffer.
1229  *                      bsText                  -       Pointer to data buffer to receive the text buffer, in UTF-16LE format.
1230  *                      size                    -       The byte size of data buffer.
1231  * Return Value:
1232  *                      TRUE indicates success, otherwise FALSE.
1233  **/
1234 DLLEXPORT FPDF_BOOL STDCALL FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE stringHandle, int index, FPDF_BYTESTRING bsText, FPDF_DWORD* size);
1235 /**
1236  * Function: FPDF_StringHandleRelease
1237  *                      This method will release the FPDF_STRINGHANDLE.
1238  * Parameters:
1239  *                      stringHandle    -       Pointer to FPDF_STRINGHANDLE.
1240  * Return Value:
1241  *                      None.
1242  **/
1243 DLLEXPORT void STDCALL FPDF_StringHandleRelease(FPDF_STRINGHANDLE stringHandle);
1244 /**
1245  * Function: FPDF_StringHandleAddString
1246  *                      This method will add the specified text buffer.
1247  * Parameters:
1248  *                      stringHandle    -       Pointer to FPDF_STRINGHANDLE.
1249  *                      bsText                  -       Pointer to data buffer of the text buffer, in UTF-16LE format.
1250  *                      size                    -       The byte size of data buffer.
1251  * Return Value:
1252  *                      TRUE indicates success, otherwise FALSE.
1253  **/
1254 DLLEXPORT FPDF_BOOL STDCALL FPDF_StringHandleAddString(FPDF_STRINGHANDLE stringHandle, FPDF_BYTESTRING bsText, FPDF_DWORD size);
1255
1256 #ifdef __cplusplus
1257 };
1258 #endif
1259
1260 #endif //_FPDFORMFILL_H
1261