blob: d6fddf19bdba2904989ffac7d4a7404c85374d6a [file] [log] [blame]
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001// 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.
Tom Sepez9857e202015-05-13 17:09:26 -07004
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07005// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
Tom Sepez9857e202015-05-13 17:09:26 -07007#ifndef PUBLIC_FPDF_FORMFILL_H_
8#define PUBLIC_FPDF_FORMFILL_H_
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07009
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070010#include "fpdfview.h"
11
12typedef void* FPDF_FORMHANDLE;
13
Tom Sepezc46d0002015-11-30 15:46:36 -080014#ifdef PDF_ENABLE_XFA
Nico Weber077f1a32015-08-06 15:08:57 -070015#define DOCTYPE_PDF 0 // Normal pdf Document
Tom Sepezd3116dc2015-11-24 15:58:06 -080016#define DOCTYPE_DYNAMIC_XFA 1 // Dynamic xfa Document Type
Nico Weber077f1a32015-08-06 15:08:57 -070017#define DOCTYPE_STATIC_XFA 2 // Static xfa Document Type
Tom Sepezc46d0002015-11-30 15:46:36 -080018#endif // PDF_ENABLE_XFA
Jun Fange118ce92015-02-17 06:50:08 -080019
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070020// Exported Functions
21#ifdef __cplusplus
22extern "C" {
23#endif
24
Nico Weber9d8ec5a2015-08-04 13:00:21 -070025typedef struct _IPDF_JsPlatform {
26 /**
27 * Version number of the interface. Currently must be 2.
28 **/
29 int version;
Bo Xufdc00a72014-10-28 23:03:33 -070030
Nico Weber9d8ec5a2015-08-04 13:00:21 -070031 /* Version 1. */
Jochen Eisinger06b60022015-07-30 17:44:35 +020032
Nico Weber9d8ec5a2015-08-04 13:00:21 -070033 /**
34 * Method: app_alert
35 * pop up a dialog to show warning or hint.
36 * Interface Version:
37 * 1
38 * Implementation Required:
39 * yes
40 * Parameters:
41 * pThis - Pointer to the interface structure itself
42 * Msg - A string containing the message to be displayed.
43 * Title - The title of the dialog.
44 * Type - The stype of button group.
45 * 0-OK(default);
46 * 1-OK,Cancel;
47 * 2-Yes,NO;
48 * 3-Yes, NO, Cancel.
49 * nIcon - The Icon type.
50 * 0-Error(default);
51 * 1-Warning;
52 * 2-Question;
53 * 3-Status.
54 * 4-Asterisk
Nico Weber9d8ec5a2015-08-04 13:00:21 -070055 * Return Value:
56 * The return value could be the folowing type:
57 * 1-OK;
58 * 2-Cancel;
59 * 3-NO;
60 * 4-Yes;
61 */
62 int (*app_alert)(struct _IPDF_JsPlatform* pThis,
63 FPDF_WIDESTRING Msg,
64 FPDF_WIDESTRING Title,
65 int Type,
66 int Icon);
Tom Sepez621d4de2014-07-29 14:01:21 -070067
Nico Weber9d8ec5a2015-08-04 13:00:21 -070068 /**
69 * Method: app_beep
70 * Causes the system to play a sound.
71 * Interface Version:
72 * 1
73 * Implementation Required:
74 * yes
75 * Parameters:
76 * pThis - Pointer to the interface structure itself
77 * nType - The sound type.
78 * 0 - Error
79 * 1 - Warning
80 * 2 - Question
81 * 3 - Status
82 * 4 - Default (default value)
83 * Return Value:
84 * None
85 */
86 void (*app_beep)(struct _IPDF_JsPlatform* pThis, int nType);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070087
Nico Weber9d8ec5a2015-08-04 13:00:21 -070088 /**
89 * Method: app_response
90 * Displays a dialog box containing a question and an entry field for
91 * the user to reply to the question.
92 * Interface Version:
93 * 1
94 * Implementation Required:
95 * yes
96 * Parameters:
97 * pThis - Pointer to the interface structure itself
98 * Question - The question to be posed to the user.
99 * Title - The title of the dialog box.
100 * Default - A default value for the answer to the question. If
101 * not specified, no default value is presented.
102 * cLabel - A short string to appear in front of and on the
103 * same line as the edit text field.
104 * bPassword - If true, indicates that the user's response should
105 * show as asterisks (*) or bullets (?) to mask the response, which might be
106 * sensitive information. The default is false.
107 * response - A string buffer allocated by SDK, to receive the
108 * user's response.
109 * length - The length of the buffer, number of bytes.
110 * Currently, It's always be 2048.
111 * Return Value:
112 * Number of bytes the complete user input would actually require, not
113 * including trailing zeros, regardless of the value of the length
114 * parameter or the presence of the response buffer.
115 * Comments:
116 * No matter on what platform, the response buffer should be always
117 * written using UTF-16LE encoding. If a response buffer is
118 * present and the size of the user input exceeds the capacity of the
119 * buffer as specified by the length parameter, only the
120 * first "length" bytes of the user input are to be written to the
121 * buffer.
122 */
123 int (*app_response)(struct _IPDF_JsPlatform* pThis,
124 FPDF_WIDESTRING Question,
125 FPDF_WIDESTRING Title,
126 FPDF_WIDESTRING Default,
127 FPDF_WIDESTRING cLabel,
128 FPDF_BOOL bPassword,
129 void* response,
130 int length);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700131
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700132 /*
133 * Method: Doc_getFilePath
134 * Get the file path of the current document.
135 * Interface Version:
136 * 1
137 * Implementation Required:
138 * yes
139 * Parameters:
140 * pThis - Pointer to the interface structure itself
141 * filePath - The string buffer to receive the file path. Can be
142 * NULL.
143 * length - The length of the buffer, number of bytes. Can be
144 * 0.
145 * Return Value:
146 * Number of bytes the filePath consumes, including trailing zeros.
147 * Comments:
148 * The filePath should be always input in local encoding.
149 *
150 * The return value always indicated number of bytes required for the
151 * buffer, even when there is
152 * no buffer specified, or the buffer size is less then required. In this
153 * case, the buffer will not
154 * be modified.
155 */
156 int (*Doc_getFilePath)(struct _IPDF_JsPlatform* pThis,
157 void* filePath,
158 int length);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700159
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700160 /*
161 * Method: Doc_mail
162 * Mails the data buffer as an attachment to all recipients, with or
163 * without user interaction.
164 * Interface Version:
165 * 1
166 * Implementation Required:
167 * yes
168 * Parameters:
169 * pThis - Pointer to the interface structure itself
170 * mailData - Pointer to the data buffer to be sent.Can be NULL.
171 * length - The size,in bytes, of the buffer pointed by
172 * mailData parameter.Can be 0.
173 * bUI - If true, the rest of the parameters are used in a
174 * compose-new-message window that is displayed to the user. If false, the cTo
175 * parameter is required and all others are optional.
176 * To - A semicolon-delimited list of recipients for the
177 * message.
178 * Subject - The subject of the message. The length limit is 64
179 * KB.
180 * CC - A semicolon-delimited list of CC recipients for
181 * the message.
182 * BCC - A semicolon-delimited list of BCC recipients for
183 * the message.
184 * Msg - The content of the message. The length limit is 64
185 * KB.
186 * Return Value:
187 * None.
188 * Comments:
189 * If the parameter mailData is NULL or length is 0, the current
190 * document will be mailed as an attachment to all recipients.
191 */
192 void (*Doc_mail)(struct _IPDF_JsPlatform* pThis,
193 void* mailData,
194 int length,
195 FPDF_BOOL bUI,
196 FPDF_WIDESTRING To,
197 FPDF_WIDESTRING Subject,
198 FPDF_WIDESTRING CC,
199 FPDF_WIDESTRING BCC,
200 FPDF_WIDESTRING Msg);
Tom Sepez9857e202015-05-13 17:09:26 -0700201
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700202 /*
203 * Method: Doc_print
204 * Prints all or a specific number of pages of the document.
205 * Interface Version:
206 * 1
207 * Implementation Required:
208 * yes
209 * Parameters:
210 * pThis - Pointer to the interface structure itself.
211 * bUI - If true, will cause a UI to be presented to the
212 * user to obtain printing information and confirm the action.
213 * nStart - A 0-based index that defines the start of an
214 * inclusive range of pages.
215 * nEnd - A 0-based index that defines the end of an
216 * inclusive page range.
217 * bSilent - If true, suppresses the cancel dialog box while
218 * the document is printing. The default is false.
219 * bShrinkToFit - If true, the page is shrunk (if necessary) to
220 * fit within the imageable area of the printed page.
221 * bPrintAsImage - If true, print pages as an image.
222 * bReverse - If true, print from nEnd to nStart.
223 * bAnnotations - If true (the default), annotations are
224 * printed.
225 */
226 void (*Doc_print)(struct _IPDF_JsPlatform* pThis,
227 FPDF_BOOL bUI,
228 int nStart,
229 int nEnd,
230 FPDF_BOOL bSilent,
231 FPDF_BOOL bShrinkToFit,
232 FPDF_BOOL bPrintAsImage,
233 FPDF_BOOL bReverse,
234 FPDF_BOOL bAnnotations);
Tom Sepez9857e202015-05-13 17:09:26 -0700235
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700236 /*
237 * Method: Doc_submitForm
238 * Send the form data to a specified URL.
239 * Interface Version:
240 * 1
241 * Implementation Required:
242 * yes
243 * Parameters:
244 * pThis - Pointer to the interface structure itself
245 * formData - Pointer to the data buffer to be sent.
246 * length - The size,in bytes, of the buffer pointed by
247 * formData parameter.
248 * URL - The URL to send to.
249 * Return Value:
250 * None.
251 *
252 */
253 void (*Doc_submitForm)(struct _IPDF_JsPlatform* pThis,
254 void* formData,
255 int length,
256 FPDF_WIDESTRING URL);
Tom Sepez9857e202015-05-13 17:09:26 -0700257
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700258 /*
259 * Method: Doc_gotoPage
260 * Jump to a specified page.
261 * Interface Version:
262 * 1
263 * Implementation Required:
264 * yes
265 * Parameters:
266 * pThis - Pointer to the interface structure itself
267 * nPageNum - The specified page number, zero for the first
268 * page.
269 * Return Value:
270 * None.
271 *
272 */
273 void (*Doc_gotoPage)(struct _IPDF_JsPlatform* pThis, int nPageNum);
274 /*
275 * Method: Field_browse
276 * Show a file selection dialog, and return the selected file path.
277 * Interface Version:
278 * 1
279 * Implementation Required:
280 * yes
281 * Parameters:
282 * pThis - Pointer to the interface structure itself.
283 * filePath - Pointer to the data buffer to receive the file
284 * path.Can be NULL.
285 * length - The length of the buffer, number of bytes. Can be
286 * 0.
287 * Return Value:
288 * Number of bytes the filePath consumes, including trailing zeros.
289 * Comments:
290 * The filePath shoule be always input in local encoding.
291 */
292 int (*Field_browse)(struct _IPDF_JsPlatform* pThis,
293 void* filePath,
294 int length);
Tom Sepez9857e202015-05-13 17:09:26 -0700295
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700296 /**
297 * pointer to FPDF_FORMFILLINFO interface.
298 **/
299 void* m_pFormfillinfo;
Tom Sepez9857e202015-05-13 17:09:26 -0700300
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700301 /* Version 2. */
Tom Sepez9857e202015-05-13 17:09:26 -0700302
Tom Sepeza72e8e22015-10-07 10:17:53 -0700303 void* m_isolate; /* Unused in v3, retain for compatibility. */
304 unsigned int m_v8EmbedderSlot; /* Unused in v3, retain for compatibility. */
Jochen Eisinger06b60022015-07-30 17:44:35 +0200305
Tom Sepeza72e8e22015-10-07 10:17:53 -0700306 /* Version 3. */
307 /* Version 3 moves m_Isolate and m_v8EmbedderSlot to FPDF_LIBRARY_CONFIG. */
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700308} IPDF_JSPLATFORM;
309
310// Flags for Cursor type
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700311#define FXCT_ARROW 0
312#define FXCT_NESW 1
313#define FXCT_NWSE 2
314#define FXCT_VBEAM 3
315#define FXCT_HBEAM 4
316#define FXCT_HAND 5
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700317
318/**
tsepez8e120292016-08-03 14:03:35 -0700319 * Function signature for the callback function passed to the FFI_SetTimer
320 * method.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700321 * Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -0700322 * idEvent - Identifier of the timer.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700323 * Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700324 * None.
325 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700326typedef void (*TimerCallback)(int idEvent);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700327
328/**
329 * Declares of a struct type to the local system time.
330**/
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700331typedef struct _FPDF_SYSTEMTIME {
332 unsigned short wYear; /* years since 1900 */
333 unsigned short wMonth; /* months since January - [0,11] */
334 unsigned short wDayOfWeek; /* days since Sunday - [0,6] */
335 unsigned short wDay; /* day of the month - [1,31] */
336 unsigned short wHour; /* hours since midnight - [0,23] */
337 unsigned short wMinute; /* minutes after the hour - [0,59] */
338 unsigned short wSecond; /* seconds after the minute - [0,59] */
339 unsigned short wMilliseconds; /* milliseconds after the second - [0,999] */
340} FPDF_SYSTEMTIME;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700341
Tom Sepezc46d0002015-11-30 15:46:36 -0800342#ifdef PDF_ENABLE_XFA
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700343// XFA
Bo Xufdc00a72014-10-28 23:03:33 -0700344/**
345 * @name Pageview event flags
346 */
347/*@{*/
348/** @brief After a new pageview is added. */
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700349#define FXFA_PAGEVIEWEVENT_POSTADDED 1
Bo Xufdc00a72014-10-28 23:03:33 -0700350/** @brief After a pageview is removed. */
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700351#define FXFA_PAGEVIEWEVENT_POSTREMOVED 3
Bo Xufdc00a72014-10-28 23:03:33 -0700352/*@}*/
353
354// menu
355/**
356 * @name Macro Definitions for Right Context Menu Features Of XFA Fields
357 */
358/*@{*/
dsinclairf2662c42016-09-14 06:23:48 -0700359#define FXFA_MENU_COPY 1
360#define FXFA_MENU_CUT 2
361#define FXFA_MENU_SELECTALL 4
362#define FXFA_MENU_UNDO 8
363#define FXFA_MENU_REDO 16
364#define FXFA_MENU_PASTE 32
Bo Xufdc00a72014-10-28 23:03:33 -0700365/*@}*/
366
367// file type
368/**
369 * @name Macro Definitions for File Type.
370 */
371/*@{*/
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700372#define FXFA_SAVEAS_XML 1
373#define FXFA_SAVEAS_XDP 2
Bo Xufdc00a72014-10-28 23:03:33 -0700374/*@}*/
Tom Sepezc46d0002015-11-30 15:46:36 -0800375#endif // PDF_ENABLE_XFA
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700376
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700377typedef struct _FPDF_FORMFILLINFO {
378 /**
Tom Sepezc46d0002015-11-30 15:46:36 -0800379 * Version number of the interface. Currently must be 1 (when PDFium is built
380 * without the XFA module) or must be 2 (when built with the XFA module).
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700381 **/
382 int version;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700383
Tom Sepezc46d0002015-11-30 15:46:36 -0800384 /* Version 1. */
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700385 /**
Tom Sepezc46d0002015-11-30 15:46:36 -0800386 *Method: Release
387 * Give implementation a chance to release any data after the
388 * interface is no longer used
389 *Interface Version:
390 * 1
391 *Implementation Required:
392 * No
393 *Comments:
394 * Called by Foxit SDK during the final cleanup process.
395 *Parameters:
396 * pThis - Pointer to the interface structure itself
397 *Return Value:
398 * None
399 */
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700400 void (*Release)(struct _FPDF_FORMFILLINFO* pThis);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700401
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700402 /**
403 * Method: FFI_Invalidate
404 * Invalidate the client area within the specified rectangle.
405 * Interface Version:
406 * 1
407 * Implementation Required:
408 * yes
409 * Parameters:
410 * pThis - Pointer to the interface structure itself.
411 * page - Handle to the page. Returned by FPDF_LoadPage
412 *function.
413 * left - Left position of the client area in PDF page
414 *coordinate.
415 * top - Top position of the client area in PDF page
416 *coordinate.
417 * right - Right position of the client area in PDF page
418 *coordinate.
419 * bottom - Bottom position of the client area in PDF page
420 *coordinate.
421 * Return Value:
422 * None.
423 *
424 *comments:
425 * All positions are measured in PDF "user space".
426 * Implementation should call FPDF_RenderPageBitmap() function for
427 *repainting a specified page area.
428 */
429 void (*FFI_Invalidate)(struct _FPDF_FORMFILLINFO* pThis,
430 FPDF_PAGE page,
431 double left,
432 double top,
433 double right,
434 double bottom);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700435
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700436 /**
437 * Method: FFI_OutputSelectedRect
438 * When user is taking the mouse to select texts on a form field,
439 * this callback function will keep
440 * returning the selected areas to the implementation.
441 *
442 * Interface Version:
443 * 1
444 * Implementation Required:
445 * No
446 * Parameters:
447 * pThis - Pointer to the interface structure itself.
448 * page - Handle to the page. Returned by FPDF_LoadPage
449 * function.
450 * left - Left position of the client area in PDF page
451 * coordinate.
452 * top - Top position of the client area in PDF page
453 * coordinate.
454 * right - Right position of the client area in PDF page
455 * coordinate.
456 * bottom - Bottom position of the client area in PDF page
457 * coordinate.
458 * Return Value:
459 * None.
460 *
461 * comments:
462 * This CALLBACK function is useful for implementing special text
463 * selection effect. Implementation should
464 * first records the returned rectangles, then draw them one by one
465 * at the painting period, last,remove all
466 * the recorded rectangles when finish painting.
467 */
468 void (*FFI_OutputSelectedRect)(struct _FPDF_FORMFILLINFO* pThis,
469 FPDF_PAGE page,
470 double left,
471 double top,
472 double right,
473 double bottom);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700474
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700475 /**
476 * Method: FFI_SetCursor
477 * Set the Cursor shape.
478 * Interface Version:
479 * 1
480 * Implementation Required:
481 * yes
482 * Parameters:
483 * pThis - Pointer to the interface structure itself.
484 * nCursorType - Cursor type. see Flags for Cursor type for the
485 * details.
486 * Return value:
487 * None.
488 * */
489 void (*FFI_SetCursor)(struct _FPDF_FORMFILLINFO* pThis, int nCursorType);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700490
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700491 /**
492 * Method: FFI_SetTimer
tsepez8e120292016-08-03 14:03:35 -0700493 * This method installs a system timer. An interval value is specified,
494 * and every time that interval elapses, the system must call into the
495 * callback function with the timer ID as returned by this function.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700496 * Interface Version:
tsepez8e120292016-08-03 14:03:35 -0700497 * 1
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700498 * Implementation Required:
tsepez8e120292016-08-03 14:03:35 -0700499 * yes
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700500 * Parameters:
501 * pThis - Pointer to the interface structure itself.
502 * uElapse - Specifies the time-out value, in milliseconds.
503 * lpTimerFunc - A pointer to the callback function-TimerCallback.
tsepez8e120292016-08-03 14:03:35 -0700504 * Return value:
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700505 * The timer identifier of the new timer if the function is successful.
506 * An application passes this value to the FFI_KillTimer method to kill
507 * the timer. Nonzero if it is successful; otherwise, it is zero.
508 * */
509 int (*FFI_SetTimer)(struct _FPDF_FORMFILLINFO* pThis,
510 int uElapse,
511 TimerCallback lpTimerFunc);
Tom Sepez9857e202015-05-13 17:09:26 -0700512
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700513 /**
514 * Method: FFI_KillTimer
tsepez8e120292016-08-03 14:03:35 -0700515 * This method uninstalls a system timer identified by nIDEvent, as
516 * set by an earlier call to FFI_SetTimer.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700517 * Interface Version:
tsepez8e120292016-08-03 14:03:35 -0700518 * 1
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700519 * Implementation Required:
tsepez8e120292016-08-03 14:03:35 -0700520 * yes
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700521 * Parameters:
522 * pThis - Pointer to the interface structure itself.
tsepez8e120292016-08-03 14:03:35 -0700523 * nTimerID - The timer ID returned by FFI_SetTimer function.
524 * Return value:
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700525 * None.
526 * */
527 void (*FFI_KillTimer)(struct _FPDF_FORMFILLINFO* pThis, int nTimerID);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700528
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700529 /**
530 * Method: FFI_GetLocalTime
531 * This method receives the current local time on the system.
532 * Interface Version:
533 * 1
534 * Implementation Required:
535 * yes
536 * Parameters:
537 * pThis - Pointer to the interface structure itself.
538 * Return value:
539 * None.
540 * */
541 FPDF_SYSTEMTIME (*FFI_GetLocalTime)(struct _FPDF_FORMFILLINFO* pThis);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700542
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700543 /**
544 * Method: FFI_OnChange
545 * This method will be invoked to notify implementation when the
546 * value of any FormField on the document had been changed.
547 * Interface Version:
548 * 1
549 * Implementation Required:
550 * no
551 * Parameters:
552 * pThis - Pointer to the interface structure itself.
553 * Return value:
554 * None.
555 * */
556 void (*FFI_OnChange)(struct _FPDF_FORMFILLINFO* pThis);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700557
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700558 /**
559 * Method: FFI_GetPage
560 * This method receives the page pointer associated with a specified
561 * page index.
562 * Interface Version:
563 * 1
564 * Implementation Required:
565 * yes
566 * Parameters:
567 * pThis - Pointer to the interface structure itself.
568 * document - Handle to document. Returned by FPDF_LoadDocument
569 * function.
570 * nPageIndex - Index number of the page. 0 for the first page.
571 * Return value:
572 * Handle to the page. Returned by FPDF_LoadPage function.
573 * Comments:
574 * In some cases, the document-level JavaScript action may refer to a
575 * page which hadn't been loaded yet.
576 * To successfully run the javascript action, implementation need to load
577 * the page for SDK.
578 * */
Dan Sinclair3ebd1212016-03-09 09:59:23 -0500579 FPDF_PAGE (*FFI_GetPage)(struct _FPDF_FORMFILLINFO* pThis,
580 FPDF_DOCUMENT document,
581 int nPageIndex);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700582
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700583 /**
584 * Method: FFI_GetCurrentPage
585 * This method receives the current page pointer.
586 * Interface Version:
587 * 1
588 * Implementation Required:
589 * yes
590 * Parameters:
591 * pThis - Pointer to the interface structure itself.
592 * document - Handle to document. Returned by FPDF_LoadDocument
593 * function.
594 * Return value:
595 * Handle to the page. Returned by FPDF_LoadPage function.
596 * */
Dan Sinclair3ebd1212016-03-09 09:59:23 -0500597 FPDF_PAGE (*FFI_GetCurrentPage)(struct _FPDF_FORMFILLINFO* pThis,
598 FPDF_DOCUMENT document);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700599
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700600 /**
601 * Method: FFI_GetRotation
602 * This method receives currently rotation of the page view.
603 * Interface Version:
604 * 1
605 * Implementation Required:
606 * yes
607 * Parameters:
608 * pThis - Pointer to the interface structure itself.
609 * page - Handle to page. Returned by FPDF_LoadPage function.
610 * Return value:
611 * The page rotation. Should be 0(0 degree),1(90 degree),2(180
612 * degree),3(270 degree), in a clockwise direction.
613 * */
614 int (*FFI_GetRotation)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700615
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700616 /**
617 * Method: FFI_ExecuteNamedAction
618 * This method will execute an named action.
619 * Interface Version:
620 * 1
621 * Implementation Required:
622 * yes
623 * Parameters:
624 * pThis - Pointer to the interface structure itself.
625 * namedAction - A byte string which indicates the named action,
626 * terminated by 0.
627 * Return value:
628 * None.
629 * Comments:
630 * See the named actions description of <<PDF Reference, version 1.7>>
631 * for more details.
632 * */
633 void (*FFI_ExecuteNamedAction)(struct _FPDF_FORMFILLINFO* pThis,
634 FPDF_BYTESTRING namedAction);
635 /**
636 * @brief This method will be called when a text field is getting or losing a
637 * focus.
638 *
639 * @param[in] pThis Pointer to the interface structure itself.
640 * @param[in] value The string value of the form field, in UTF-16LE
641 * format.
642 * @param[in] valueLen The length of the string value, number of characters
643 * (not bytes).
644 * @param[in] is_focus True if the form field is getting a focus, False for
645 * losing a focus.
646 *
647 * @return None.
648 *
649 * @note Currently,only support text field and combobox field.
650 * */
651 void (*FFI_SetTextFieldFocus)(struct _FPDF_FORMFILLINFO* pThis,
652 FPDF_WIDESTRING value,
653 FPDF_DWORD valueLen,
654 FPDF_BOOL is_focus);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700655
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700656 /**
657 * Method: FFI_DoURIAction
658 * This action resolves to a uniform resource identifier.
659 * Interface Version:
660 * 1
661 * Implementation Required:
662 * No
663 * Parameters:
664 * pThis - Pointer to the interface structure itself.
665 * bsURI - A byte string which indicates the uniform resource
666 * identifier, terminated by 0.
667 * Return value:
668 * None.
669 * Comments:
670 * See the URI actions description of <<PDF Reference, version 1.7>> for
671 * more details.
672 * */
673 void (*FFI_DoURIAction)(struct _FPDF_FORMFILLINFO* pThis,
674 FPDF_BYTESTRING bsURI);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700675
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700676 /**
677 * Method: FFI_DoGoToAction
678 * This action changes the view to a specified destination.
679 * Interface Version:
680 * 1
681 * Implementation Required:
682 * No
683 * Parameters:
684 * pThis - Pointer to the interface structure itself.
685 * nPageIndex - The index of the PDF page.
dsinclaircac704d2016-07-28 12:59:09 -0700686 * zoomMode - The zoom mode for viewing page. See below.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700687 * fPosArray - The float array which carries the position info.
688 * sizeofArray - The size of float array.
dsinclaircac704d2016-07-28 12:59:09 -0700689 *
690 * PDFZoom values:
691 * - XYZ = 1
692 * - FITPAGE = 2
693 * - FITHORZ = 3
694 * - FITVERT = 4
695 * - FITRECT = 5
696 * - FITBBOX = 6
697 * - FITBHORZ = 7
698 * - FITBVERT = 8
699 *
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700700 * Return value:
701 * None.
702 * Comments:
703 * See the Destinations description of <<PDF Reference, version 1.7>> in
704 *8.2.1 for more details.
705 **/
706 void (*FFI_DoGoToAction)(struct _FPDF_FORMFILLINFO* pThis,
707 int nPageIndex,
708 int zoomMode,
709 float* fPosArray,
710 int sizeofArray);
Bo Xubb5ef882014-11-06 16:13:33 -0800711
712 /**
713 * pointer to IPDF_JSPLATFORM interface
714 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700715 IPDF_JSPLATFORM* m_pJsPlatform;
Bo Xubb5ef882014-11-06 16:13:33 -0800716
Tom Sepezc46d0002015-11-30 15:46:36 -0800717#ifdef PDF_ENABLE_XFA
718 /* Version 2. */
Bo Xubb5ef882014-11-06 16:13:33 -0800719 /**
Tom Sepez9857e202015-05-13 17:09:26 -0700720 * Method: FFI_DisplayCaret
721 * This method will show the caret at specified position.
722 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800723 * 2
Tom Sepez9857e202015-05-13 17:09:26 -0700724 * Implementation Required:
725 * yes
726 * Parameters:
727 * pThis - Pointer to the interface structure itself.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700728 * page - Handle to page. Returned by FPDF_LoadPage
729 *function.
730 * left - Left position of the client area in PDF page
731 *coordinate.
732 * top - Top position of the client area in PDF page
733 *coordinate.
734 * right - Right position of the client area in PDF page
735 *coordinate.
736 * bottom - Bottom position of the client area in PDF page
737 *coordinate.
Tom Sepez9857e202015-05-13 17:09:26 -0700738 * Return value:
739 * None.
740 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700741 void (*FFI_DisplayCaret)(struct _FPDF_FORMFILLINFO* pThis,
742 FPDF_PAGE page,
743 FPDF_BOOL bVisible,
744 double left,
745 double top,
746 double right,
747 double bottom);
Tom Sepezc46d0002015-11-30 15:46:36 -0800748
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700749 /**
750 * Method: FFI_GetCurrentPageIndex
751 * This method will get the current page index.
752 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800753 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700754 * Implementation Required:
755 * yes
756 * Parameters:
757 * pThis - Pointer to the interface structure itself.
758 * document - Handle to document. Returned by FPDF_LoadDocument
759 *function.
760 * Return value:
761 * The index of current page.
762 **/
763 int (*FFI_GetCurrentPageIndex)(struct _FPDF_FORMFILLINFO* pThis,
764 FPDF_DOCUMENT document);
Tom Sepezc46d0002015-11-30 15:46:36 -0800765
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700766 /**
767 * Method: FFI_SetCurrentPage
768 * This method will set the current page.
769 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800770 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700771 * Implementation Required:
772 * yes
773 * Parameters:
774 * pThis - Pointer to the interface structure itself.
775 * document - Handle to document. Returned by FPDF_LoadDocument
776 *function.
777 * iCurPage - The index of the PDF page.
778 * Return value:
779 * None.
780 **/
781 void (*FFI_SetCurrentPage)(struct _FPDF_FORMFILLINFO* pThis,
782 FPDF_DOCUMENT document,
783 int iCurPage);
Tom Sepezc46d0002015-11-30 15:46:36 -0800784
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700785 /**
786 * Method: FFI_GotoURL
787 * This method will link to the specified URL.
788 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800789 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700790 * Implementation Required:
791 * no
792 * Parameters:
793 * pThis - Pointer to the interface structure itself.
794 * document - Handle to document. Returned by FPDF_LoadDocument
795 *function.
796 * wsURL - The string value of the URL, in UTF-16LE format.
797 * Return value:
798 * None.
799 **/
800 void (*FFI_GotoURL)(struct _FPDF_FORMFILLINFO* pThis,
801 FPDF_DOCUMENT document,
802 FPDF_WIDESTRING wsURL);
Tom Sepezc46d0002015-11-30 15:46:36 -0800803
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700804 /**
805 * Method: FFI_GetPageViewRect
806 * This method will get the current page view rectangle.
807 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800808 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700809 * Implementation Required:
810 * yes
811 * Parameters:
812 * pThis - Pointer to the interface structure itself.
813 * page - Handle to page. Returned by FPDF_LoadPage
814 *function.
815 * left - The pointer to receive left position of the page
816 *view area in PDF page coordinate.
817 * top - The pointer to receive top position of the page
818 *view area in PDF page coordinate.
819 * right - The pointer to receive right position of the
820 *client area in PDF page coordinate.
821 * bottom - The pointer to receive bottom position of the
822 *client area in PDF page coordinate.
823 * Return value:
824 * None.
825 **/
826 void (*FFI_GetPageViewRect)(struct _FPDF_FORMFILLINFO* pThis,
827 FPDF_PAGE page,
828 double* left,
829 double* top,
830 double* right,
831 double* bottom);
Lei Zhang84e5a122016-02-19 14:25:10 -0800832
833 /**
834 * Method: FFI_PageEvent
jinming_wanga1cef702016-03-18 16:35:40 +0800835 * This method fires when pages have been added to or deleted from the XFA
836 * document.
Lei Zhang84e5a122016-02-19 14:25:10 -0800837 * Interface Version:
838 * 2
839 * Implementation Required:
840 * yes
841 * Parameters:
842 * pThis - Pointer to the interface structure itself.
jinming_wanga1cef702016-03-18 16:35:40 +0800843 * page_count - The number of pages to be added to or deleted from the
844 * document.
Lei Zhang84e5a122016-02-19 14:25:10 -0800845 * event_type - See FXFA_PAGEVIEWEVENT_* above.
846 * Return value:
847 * None.
jinming_wanga1cef702016-03-18 16:35:40 +0800848 * Comments:
849 * The pages to be added or deleted always start from the last page
850 * of document. This means that if parameter page_count is 2 and
851 * event type is FXFA_PAGEVIEWEVENT_POSTADDED, 2 new pages have been
852 * appended to the tail of document; If page_count is 2 and
853 * event type is FXFA_PAGEVIEWEVENT_POSTREMOVED, the last 2 pages
854 * have been deleted.
Lei Zhang84e5a122016-02-19 14:25:10 -0800855 **/
856 void (*FFI_PageEvent)(struct _FPDF_FORMFILLINFO* pThis,
jinming_wanga1cef702016-03-18 16:35:40 +0800857 int page_count,
Lei Zhang84e5a122016-02-19 14:25:10 -0800858 FPDF_DWORD event_type);
859
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700860 /**
861 * Method: FFI_PopupMenu
862 * This method will track the right context menu for XFA fields.
863 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800864 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700865 * Implementation Required:
866 * yes
867 * Parameters:
868 * pThis - Pointer to the interface structure itself.
869 * page - Handle to page. Returned by FPDF_LoadPage
870 *function.
871 * hWidget - Handle to XFA fields.
872 * menuFlag - The menu flags. Please refer to macro definition
dsinclairf2662c42016-09-14 06:23:48 -0700873 *of FXFA_MENU_XXX and this can be one or a combination of these macros.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700874 * x - X position of the client area in PDF page
875 *coordinate.
876 * y - Y position of the client area in PDF page
877 *coordinate.
878 * Return value:
879 * TRUE indicates success; otherwise false.
880 **/
Dan Sinclair3ebd1212016-03-09 09:59:23 -0500881 FPDF_BOOL (*FFI_PopupMenu)(struct _FPDF_FORMFILLINFO* pThis,
882 FPDF_PAGE page,
883 FPDF_WIDGET hWidget,
884 int menuFlag,
885 float x,
886 float y);
Tom Sepezc46d0002015-11-30 15:46:36 -0800887
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700888 /**
889 * Method: FFI_OpenFile
890 * This method will open the specified file with the specified mode.
891 * Interface Version
Jun Fangc30d5bf2016-02-02 18:12:23 -0800892 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700893 * Implementation Required:
894 * yes
895 * Parameters:
896 * pThis - Pointer to the interface structure itself.
897 * fileFlag - The file flag.Please refer to macro definition of
898 *FXFA_SAVEAS_XXX and this can be one of these macros.
899 * wsURL - The string value of the file URL, in UTF-16LE
900 *format.
901 * mode - The mode for open file.
902 * Return value:
903 * The handle to FPDF_FILEHANDLER.
904 **/
905 FPDF_FILEHANDLER* (*FFI_OpenFile)(struct _FPDF_FORMFILLINFO* pThis,
906 int fileFlag,
907 FPDF_WIDESTRING wsURL,
908 const char* mode);
Tom Sepezc46d0002015-11-30 15:46:36 -0800909
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700910 /**
911 * Method: FFI_EmailTo
912 * This method will email the specified file stream to the specified
913 *contacter.
914 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800915 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700916 * Implementation Required:
917 * yes
918 * Parameters:
919 * pThis - Pointer to the interface structure itself.
920 * pFileHandler - Handle to the FPDF_FILEHANDLER.
921 * pTo - A semicolon-delimited list of recipients for the
922 *message,in UTF-16LE format.
923 * pSubject - The subject of the message,in UTF-16LE format.
924 * pCC - A semicolon-delimited list of CC recipients for
925 *the message,in UTF-16LE format.
926 * pBcc - A semicolon-delimited list of BCC recipients for
927 *the message,in UTF-16LE format.
928 * pMsg - Pointer to the data buffer to be sent.Can be
929 *NULL,in UTF-16LE format.
930 * Return value:
931 * None.
932 **/
933 void (*FFI_EmailTo)(struct _FPDF_FORMFILLINFO* pThis,
934 FPDF_FILEHANDLER* fileHandler,
935 FPDF_WIDESTRING pTo,
936 FPDF_WIDESTRING pSubject,
937 FPDF_WIDESTRING pCC,
938 FPDF_WIDESTRING pBcc,
939 FPDF_WIDESTRING pMsg);
Tom Sepezc46d0002015-11-30 15:46:36 -0800940
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700941 /**
942 * Method: FFI_UploadTo
943 * This method will get upload the specified file stream to the
944 *specified URL.
945 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800946 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700947 * Implementation Required:
948 * yes
949 * Parameters:
950 * pThis - Pointer to the interface structure itself.
951 * pFileHandler - Handle to the FPDF_FILEHANDLER.
952 * fileFlag - The file flag.Please refer to macro definition of
953 *FXFA_SAVEAS_XXX and this can be one of these macros.
954 * uploadTo - Pointer to the URL path, in UTF-16LE format.
955 * Return value:
956 * None.
957 **/
958 void (*FFI_UploadTo)(struct _FPDF_FORMFILLINFO* pThis,
959 FPDF_FILEHANDLER* fileHandler,
960 int fileFlag,
961 FPDF_WIDESTRING uploadTo);
Tom Sepez9857e202015-05-13 17:09:26 -0700962
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700963 /**
964 * Method: FFI_GetPlatform
965 * This method will get the current platform.
966 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800967 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700968 * Implementation Required:
969 * yes
970 * Parameters:
971 * pThis - Pointer to the interface structure itself.
972 * platform - Pointer to the data buffer to receive the
973 *platform.Can be NULL,in UTF-16LE format.
974 * length - The length of the buffer, number of bytes. Can be
975 *0.
976 * Return value:
977 * The length of the buffer, number of bytes.
978 **/
979 int (*FFI_GetPlatform)(struct _FPDF_FORMFILLINFO* pThis,
980 void* platform,
981 int length);
Tom Sepezc46d0002015-11-30 15:46:36 -0800982
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700983 /**
984 * Method: FFI_GetLanguage
985 * This method will get the current language.
986 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800987 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700988 * Implementation Required:
989 * yes
990 * Parameters:
991 * pThis - Pointer to the interface structure itself.
992 * language - Pointer to the data buffer to receive the current
993 *language.Can be NULL.
994 * length - The length of the buffer, number of bytes. Can be
995 *0.
996 * Return value:
997 * The length of the buffer, number of bytes.
998 **/
999 int (*FFI_GetLanguage)(struct _FPDF_FORMFILLINFO* pThis,
1000 void* language,
1001 int length);
Tom Sepezc46d0002015-11-30 15:46:36 -08001002
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001003 /**
1004 * Method: FFI_DownloadFromURL
1005 * This method will download the specified file from the URL.
1006 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -08001007 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001008 * Implementation Required:
1009 * yes
1010 * Parameters:
1011 * pThis - Pointer to the interface structure itself.
1012 * URL - The string value of the file URL, in UTF-16LE
1013 *format.
1014 * Return value:
1015 * The handle to FPDF_FILEHANDLER.
1016 **/
Dan Sinclair3ebd1212016-03-09 09:59:23 -05001017 FPDF_LPFILEHANDLER (*FFI_DownloadFromURL)(struct _FPDF_FORMFILLINFO* pThis,
1018 FPDF_WIDESTRING URL);
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001019 /**
1020 * Method: FFI_PostRequestURL
1021 * This method will post the request to the server URL.
1022 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -08001023 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001024 * Implementation Required:
1025 * yes
1026 * Parameters:
1027 * pThis - Pointer to the interface structure itself.
1028 * wsURL - The string value of the server URL, in UTF-16LE
1029 *format.
1030 * wsData - The post data,in UTF-16LE format.
1031 * wsContentType - The content type of the request data,in UTF-16LE
1032 *format.
1033 * wsEncode - The encode type,in UTF-16LE format.
1034 * wsHeader - The request header,in UTF-16LE format.
1035 * response - Pointer to the FPDF_BSTR to receive the response
1036 *data from server,,in UTF-16LE format.
1037 * Return value:
1038 * TRUE indicates success, otherwise FALSE.
1039 **/
Dan Sinclair3ebd1212016-03-09 09:59:23 -05001040 FPDF_BOOL (*FFI_PostRequestURL)(struct _FPDF_FORMFILLINFO* pThis,
1041 FPDF_WIDESTRING wsURL,
1042 FPDF_WIDESTRING wsData,
1043 FPDF_WIDESTRING wsContentType,
1044 FPDF_WIDESTRING wsEncode,
1045 FPDF_WIDESTRING wsHeader,
1046 FPDF_BSTR* respone);
Tom Sepezc46d0002015-11-30 15:46:36 -08001047
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001048 /**
1049 * Method: FFI_PutRequestURL
1050 * This method will put the request to the server URL.
1051 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -08001052 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001053 * Implementation Required:
1054 * yes
1055 * Parameters:
1056 * pThis - Pointer to the interface structure itself.
1057 * wsURL - The string value of the server URL, in UTF-16LE
1058 *format.
1059 * wsData - The put data, in UTF-16LE format.
1060 * wsEncode - The encode type, in UTR-16LE format.
1061 * Return value:
1062 * TRUE indicates success, otherwise FALSE.
1063 **/
Dan Sinclair3ebd1212016-03-09 09:59:23 -05001064 FPDF_BOOL (*FFI_PutRequestURL)(struct _FPDF_FORMFILLINFO* pThis,
1065 FPDF_WIDESTRING wsURL,
1066 FPDF_WIDESTRING wsData,
1067 FPDF_WIDESTRING wsEncode);
Tom Sepezc46d0002015-11-30 15:46:36 -08001068#endif // PDF_ENABLE_XFA
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001069} FPDF_FORMFILLINFO;
1070
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001071/**
Bo Xu2b7a49d2014-11-14 17:40:50 -08001072 * Function: FPDFDOC_InitFormFillEnvironment
Tom Sepez9857e202015-05-13 17:09:26 -07001073 * Init form fill environment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001074 * Comments:
Tom Sepez9857e202015-05-13 17:09:26 -07001075 * This function should be called before any form fill operation.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001076 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001077 * document - Handle to document. Returned by
1078 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001079 * pFormFillInfo - Pointer to a FPDF_FORMFILLINFO structure.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001080 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001081 * Return handler to the form fill module. NULL means fails.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001082 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001083DLLEXPORT FPDF_FORMHANDLE STDCALL
1084FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document,
1085 FPDF_FORMFILLINFO* formInfo);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001086
1087/**
Bo Xu2b7a49d2014-11-14 17:40:50 -08001088 * Function: FPDFDOC_ExitFormFillEnvironment
Tom Sepez9857e202015-05-13 17:09:26 -07001089 * Exit form fill environment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001090 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001091 * hHandle - Handle to the form fill module. Returned by
1092 *FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001093 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001094 * NULL.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001095 **/
Bo Xu2b7a49d2014-11-14 17:40:50 -08001096DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001097
1098/**
1099 * Function: FORM_OnAfterLoadPage
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001100 * This method is required for implementing all the form related
1101 *functions. Should be invoked after user
1102 * successfully loaded a PDF page, and method
1103 *FPDFDOC_InitFormFillEnvironment had been invoked.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001104 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001105 * hHandle - Handle to the form fill module. Returned by
1106 *FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001107 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001108 * NONE.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001109 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001110DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page,
1111 FPDF_FORMHANDLE hHandle);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001112
1113/**
1114 * Function: FORM_OnBeforeClosePage
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001115 * This method is required for implementing all the form related
1116 *functions. Should be invoked before user
Tom Sepez9857e202015-05-13 17:09:26 -07001117 * close the PDF page.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001118 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001119 * page - Handle to the page. Returned by FPDF_LoadPage
1120 *function.
1121 * hHandle - Handle to the form fill module. Returned by
1122 *FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001123 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001124 * NONE.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001125 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001126DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page,
1127 FPDF_FORMHANDLE hHandle);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001128
1129/**
1130* Function: FORM_DoDocumentJSAction
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001131* This method is required for performing Document-level JavaScript
1132*action. It should be invoked after the PDF document
Tom Sepez9857e202015-05-13 17:09:26 -07001133* had been loaded.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001134* Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001135* hHandle - Handle to the form fill module. Returned by
1136*FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001137* Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001138* NONE
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001139* Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001140* If there is Document-level JavaScript action embedded in the
1141*document, this method will execute the javascript action;
Tom Sepez9857e202015-05-13 17:09:26 -07001142* otherwise, the method will do nothing.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001143**/
1144DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle);
1145
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001146/**
1147* Function: FORM_DoDocumentOpenAction
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001148* This method is required for performing open-action when the document
1149*is opened.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001150* Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001151* hHandle - Handle to the form fill module. Returned by
1152*FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001153* Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001154* NONE
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001155* Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001156* This method will do nothing if there is no open-actions embedded in
1157*the document.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001158**/
1159DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle);
1160
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001161// additional actions type of document.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001162#define FPDFDOC_AACTION_WC \
1163 0x10 // WC, before closing document, JavaScript action.
1164#define FPDFDOC_AACTION_WS \
1165 0x11 // WS, before saving document, JavaScript action.
1166#define FPDFDOC_AACTION_DS 0x12 // DS, after saving document, JavaScript
1167 // action.
1168#define FPDFDOC_AACTION_WP \
1169 0x13 // WP, before printing document, JavaScript action.
1170#define FPDFDOC_AACTION_DP \
1171 0x14 // DP, after printing document, JavaScript action.
Nico Weber077f1a32015-08-06 15:08:57 -07001172
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001173/**
1174* Function: FORM_DoDocumentAAction
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001175* This method is required for performing the document's
1176*additional-action.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001177* Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001178* hHandle - Handle to the form fill module. Returned by
1179*FPDFDOC_InitFormFillEnvironment.
1180* aaType - The type of the additional-actions which defined
1181*above.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001182* Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001183* NONE
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001184* Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001185* This method will do nothing if there is no document
1186*additional-action corresponding to the specified aaType.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001187**/
1188
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001189DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle,
1190 int aaType);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001191
1192// Additional-action types of page object
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001193#define FPDFPAGE_AACTION_OPEN \
1194 0 // /O -- An action to be performed when the page is opened
1195#define FPDFPAGE_AACTION_CLOSE \
1196 1 // /C -- An action to be performed when the page is closed
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001197
1198/**
1199* Function: FORM_DoPageAAction
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001200* This method is required for performing the page object's
1201*additional-action when opened or closed.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001202* Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001203* page - Handle to the page. Returned by FPDF_LoadPage
1204*function.
1205* hHandle - Handle to the form fill module. Returned by
1206*FPDFDOC_InitFormFillEnvironment.
1207* aaType - The type of the page object's additional-actions
1208*which defined above.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001209* Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001210* NONE
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001211* Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001212* This method will do nothing if no additional-action corresponding to
1213*the specified aaType exists.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001214**/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001215DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page,
1216 FPDF_FORMHANDLE hHandle,
1217 int aaType);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001218
1219/**
1220 * Function: FORM_OnMouseMove
Tom Sepez9857e202015-05-13 17:09:26 -07001221 * You can call this member function when the mouse cursor moves.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001222 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001223 * hHandle - Handle to the form fill module. Returned by
1224 *FPDFDOC_InitFormFillEnvironment.
1225 * page - Handle to the page. Returned by FPDF_LoadPage
1226 *function.
Tom Sepez9857e202015-05-13 17:09:26 -07001227 * modifier - Indicates whether various virtual keys are down.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001228 * page_x - Specifies the x-coordinate of the cursor in PDF user
1229 *space.
1230 * page_y - Specifies the y-coordinate of the cursor in PDF user
1231 *space.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001232 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001233 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001234 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001235DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle,
1236 FPDF_PAGE page,
1237 int modifier,
1238 double page_x,
1239 double page_y);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001240
1241/**
1242 * Function: FORM_OnLButtonDown
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001243 * You can call this member function when the user presses the left
1244 *mouse button.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001245 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001246 * hHandle - Handle to the form fill module. Returned by
1247 *FPDFDOC_InitFormFillEnvironment.
1248 * page - Handle to the page. Returned by FPDF_LoadPage
1249 *function.
Tom Sepez9857e202015-05-13 17:09:26 -07001250 * modifier - Indicates whether various virtual keys are down.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001251 * page_x - Specifies the x-coordinate of the cursor in PDF user
1252 *space.
1253 * page_y - Specifies the y-coordinate of the cursor in PDF user
1254 *space.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001255 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001256 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001257 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001258DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle,
1259 FPDF_PAGE page,
1260 int modifier,
1261 double page_x,
1262 double page_y);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001263
1264/**
1265 * Function: FORM_OnLButtonUp
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001266 * You can call this member function when the user releases the left
1267 *mouse button.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001268 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001269 * hHandle - Handle to the form fill module. Returned by
1270 *FPDFDOC_InitFormFillEnvironment.
1271 * page - Handle to the page. Returned by FPDF_LoadPage
1272 *function.
Tom Sepez9857e202015-05-13 17:09:26 -07001273 * modifier - Indicates whether various virtual keys are down.
1274 * page_x - Specifies the x-coordinate of the cursor in device.
1275 * page_y - Specifies the y-coordinate of the cursor in device.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001276 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001277 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001278 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001279DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle,
1280 FPDF_PAGE page,
1281 int modifier,
1282 double page_x,
1283 double page_y);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001284
Tom Sepezc46d0002015-11-30 15:46:36 -08001285#ifdef PDF_ENABLE_XFA
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001286DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle,
1287 FPDF_PAGE page,
1288 int modifier,
1289 double page_x,
1290 double page_y);
1291DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle,
1292 FPDF_PAGE page,
1293 int modifier,
1294 double page_x,
1295 double page_y);
Tom Sepezc46d0002015-11-30 15:46:36 -08001296#endif // PDF_ENABLE_XFA
Bo Xufdc00a72014-10-28 23:03:33 -07001297
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001298/**
1299 * Function: FORM_OnKeyDown
Tom Sepez9857e202015-05-13 17:09:26 -07001300 * You can call this member function when a nonsystem key is pressed.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001301 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001302 * hHandle - Handle to the form fill module. Returned by
1303 *FPDFDOC_InitFormFillEnvironment.
1304 * page - Handle to the page. Returned by FPDF_LoadPage
1305 *function.
Tom Sepez9857e202015-05-13 17:09:26 -07001306 * nKeyCode - Indicates whether various virtual keys are down.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001307 * modifier - Contains the scan code, key-transition code,
1308 *previous key state, and context code.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001309 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001310 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001311 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001312DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle,
1313 FPDF_PAGE page,
1314 int nKeyCode,
1315 int modifier);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001316
1317/**
1318 * Function: FORM_OnKeyUp
Tom Sepez9857e202015-05-13 17:09:26 -07001319 * You can call this member function when a nonsystem key is released.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001320 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001321 * hHandle - Handle to the form fill module. Returned by
1322 *FPDFDOC_InitFormFillEnvironment.
1323 * page - Handle to the page. Returned by FPDF_LoadPage
1324 *function.
Tom Sepez9857e202015-05-13 17:09:26 -07001325 * nKeyCode - The virtual-key code of the given key.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001326 * modifier - Contains the scan code, key-transition code,
1327 *previous key state, and context code.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001328 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001329 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001330 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001331DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle,
1332 FPDF_PAGE page,
1333 int nKeyCode,
1334 int modifier);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001335
1336/**
1337 * Function: FORM_OnChar
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001338 * You can call this member function when a keystroke translates to a
1339 *nonsystem character.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001340 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001341 * hHandle - Handle to the form fill module. Returned by
1342 *FPDFDOC_InitFormFillEnvironment.
1343 * page - Handle to the page. Returned by FPDF_LoadPage
1344 *function.
Tom Sepez9857e202015-05-13 17:09:26 -07001345 * nChar - The character code value of the key.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001346 * modifier - Contains the scan code, key-transition code,
1347 *previous key state, and context code.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001348 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001349 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001350 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001351DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle,
1352 FPDF_PAGE page,
1353 int nChar,
1354 int modifier);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001355
1356/**
1357 * Function: FORM_ForceToKillFocus.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001358 * You can call this member function to force to kill the focus of the
1359 *form field which got focus.
1360 * It would kill the focus on the form field, save the value of form
1361 *field if it's changed by user.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001362 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001363 * hHandle - Handle to the form fill module. Returned by
1364 *FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001365 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001366 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001367 **/
1368DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle);
1369
1370// Field Types
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001371#define FPDF_FORMFIELD_UNKNOWN 0 // Unknown.
1372#define FPDF_FORMFIELD_PUSHBUTTON 1 // push button type.
1373#define FPDF_FORMFIELD_CHECKBOX 2 // check box type.
1374#define FPDF_FORMFIELD_RADIOBUTTON 3 // radio button type.
1375#define FPDF_FORMFIELD_COMBOBOX 4 // combo box type.
1376#define FPDF_FORMFIELD_LISTBOX 5 // list box type.
1377#define FPDF_FORMFIELD_TEXTFIELD 6 // text field type.
Tom Sepezc46d0002015-11-30 15:46:36 -08001378#ifdef PDF_ENABLE_XFA
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001379#define FPDF_FORMFIELD_XFA 7 // text field type.
Tom Sepezc46d0002015-11-30 15:46:36 -08001380#endif // PDF_ENABLE_XFA
Tom Sepez9857e202015-05-13 17:09:26 -07001381
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001382/**
Lei Zhangbdf72c32015-08-14 19:24:08 -07001383 * Function: FPDFPage_HasFormFieldAtPoint
1384 * Get the form field type by point.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001385 * Parameters:
Lei Zhangbdf72c32015-08-14 19:24:08 -07001386 * hHandle - Handle to the form fill module. Returned by
1387 * FPDFDOC_InitFormFillEnvironment().
1388 * page - Handle to the page. Returned by FPDF_LoadPage().
1389 * page_x - X position in PDF "user space".
1390 * page_y - Y position in PDF "user space".
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001391 * Return Value:
Lei Zhangbdf72c32015-08-14 19:24:08 -07001392 * Return the type of the form field; -1 indicates no field.
1393 * See field types above.
1394 **/
1395DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
1396 FPDF_PAGE page,
1397 double page_x,
1398 double page_y);
1399
1400/**
1401 * Function: FPDPage_HasFormFieldAtPoint
1402 * DEPRECATED. Please use FPDFPage_HasFormFieldAtPoint.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001403 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001404DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
1405 FPDF_PAGE page,
1406 double page_x,
1407 double page_y);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001408
1409/**
Lei Zhangbdf72c32015-08-14 19:24:08 -07001410 * Function: FPDFPage_FormFieldZOrderAtPoint
1411 * Get the form field z-order by point.
1412 * Parameters:
1413 * hHandle - Handle to the form fill module. Returned by
1414 * FPDFDOC_InitFormFillEnvironment().
1415 * page - Handle to the page. Returned by FPDF_LoadPage().
1416 * page_x - X position in PDF "user space".
1417 * page_y - Y position in PDF "user space".
1418 * Return Value:
1419 * Return the z-order of the form field; -1 indicates no field.
1420 * Higher numbers are closer to the front.
1421 **/
1422DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle,
1423 FPDF_PAGE page,
1424 double page_x,
1425 double page_y);
1426
1427/**
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001428 * Function: FPDF_SetFormFieldHighlightColor
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001429 * Set the highlight color of specified or all the form fields in the
1430 *document.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001431 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001432 * hHandle - Handle to the form fill module. Returned by
1433 *FPDFDOC_InitFormFillEnvironment.
1434 * doc - Handle to the document. Returned by
1435 *FPDF_LoadDocument function.
1436 * fieldType - A 32-bit integer indicating the type of a form
1437 *field(defined above).
1438 * color - The highlight color of the form field.Constructed by
1439 *0xxxrrggbb.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001440 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001441 * NONE.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001442 * Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001443 * When the parameter fieldType is set to zero, the highlight color
1444 *will be applied to all the form fields in the
Tom Sepez9857e202015-05-13 17:09:26 -07001445 * document.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001446 * Please refresh the client window to show the highlight immediately
1447 *if necessary.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001448 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001449DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle,
1450 int fieldType,
1451 unsigned long color);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001452
1453/**
1454 * Function: FPDF_SetFormFieldHighlightAlpha
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001455 * Set the transparency of the form field highlight color in the
1456 *document.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001457 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001458 * hHandle - Handle to the form fill module. Returned by
1459 *FPDFDOC_InitFormFillEnvironment.
1460 * doc - Handle to the document. Returned by
1461 *FPDF_LoadDocument function.
1462 * alpha - The transparency of the form field highlight color.
1463 *between 0-255.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001464 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001465 * NONE.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001466 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001467DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle,
1468 unsigned char alpha);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001469
1470/**
1471 * Function: FPDF_RemoveFormFieldHighlight
Tom Sepez9857e202015-05-13 17:09:26 -07001472 * Remove the form field highlight color in the document.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001473 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001474 * hHandle - Handle to the form fill module. Returned by
1475 *FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001476 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001477 * NONE.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001478 * Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001479 * Please refresh the client window to remove the highlight immediately
1480 *if necessary.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001481 **/
1482DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle);
1483
1484/**
1485* Function: FPDF_FFLDraw
jaepark75f84a52016-09-09 15:39:09 -07001486* Render FormFields and popup window on a page to a device independent
1487*bitmap.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001488* Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001489* hHandle - Handle to the form fill module. Returned by
1490*FPDFDOC_InitFormFillEnvironment.
1491* bitmap - Handle to the device independent bitmap (as the
1492*output buffer).
1493* Bitmap handle can be created by FPDFBitmap_Create
1494*function.
1495* page - Handle to the page. Returned by FPDF_LoadPage
1496*function.
1497* start_x - Left pixel position of the display area in the
1498*device coordinate.
1499* start_y - Top pixel position of the display area in the device
1500*coordinate.
Tom Sepez9857e202015-05-13 17:09:26 -07001501* size_x - Horizontal size (in pixels) for displaying the page.
1502* size_y - Vertical size (in pixels) for displaying the page.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001503* rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees
1504*clockwise),
1505* 2 (rotated 180 degrees), 3 (rotated 90 degrees
1506*counter-clockwise).
1507* flags - 0 for normal display, or combination of flags
1508*defined above.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001509* Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001510* None.
1511* Comments:
jaepark75f84a52016-09-09 15:39:09 -07001512* This function is designed to render annotations that are
1513*user-interactive, which are widget annotation (for FormFields) and popup
1514*annotation.
1515* With FPDF_ANNOT flag, this function will render popup annotation
1516*when users mouse-hover on non-widget annotation. Regardless of FPDF_ANNOT flag,
1517*this function will always render widget annotations for FormFields.
1518* In order to implement the FormFill functions, implementation should
1519*call this function after rendering functions, such as FPDF_RenderPageBitmap or
1520*FPDF_RenderPageBitmap_Start, finish rendering the page contents.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001521**/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001522DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle,
1523 FPDF_BITMAP bitmap,
1524 FPDF_PAGE page,
1525 int start_x,
1526 int start_y,
1527 int size_x,
1528 int size_y,
1529 int rotate,
1530 int flags);
Tom Sepezc46d0002015-11-30 15:46:36 -08001531
Cary Clark399be5b2016-03-14 16:51:29 -04001532#ifdef _SKIA_SUPPORT_
1533DLLEXPORT void STDCALL FPDF_FFLRecord(FPDF_FORMHANDLE hHandle,
1534 FPDF_RECORDER recorder,
1535 FPDF_PAGE page,
1536 int start_x,
1537 int start_y,
1538 int size_x,
1539 int size_y,
1540 int rotate,
1541 int flags);
1542#endif
1543
Tom Sepezc46d0002015-11-30 15:46:36 -08001544#ifdef PDF_ENABLE_XFA
Jun Fange118ce92015-02-17 06:50:08 -08001545/**
1546 * Function: FPDF_HasXFAField
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001547 * This method is designed to check whether a pdf document
1548 *has XFA fields.
Jun Fange118ce92015-02-17 06:50:08 -08001549 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001550 * document - Handle to document.
1551 *Returned by FPDF_LoadDocument function.
1552 * docType - Document type defined as
1553 *DOCTYPE_xxx.
Jun Fange118ce92015-02-17 06:50:08 -08001554 * Return Value:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001555 * TRUE indicates that the input document has XFA fields,
1556 *otherwise FALSE.
Jun Fange118ce92015-02-17 06:50:08 -08001557 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001558DLLEXPORT FPDF_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document,
1559 int* docType);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001560
Bo Xufdc00a72014-10-28 23:03:33 -07001561/**
1562 * Function: FPDF_LoadXFA
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001563 * If the document consists of XFA fields, there should call this
1564 *method to load XFA fields.
Bo Xufdc00a72014-10-28 23:03:33 -07001565 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001566 * document - Handle to document. Returned by
1567 *FPDF_LoadDocument function.
Bo Xufdc00a72014-10-28 23:03:33 -07001568 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001569 * TRUE indicates success,otherwise FALSE.
Bo Xufdc00a72014-10-28 23:03:33 -07001570 **/
1571DLLEXPORT FPDF_BOOL STDCALL FPDF_LoadXFA(FPDF_DOCUMENT document);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001572
Bo Xufdc00a72014-10-28 23:03:33 -07001573/**
1574 * Function: FPDF_Widget_Undo
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001575 * This method will implement the undo feature for the specified xfa
1576 *field.
Bo Xufdc00a72014-10-28 23:03:33 -07001577 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001578 * document - Handle to document. Returned by
1579 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001580 * hWidget - Handle to the xfa field.
Bo Xufdc00a72014-10-28 23:03:33 -07001581 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001582 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001583 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001584DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document,
1585 FPDF_WIDGET hWidget);
Bo Xufdc00a72014-10-28 23:03:33 -07001586/**
1587 * Function: FPDF_Widget_Redo
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001588 * This method will implement the redo feature for the specified xfa
1589 *field.
Bo Xufdc00a72014-10-28 23:03:33 -07001590 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001591 * document - Handle to document. Returned by
1592 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001593 * hWidget - Handle to the xfa field.
Bo Xufdc00a72014-10-28 23:03:33 -07001594 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001595 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001596 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001597DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document,
1598 FPDF_WIDGET hWidget);
Bo Xufdc00a72014-10-28 23:03:33 -07001599/**
1600 * Function: FPDF_Widget_SelectAll
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001601 * This method will implement the select all feature for the specified
1602 *xfa field.
Bo Xufdc00a72014-10-28 23:03:33 -07001603 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001604 * document - Handle to document. Returned by
1605 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001606 * hWidget - Handle to the xfa field.
Bo Xufdc00a72014-10-28 23:03:33 -07001607 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001608 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001609 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001610DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document,
1611 FPDF_WIDGET hWidget);
Bo Xufdc00a72014-10-28 23:03:33 -07001612/**
1613 * Function: FPDF_Widget_Copy
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001614 * This method will implement the copy feature for the specified xfa
1615 *field.
Bo Xufdc00a72014-10-28 23:03:33 -07001616 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001617 * document - Handle to document. Returned by
1618 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001619 * hWidget - Handle to the xfa field.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001620 * wsText - Pointer to data buffer to receive the copied
1621 *data, in UTF-16LE format.
Tom Sepez9857e202015-05-13 17:09:26 -07001622 * size - The data buffer size.
Bo Xufdc00a72014-10-28 23:03:33 -07001623 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001624 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001625 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001626DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document,
1627 FPDF_WIDGET hWidget,
1628 FPDF_WIDESTRING wsText,
1629 FPDF_DWORD* size);
Bo Xufdc00a72014-10-28 23:03:33 -07001630/**
1631 * Function: FPDF_Widget_Cut
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001632 * This method will implement the cut feature for the specified xfa
1633 *field.
Bo Xufdc00a72014-10-28 23:03:33 -07001634 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001635 * document - Handle to document. Returned by
1636 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001637 * hWidget - Handle to the xfa field.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001638 * wsText - Pointer to data buffer to receive the cut
1639 *data,in UTF-16LE format.
Tom Sepez9857e202015-05-13 17:09:26 -07001640 * size - The data buffer size,not the byte number.
Bo Xufdc00a72014-10-28 23:03:33 -07001641 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001642 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001643 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001644DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document,
1645 FPDF_WIDGET hWidget,
1646 FPDF_WIDESTRING wsText,
1647 FPDF_DWORD* size);
Bo Xufdc00a72014-10-28 23:03:33 -07001648/**
1649 * Function: FPDF_Widget_Paste
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001650 * This method will implement the paste feature for the specified xfa
1651 *field.
Bo Xufdc00a72014-10-28 23:03:33 -07001652 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001653 * document - Handle to document. Returned by
1654 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001655 * hWidget - Handle to the xfa field.
1656 * wsText - The paste text buffer, in UTF-16LE format.
1657 * size - The data buffer size,not the byte number.
Bo Xufdc00a72014-10-28 23:03:33 -07001658 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001659 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001660 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001661DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document,
1662 FPDF_WIDGET hWidget,
1663 FPDF_WIDESTRING wsText,
1664 FPDF_DWORD size);
Bo Xufdc00a72014-10-28 23:03:33 -07001665/**
1666 * Function: FPDF_Widget_ReplaceSpellCheckWord
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001667 * This method will implement the spell check feature for the specified
1668 *xfa field.
Bo Xufdc00a72014-10-28 23:03:33 -07001669 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001670 * document - Handle to document. Returned by
1671 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001672 * hWidget - Handle to the xfa field.
1673 * x - The x value of the specified point.
1674 * y - The y value of the specified point.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001675 * bsText - The text buffer needed to be speck check, in
1676 *UTF-16LE format.
Bo Xufdc00a72014-10-28 23:03:33 -07001677 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001678 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001679 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001680DLLEXPORT void STDCALL
1681FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document,
1682 FPDF_WIDGET hWidget,
1683 float x,
1684 float y,
1685 FPDF_BYTESTRING bsText);
Bo Xufdc00a72014-10-28 23:03:33 -07001686/**
1687 * Function: FPDF_Widget_GetSpellCheckWords
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001688 * This method will implement the spell check feature for the specified
1689 *xfa field.
Bo Xufdc00a72014-10-28 23:03:33 -07001690 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001691 * document - Handle to document. Returned by
1692 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001693 * hWidget - Handle to the xfa field.
1694 * x - The x value of the specified point.
1695 * y - The y value of the specified point.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001696 * stringHandle - Pointer to FPDF_STRINGHANDLE to receive the
1697 *speck check text buffer, in UTF-16LE format.
Bo Xufdc00a72014-10-28 23:03:33 -07001698 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001699 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001700 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001701DLLEXPORT void STDCALL
1702FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document,
1703 FPDF_WIDGET hWidget,
1704 float x,
1705 float y,
1706 FPDF_STRINGHANDLE* stringHandle);
Bo Xufdc00a72014-10-28 23:03:33 -07001707/**
1708 * Function: FPDF_StringHandleCounts
Tom Sepez9857e202015-05-13 17:09:26 -07001709 * This method will get the count of the text buffer.
Bo Xufdc00a72014-10-28 23:03:33 -07001710 * Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -07001711 * stringHandle - Pointer to FPDF_STRINGHANDLE.
Bo Xufdc00a72014-10-28 23:03:33 -07001712 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001713 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001714 **/
1715DLLEXPORT int STDCALL FPDF_StringHandleCounts(FPDF_STRINGHANDLE stringHandle);
1716/**
1717 * Function: FPDF_StringHandleGetStringByIndex
Tom Sepez9857e202015-05-13 17:09:26 -07001718 * This method will get the specified index of the text buffer.
Bo Xufdc00a72014-10-28 23:03:33 -07001719 * Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -07001720 * stringHandle - Pointer to FPDF_STRINGHANDLE.
1721 * index - The specified index of text buffer.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001722 * bsText - Pointer to data buffer to receive the text
1723 *buffer, in UTF-16LE format.
Tom Sepez9857e202015-05-13 17:09:26 -07001724 * size - The byte size of data buffer.
Bo Xufdc00a72014-10-28 23:03:33 -07001725 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001726 * TRUE indicates success, otherwise FALSE.
Bo Xufdc00a72014-10-28 23:03:33 -07001727 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001728DLLEXPORT FPDF_BOOL STDCALL
1729FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE stringHandle,
1730 int index,
1731 FPDF_BYTESTRING bsText,
1732 FPDF_DWORD* size);
Bo Xufdc00a72014-10-28 23:03:33 -07001733/**
1734 * Function: FPDF_StringHandleRelease
Tom Sepez9857e202015-05-13 17:09:26 -07001735 * This method will release the FPDF_STRINGHANDLE.
Bo Xufdc00a72014-10-28 23:03:33 -07001736 * Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -07001737 * stringHandle - Pointer to FPDF_STRINGHANDLE.
Bo Xufdc00a72014-10-28 23:03:33 -07001738 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001739 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001740 **/
1741DLLEXPORT void STDCALL FPDF_StringHandleRelease(FPDF_STRINGHANDLE stringHandle);
1742/**
1743 * Function: FPDF_StringHandleAddString
Tom Sepez9857e202015-05-13 17:09:26 -07001744 * This method will add the specified text buffer.
Bo Xufdc00a72014-10-28 23:03:33 -07001745 * Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -07001746 * stringHandle - Pointer to FPDF_STRINGHANDLE.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001747 * bsText - Pointer to data buffer of the text buffer, in
1748 *UTF-16LE format.
Tom Sepez9857e202015-05-13 17:09:26 -07001749 * size - The byte size of data buffer.
Bo Xufdc00a72014-10-28 23:03:33 -07001750 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001751 * TRUE indicates success, otherwise FALSE.
Bo Xufdc00a72014-10-28 23:03:33 -07001752 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001753DLLEXPORT FPDF_BOOL STDCALL
1754FPDF_StringHandleAddString(FPDF_STRINGHANDLE stringHandle,
1755 FPDF_BYTESTRING bsText,
1756 FPDF_DWORD size);
Tom Sepezc46d0002015-11-30 15:46:36 -08001757#endif // PDF_ENABLE_XFA
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001758
1759#ifdef __cplusplus
Tom Sepez9857e202015-05-13 17:09:26 -07001760}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001761#endif
1762
Tom Sepez9857e202015-05-13 17:09:26 -07001763#endif // PUBLIC_FPDF_FORMFILL_H_