blob: e4cdaee0f6fbf91fb7b31aefca23e861b9c4bdd6 [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
Dan Sinclair85c8e7f2016-11-21 13:50:32 -050010// NOLINTNEXTLINE(build/include)
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070011#include "fpdfview.h"
12
13typedef void* FPDF_FORMHANDLE;
14
Ryan Harrison0e568812017-10-21 02:07:02 -040015// These values are return values for a public API, so should not be changed
16// other than the count when adding new values.
Ryan Harrison854d71c2017-10-18 12:28:14 -040017#define FORMTYPE_NONE 0 // Document contains no forms
18#define FORMTYPE_ACRO_FORM 1 // Forms are specified using AcroForm spec
19#define FORMTYPE_XFA_FULL 2 // Forms are specified using the entire XFA spec
20#define FORMTYPE_XFA_FOREGROUND \
21 3 // Forms are specified using the XFAF subset of XFA spec
Ryan Harrison0e568812017-10-21 02:07:02 -040022#define FORMTYPE_COUNT 4 // The number of form types
Jun Fange118ce92015-02-17 06:50:08 -080023
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070024// Exported Functions
25#ifdef __cplusplus
26extern "C" {
27#endif
28
Nico Weber9d8ec5a2015-08-04 13:00:21 -070029typedef struct _IPDF_JsPlatform {
30 /**
31 * Version number of the interface. Currently must be 2.
32 **/
33 int version;
Bo Xufdc00a72014-10-28 23:03:33 -070034
Nico Weber9d8ec5a2015-08-04 13:00:21 -070035 /* Version 1. */
Jochen Eisinger06b60022015-07-30 17:44:35 +020036
Nico Weber9d8ec5a2015-08-04 13:00:21 -070037 /**
38 * Method: app_alert
39 * pop up a dialog to show warning or hint.
40 * Interface Version:
41 * 1
42 * Implementation Required:
43 * yes
44 * Parameters:
45 * pThis - Pointer to the interface structure itself
46 * Msg - A string containing the message to be displayed.
47 * Title - The title of the dialog.
48 * Type - The stype of button group.
49 * 0-OK(default);
50 * 1-OK,Cancel;
51 * 2-Yes,NO;
52 * 3-Yes, NO, Cancel.
53 * nIcon - The Icon type.
54 * 0-Error(default);
55 * 1-Warning;
56 * 2-Question;
57 * 3-Status.
58 * 4-Asterisk
Nico Weber9d8ec5a2015-08-04 13:00:21 -070059 * Return Value:
60 * The return value could be the folowing type:
61 * 1-OK;
62 * 2-Cancel;
63 * 3-NO;
64 * 4-Yes;
65 */
66 int (*app_alert)(struct _IPDF_JsPlatform* pThis,
67 FPDF_WIDESTRING Msg,
68 FPDF_WIDESTRING Title,
69 int Type,
70 int Icon);
Tom Sepez621d4de2014-07-29 14:01:21 -070071
Nico Weber9d8ec5a2015-08-04 13:00:21 -070072 /**
73 * Method: app_beep
74 * Causes the system to play a sound.
75 * Interface Version:
76 * 1
77 * Implementation Required:
78 * yes
79 * Parameters:
80 * pThis - Pointer to the interface structure itself
81 * nType - The sound type.
82 * 0 - Error
83 * 1 - Warning
84 * 2 - Question
85 * 3 - Status
86 * 4 - Default (default value)
87 * Return Value:
88 * None
89 */
90 void (*app_beep)(struct _IPDF_JsPlatform* pThis, int nType);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -070091
Nico Weber9d8ec5a2015-08-04 13:00:21 -070092 /**
93 * Method: app_response
94 * Displays a dialog box containing a question and an entry field for
95 * the user to reply to the question.
96 * Interface Version:
97 * 1
98 * Implementation Required:
99 * yes
100 * Parameters:
101 * pThis - Pointer to the interface structure itself
102 * Question - The question to be posed to the user.
103 * Title - The title of the dialog box.
104 * Default - A default value for the answer to the question. If
105 * not specified, no default value is presented.
106 * cLabel - A short string to appear in front of and on the
107 * same line as the edit text field.
108 * bPassword - If true, indicates that the user's response should
109 * show as asterisks (*) or bullets (?) to mask the response, which might be
110 * sensitive information. The default is false.
111 * response - A string buffer allocated by SDK, to receive the
112 * user's response.
113 * length - The length of the buffer, number of bytes.
114 * Currently, It's always be 2048.
115 * Return Value:
116 * Number of bytes the complete user input would actually require, not
117 * including trailing zeros, regardless of the value of the length
118 * parameter or the presence of the response buffer.
119 * Comments:
120 * No matter on what platform, the response buffer should be always
121 * written using UTF-16LE encoding. If a response buffer is
122 * present and the size of the user input exceeds the capacity of the
123 * buffer as specified by the length parameter, only the
124 * first "length" bytes of the user input are to be written to the
125 * buffer.
126 */
127 int (*app_response)(struct _IPDF_JsPlatform* pThis,
128 FPDF_WIDESTRING Question,
129 FPDF_WIDESTRING Title,
130 FPDF_WIDESTRING Default,
131 FPDF_WIDESTRING cLabel,
132 FPDF_BOOL bPassword,
133 void* response,
134 int length);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700135
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700136 /*
137 * Method: Doc_getFilePath
138 * Get the file path of the current document.
139 * Interface Version:
140 * 1
141 * Implementation Required:
142 * yes
143 * Parameters:
144 * pThis - Pointer to the interface structure itself
145 * filePath - The string buffer to receive the file path. Can be
146 * NULL.
147 * length - The length of the buffer, number of bytes. Can be
148 * 0.
149 * Return Value:
150 * Number of bytes the filePath consumes, including trailing zeros.
151 * Comments:
152 * The filePath should be always input in local encoding.
153 *
154 * The return value always indicated number of bytes required for the
thestig9067fd62016-11-23 14:10:06 -0800155 * buffer , even when there is no buffer specified, or the buffer size is
156 * less than required. In this case, the buffer will not be modified.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700157 */
158 int (*Doc_getFilePath)(struct _IPDF_JsPlatform* pThis,
159 void* filePath,
160 int length);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700161
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700162 /*
163 * Method: Doc_mail
164 * Mails the data buffer as an attachment to all recipients, with or
165 * without user interaction.
166 * Interface Version:
167 * 1
168 * Implementation Required:
169 * yes
170 * Parameters:
171 * pThis - Pointer to the interface structure itself
172 * mailData - Pointer to the data buffer to be sent.Can be NULL.
173 * length - The size,in bytes, of the buffer pointed by
174 * mailData parameter.Can be 0.
175 * bUI - If true, the rest of the parameters are used in a
176 * compose-new-message window that is displayed to the user. If false, the cTo
177 * parameter is required and all others are optional.
178 * To - A semicolon-delimited list of recipients for the
179 * message.
180 * Subject - The subject of the message. The length limit is 64
181 * KB.
182 * CC - A semicolon-delimited list of CC recipients for
183 * the message.
184 * BCC - A semicolon-delimited list of BCC recipients for
185 * the message.
186 * Msg - The content of the message. The length limit is 64
187 * KB.
188 * Return Value:
189 * None.
190 * Comments:
191 * If the parameter mailData is NULL or length is 0, the current
192 * document will be mailed as an attachment to all recipients.
193 */
194 void (*Doc_mail)(struct _IPDF_JsPlatform* pThis,
195 void* mailData,
196 int length,
197 FPDF_BOOL bUI,
198 FPDF_WIDESTRING To,
199 FPDF_WIDESTRING Subject,
200 FPDF_WIDESTRING CC,
201 FPDF_WIDESTRING BCC,
202 FPDF_WIDESTRING Msg);
Tom Sepez9857e202015-05-13 17:09:26 -0700203
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700204 /*
205 * Method: Doc_print
206 * Prints all or a specific number of pages of the document.
207 * Interface Version:
208 * 1
209 * Implementation Required:
210 * yes
211 * Parameters:
212 * pThis - Pointer to the interface structure itself.
213 * bUI - If true, will cause a UI to be presented to the
214 * user to obtain printing information and confirm the action.
215 * nStart - A 0-based index that defines the start of an
216 * inclusive range of pages.
217 * nEnd - A 0-based index that defines the end of an
218 * inclusive page range.
219 * bSilent - If true, suppresses the cancel dialog box while
220 * the document is printing. The default is false.
221 * bShrinkToFit - If true, the page is shrunk (if necessary) to
222 * fit within the imageable area of the printed page.
223 * bPrintAsImage - If true, print pages as an image.
224 * bReverse - If true, print from nEnd to nStart.
225 * bAnnotations - If true (the default), annotations are
226 * printed.
227 */
228 void (*Doc_print)(struct _IPDF_JsPlatform* pThis,
229 FPDF_BOOL bUI,
230 int nStart,
231 int nEnd,
232 FPDF_BOOL bSilent,
233 FPDF_BOOL bShrinkToFit,
234 FPDF_BOOL bPrintAsImage,
235 FPDF_BOOL bReverse,
236 FPDF_BOOL bAnnotations);
Tom Sepez9857e202015-05-13 17:09:26 -0700237
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700238 /*
239 * Method: Doc_submitForm
240 * Send the form data to a specified URL.
241 * Interface Version:
242 * 1
243 * Implementation Required:
244 * yes
245 * Parameters:
246 * pThis - Pointer to the interface structure itself
247 * formData - Pointer to the data buffer to be sent.
248 * length - The size,in bytes, of the buffer pointed by
249 * formData parameter.
250 * URL - The URL to send to.
251 * Return Value:
252 * None.
253 *
254 */
255 void (*Doc_submitForm)(struct _IPDF_JsPlatform* pThis,
256 void* formData,
257 int length,
258 FPDF_WIDESTRING URL);
Tom Sepez9857e202015-05-13 17:09:26 -0700259
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700260 /*
261 * Method: Doc_gotoPage
262 * Jump to a specified page.
263 * Interface Version:
264 * 1
265 * Implementation Required:
266 * yes
267 * Parameters:
268 * pThis - Pointer to the interface structure itself
269 * nPageNum - The specified page number, zero for the first
270 * page.
271 * Return Value:
272 * None.
273 *
274 */
275 void (*Doc_gotoPage)(struct _IPDF_JsPlatform* pThis, int nPageNum);
276 /*
277 * Method: Field_browse
278 * Show a file selection dialog, and return the selected file path.
279 * Interface Version:
280 * 1
281 * Implementation Required:
282 * yes
283 * Parameters:
284 * pThis - Pointer to the interface structure itself.
285 * filePath - Pointer to the data buffer to receive the file
286 * path.Can be NULL.
287 * length - The length of the buffer, number of bytes. Can be
288 * 0.
289 * Return Value:
290 * Number of bytes the filePath consumes, including trailing zeros.
291 * Comments:
292 * The filePath shoule be always input in local encoding.
293 */
294 int (*Field_browse)(struct _IPDF_JsPlatform* pThis,
295 void* filePath,
296 int length);
Tom Sepez9857e202015-05-13 17:09:26 -0700297
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700298 /**
299 * pointer to FPDF_FORMFILLINFO interface.
300 **/
301 void* m_pFormfillinfo;
Tom Sepez9857e202015-05-13 17:09:26 -0700302
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700303 /* Version 2. */
Tom Sepez9857e202015-05-13 17:09:26 -0700304
Tom Sepeza72e8e22015-10-07 10:17:53 -0700305 void* m_isolate; /* Unused in v3, retain for compatibility. */
306 unsigned int m_v8EmbedderSlot; /* Unused in v3, retain for compatibility. */
Jochen Eisinger06b60022015-07-30 17:44:35 +0200307
Tom Sepeza72e8e22015-10-07 10:17:53 -0700308 /* Version 3. */
309 /* Version 3 moves m_Isolate and m_v8EmbedderSlot to FPDF_LIBRARY_CONFIG. */
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700310} IPDF_JSPLATFORM;
311
312// Flags for Cursor type
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700313#define FXCT_ARROW 0
314#define FXCT_NESW 1
315#define FXCT_NWSE 2
316#define FXCT_VBEAM 3
317#define FXCT_HBEAM 4
318#define FXCT_HAND 5
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700319
320/**
tsepez8e120292016-08-03 14:03:35 -0700321 * Function signature for the callback function passed to the FFI_SetTimer
322 * method.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700323 * Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -0700324 * idEvent - Identifier of the timer.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700325 * Return value:
Tom Sepez9857e202015-05-13 17:09:26 -0700326 * None.
327 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700328typedef void (*TimerCallback)(int idEvent);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700329
330/**
331 * Declares of a struct type to the local system time.
332**/
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700333typedef struct _FPDF_SYSTEMTIME {
334 unsigned short wYear; /* years since 1900 */
335 unsigned short wMonth; /* months since January - [0,11] */
336 unsigned short wDayOfWeek; /* days since Sunday - [0,6] */
337 unsigned short wDay; /* day of the month - [1,31] */
338 unsigned short wHour; /* hours since midnight - [0,23] */
339 unsigned short wMinute; /* minutes after the hour - [0,59] */
340 unsigned short wSecond; /* seconds after the minute - [0,59] */
341 unsigned short wMilliseconds; /* milliseconds after the second - [0,999] */
342} FPDF_SYSTEMTIME;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700343
Tom Sepezc46d0002015-11-30 15:46:36 -0800344#ifdef PDF_ENABLE_XFA
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700345// XFA
Bo Xufdc00a72014-10-28 23:03:33 -0700346/**
347 * @name Pageview event flags
348 */
349/*@{*/
350/** @brief After a new pageview is added. */
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700351#define FXFA_PAGEVIEWEVENT_POSTADDED 1
Bo Xufdc00a72014-10-28 23:03:33 -0700352/** @brief After a pageview is removed. */
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700353#define FXFA_PAGEVIEWEVENT_POSTREMOVED 3
Bo Xufdc00a72014-10-28 23:03:33 -0700354/*@}*/
355
356// menu
357/**
358 * @name Macro Definitions for Right Context Menu Features Of XFA Fields
359 */
360/*@{*/
dsinclairf2662c42016-09-14 06:23:48 -0700361#define FXFA_MENU_COPY 1
362#define FXFA_MENU_CUT 2
363#define FXFA_MENU_SELECTALL 4
364#define FXFA_MENU_UNDO 8
365#define FXFA_MENU_REDO 16
366#define FXFA_MENU_PASTE 32
Bo Xufdc00a72014-10-28 23:03:33 -0700367/*@}*/
368
369// file type
370/**
371 * @name Macro Definitions for File Type.
372 */
373/*@{*/
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700374#define FXFA_SAVEAS_XML 1
375#define FXFA_SAVEAS_XDP 2
Bo Xufdc00a72014-10-28 23:03:33 -0700376/*@}*/
Tom Sepezc46d0002015-11-30 15:46:36 -0800377#endif // PDF_ENABLE_XFA
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700378
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700379typedef struct _FPDF_FORMFILLINFO {
380 /**
Tom Sepezc46d0002015-11-30 15:46:36 -0800381 * Version number of the interface. Currently must be 1 (when PDFium is built
382 * without the XFA module) or must be 2 (when built with the XFA module).
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700383 **/
384 int version;
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700385
Tom Sepezc46d0002015-11-30 15:46:36 -0800386 /* Version 1. */
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700387 /**
Tom Sepezc46d0002015-11-30 15:46:36 -0800388 *Method: Release
389 * Give implementation a chance to release any data after the
390 * interface is no longer used
391 *Interface Version:
392 * 1
393 *Implementation Required:
394 * No
395 *Comments:
396 * Called by Foxit SDK during the final cleanup process.
397 *Parameters:
398 * pThis - Pointer to the interface structure itself
399 *Return Value:
400 * None
401 */
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700402 void (*Release)(struct _FPDF_FORMFILLINFO* pThis);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700403
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700404 /**
405 * Method: FFI_Invalidate
406 * Invalidate the client area within the specified rectangle.
407 * Interface Version:
408 * 1
409 * Implementation Required:
410 * yes
411 * Parameters:
412 * pThis - Pointer to the interface structure itself.
413 * page - Handle to the page. Returned by FPDF_LoadPage
414 *function.
415 * left - Left position of the client area in PDF page
416 *coordinate.
417 * top - Top position of the client area in PDF page
418 *coordinate.
419 * right - Right position of the client area in PDF page
420 *coordinate.
421 * bottom - Bottom position of the client area in PDF page
422 *coordinate.
423 * Return Value:
424 * None.
425 *
426 *comments:
427 * All positions are measured in PDF "user space".
428 * Implementation should call FPDF_RenderPageBitmap() function for
429 *repainting a specified page area.
430 */
431 void (*FFI_Invalidate)(struct _FPDF_FORMFILLINFO* pThis,
432 FPDF_PAGE page,
433 double left,
434 double top,
435 double right,
436 double bottom);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700437
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700438 /**
439 * Method: FFI_OutputSelectedRect
440 * When user is taking the mouse to select texts on a form field,
441 * this callback function will keep
442 * returning the selected areas to the implementation.
443 *
444 * Interface Version:
445 * 1
446 * Implementation Required:
447 * No
448 * Parameters:
449 * pThis - Pointer to the interface structure itself.
450 * page - Handle to the page. Returned by FPDF_LoadPage
451 * function.
452 * left - Left position of the client area in PDF page
453 * coordinate.
454 * top - Top position of the client area in PDF page
455 * coordinate.
456 * right - Right position of the client area in PDF page
457 * coordinate.
458 * bottom - Bottom position of the client area in PDF page
459 * coordinate.
460 * Return Value:
461 * None.
462 *
463 * comments:
464 * This CALLBACK function is useful for implementing special text
465 * selection effect. Implementation should
466 * first records the returned rectangles, then draw them one by one
467 * at the painting period, last,remove all
468 * the recorded rectangles when finish painting.
469 */
470 void (*FFI_OutputSelectedRect)(struct _FPDF_FORMFILLINFO* pThis,
471 FPDF_PAGE page,
472 double left,
473 double top,
474 double right,
475 double bottom);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700476
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700477 /**
478 * Method: FFI_SetCursor
479 * Set the Cursor shape.
480 * Interface Version:
481 * 1
482 * Implementation Required:
483 * yes
484 * Parameters:
485 * pThis - Pointer to the interface structure itself.
486 * nCursorType - Cursor type. see Flags for Cursor type for the
487 * details.
488 * Return value:
489 * None.
490 * */
491 void (*FFI_SetCursor)(struct _FPDF_FORMFILLINFO* pThis, int nCursorType);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700492
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700493 /**
494 * Method: FFI_SetTimer
tsepez8e120292016-08-03 14:03:35 -0700495 * This method installs a system timer. An interval value is specified,
496 * and every time that interval elapses, the system must call into the
497 * callback function with the timer ID as returned by this function.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700498 * Interface Version:
tsepez8e120292016-08-03 14:03:35 -0700499 * 1
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700500 * Implementation Required:
tsepez8e120292016-08-03 14:03:35 -0700501 * yes
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700502 * Parameters:
503 * pThis - Pointer to the interface structure itself.
504 * uElapse - Specifies the time-out value, in milliseconds.
505 * lpTimerFunc - A pointer to the callback function-TimerCallback.
tsepez8e120292016-08-03 14:03:35 -0700506 * Return value:
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700507 * The timer identifier of the new timer if the function is successful.
508 * An application passes this value to the FFI_KillTimer method to kill
509 * the timer. Nonzero if it is successful; otherwise, it is zero.
510 * */
511 int (*FFI_SetTimer)(struct _FPDF_FORMFILLINFO* pThis,
512 int uElapse,
513 TimerCallback lpTimerFunc);
Tom Sepez9857e202015-05-13 17:09:26 -0700514
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700515 /**
516 * Method: FFI_KillTimer
tsepez8e120292016-08-03 14:03:35 -0700517 * This method uninstalls a system timer identified by nIDEvent, as
518 * set by an earlier call to FFI_SetTimer.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700519 * Interface Version:
tsepez8e120292016-08-03 14:03:35 -0700520 * 1
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700521 * Implementation Required:
tsepez8e120292016-08-03 14:03:35 -0700522 * yes
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700523 * Parameters:
524 * pThis - Pointer to the interface structure itself.
tsepez8e120292016-08-03 14:03:35 -0700525 * nTimerID - The timer ID returned by FFI_SetTimer function.
526 * Return value:
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700527 * None.
528 * */
529 void (*FFI_KillTimer)(struct _FPDF_FORMFILLINFO* pThis, int nTimerID);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700530
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700531 /**
532 * Method: FFI_GetLocalTime
533 * This method receives the current local time on the system.
534 * Interface Version:
535 * 1
536 * Implementation Required:
537 * yes
538 * Parameters:
539 * pThis - Pointer to the interface structure itself.
540 * Return value:
541 * None.
542 * */
543 FPDF_SYSTEMTIME (*FFI_GetLocalTime)(struct _FPDF_FORMFILLINFO* pThis);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700544
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700545 /**
546 * Method: FFI_OnChange
547 * This method will be invoked to notify implementation when the
548 * value of any FormField on the document had been changed.
549 * Interface Version:
550 * 1
551 * Implementation Required:
552 * no
553 * Parameters:
554 * pThis - Pointer to the interface structure itself.
555 * Return value:
556 * None.
557 * */
558 void (*FFI_OnChange)(struct _FPDF_FORMFILLINFO* pThis);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700559
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700560 /**
561 * Method: FFI_GetPage
562 * This method receives the page pointer associated with a specified
563 * page index.
564 * Interface Version:
565 * 1
566 * Implementation Required:
567 * yes
568 * Parameters:
569 * pThis - Pointer to the interface structure itself.
570 * document - Handle to document. Returned by FPDF_LoadDocument
571 * function.
572 * nPageIndex - Index number of the page. 0 for the first page.
573 * Return value:
574 * Handle to the page. Returned by FPDF_LoadPage function.
575 * Comments:
576 * In some cases, the document-level JavaScript action may refer to a
577 * page which hadn't been loaded yet.
578 * To successfully run the javascript action, implementation need to load
579 * the page for SDK.
580 * */
Dan Sinclair3ebd1212016-03-09 09:59:23 -0500581 FPDF_PAGE (*FFI_GetPage)(struct _FPDF_FORMFILLINFO* pThis,
582 FPDF_DOCUMENT document,
583 int nPageIndex);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700584
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700585 /**
586 * Method: FFI_GetCurrentPage
587 * This method receives the current page pointer.
588 * Interface Version:
589 * 1
590 * Implementation Required:
591 * yes
592 * Parameters:
593 * pThis - Pointer to the interface structure itself.
594 * document - Handle to document. Returned by FPDF_LoadDocument
595 * function.
596 * Return value:
597 * Handle to the page. Returned by FPDF_LoadPage function.
598 * */
Dan Sinclair3ebd1212016-03-09 09:59:23 -0500599 FPDF_PAGE (*FFI_GetCurrentPage)(struct _FPDF_FORMFILLINFO* pThis,
600 FPDF_DOCUMENT document);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700601
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700602 /**
603 * Method: FFI_GetRotation
604 * This method receives currently rotation of the page view.
605 * Interface Version:
606 * 1
607 * Implementation Required:
608 * yes
609 * Parameters:
610 * pThis - Pointer to the interface structure itself.
611 * page - Handle to page. Returned by FPDF_LoadPage function.
612 * Return value:
613 * The page rotation. Should be 0(0 degree),1(90 degree),2(180
614 * degree),3(270 degree), in a clockwise direction.
dsinclair1f248902016-09-14 10:38:17 -0700615 *
616 * Note: Unused.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700617 * */
618 int (*FFI_GetRotation)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700619
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700620 /**
621 * Method: FFI_ExecuteNamedAction
622 * This method will execute an named action.
623 * Interface Version:
624 * 1
625 * Implementation Required:
626 * yes
627 * Parameters:
628 * pThis - Pointer to the interface structure itself.
629 * namedAction - A byte string which indicates the named action,
630 * terminated by 0.
631 * Return value:
632 * None.
633 * Comments:
634 * See the named actions description of <<PDF Reference, version 1.7>>
635 * for more details.
636 * */
637 void (*FFI_ExecuteNamedAction)(struct _FPDF_FORMFILLINFO* pThis,
638 FPDF_BYTESTRING namedAction);
639 /**
640 * @brief This method will be called when a text field is getting or losing a
641 * focus.
642 *
643 * @param[in] pThis Pointer to the interface structure itself.
644 * @param[in] value The string value of the form field, in UTF-16LE
645 * format.
646 * @param[in] valueLen The length of the string value, number of characters
647 * (not bytes).
648 * @param[in] is_focus True if the form field is getting a focus, False for
649 * losing a focus.
650 *
651 * @return None.
652 *
653 * @note Currently,only support text field and combobox field.
654 * */
655 void (*FFI_SetTextFieldFocus)(struct _FPDF_FORMFILLINFO* pThis,
656 FPDF_WIDESTRING value,
657 FPDF_DWORD valueLen,
658 FPDF_BOOL is_focus);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700659
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700660 /**
661 * Method: FFI_DoURIAction
662 * This action resolves to a uniform resource identifier.
663 * Interface Version:
664 * 1
665 * Implementation Required:
666 * No
667 * Parameters:
668 * pThis - Pointer to the interface structure itself.
669 * bsURI - A byte string which indicates the uniform resource
670 * identifier, terminated by 0.
671 * Return value:
672 * None.
673 * Comments:
674 * See the URI actions description of <<PDF Reference, version 1.7>> for
675 * more details.
676 * */
677 void (*FFI_DoURIAction)(struct _FPDF_FORMFILLINFO* pThis,
678 FPDF_BYTESTRING bsURI);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -0700679
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700680 /**
681 * Method: FFI_DoGoToAction
682 * This action changes the view to a specified destination.
683 * Interface Version:
684 * 1
685 * Implementation Required:
686 * No
687 * Parameters:
688 * pThis - Pointer to the interface structure itself.
689 * nPageIndex - The index of the PDF page.
dsinclaircac704d2016-07-28 12:59:09 -0700690 * zoomMode - The zoom mode for viewing page. See below.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700691 * fPosArray - The float array which carries the position info.
692 * sizeofArray - The size of float array.
dsinclaircac704d2016-07-28 12:59:09 -0700693 *
694 * PDFZoom values:
695 * - XYZ = 1
696 * - FITPAGE = 2
697 * - FITHORZ = 3
698 * - FITVERT = 4
699 * - FITRECT = 5
700 * - FITBBOX = 6
701 * - FITBHORZ = 7
702 * - FITBVERT = 8
703 *
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700704 * Return value:
705 * None.
706 * Comments:
707 * See the Destinations description of <<PDF Reference, version 1.7>> in
708 *8.2.1 for more details.
709 **/
710 void (*FFI_DoGoToAction)(struct _FPDF_FORMFILLINFO* pThis,
711 int nPageIndex,
712 int zoomMode,
713 float* fPosArray,
714 int sizeofArray);
Bo Xubb5ef882014-11-06 16:13:33 -0800715
716 /**
717 * pointer to IPDF_JSPLATFORM interface
718 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700719 IPDF_JSPLATFORM* m_pJsPlatform;
Bo Xubb5ef882014-11-06 16:13:33 -0800720
Tom Sepezc46d0002015-11-30 15:46:36 -0800721#ifdef PDF_ENABLE_XFA
722 /* Version 2. */
Bo Xubb5ef882014-11-06 16:13:33 -0800723 /**
Tom Sepez9857e202015-05-13 17:09:26 -0700724 * Method: FFI_DisplayCaret
725 * This method will show the caret at specified position.
726 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800727 * 2
Tom Sepez9857e202015-05-13 17:09:26 -0700728 * Implementation Required:
729 * yes
730 * Parameters:
731 * pThis - Pointer to the interface structure itself.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700732 * page - Handle to page. Returned by FPDF_LoadPage
733 *function.
734 * left - Left position of the client area in PDF page
735 *coordinate.
736 * top - Top position of the client area in PDF page
737 *coordinate.
738 * right - Right position of the client area in PDF page
739 *coordinate.
740 * bottom - Bottom position of the client area in PDF page
741 *coordinate.
Tom Sepez9857e202015-05-13 17:09:26 -0700742 * Return value:
743 * None.
744 **/
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700745 void (*FFI_DisplayCaret)(struct _FPDF_FORMFILLINFO* pThis,
746 FPDF_PAGE page,
747 FPDF_BOOL bVisible,
748 double left,
749 double top,
750 double right,
751 double bottom);
Tom Sepezc46d0002015-11-30 15:46:36 -0800752
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700753 /**
754 * Method: FFI_GetCurrentPageIndex
755 * This method will get the current page index.
756 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800757 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700758 * Implementation Required:
759 * yes
760 * Parameters:
761 * pThis - Pointer to the interface structure itself.
762 * document - Handle to document. Returned by FPDF_LoadDocument
763 *function.
764 * Return value:
765 * The index of current page.
766 **/
767 int (*FFI_GetCurrentPageIndex)(struct _FPDF_FORMFILLINFO* pThis,
768 FPDF_DOCUMENT document);
Tom Sepezc46d0002015-11-30 15:46:36 -0800769
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700770 /**
771 * Method: FFI_SetCurrentPage
772 * This method will set the current page.
773 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800774 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700775 * Implementation Required:
776 * yes
777 * Parameters:
778 * pThis - Pointer to the interface structure itself.
779 * document - Handle to document. Returned by FPDF_LoadDocument
780 *function.
781 * iCurPage - The index of the PDF page.
782 * Return value:
783 * None.
784 **/
785 void (*FFI_SetCurrentPage)(struct _FPDF_FORMFILLINFO* pThis,
786 FPDF_DOCUMENT document,
787 int iCurPage);
Tom Sepezc46d0002015-11-30 15:46:36 -0800788
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700789 /**
790 * Method: FFI_GotoURL
791 * This method will link to the specified URL.
792 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800793 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700794 * Implementation Required:
795 * no
796 * Parameters:
797 * pThis - Pointer to the interface structure itself.
798 * document - Handle to document. Returned by FPDF_LoadDocument
799 *function.
800 * wsURL - The string value of the URL, in UTF-16LE format.
801 * Return value:
802 * None.
803 **/
804 void (*FFI_GotoURL)(struct _FPDF_FORMFILLINFO* pThis,
805 FPDF_DOCUMENT document,
806 FPDF_WIDESTRING wsURL);
Tom Sepezc46d0002015-11-30 15:46:36 -0800807
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700808 /**
809 * Method: FFI_GetPageViewRect
810 * This method will get the current page view rectangle.
811 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800812 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700813 * Implementation Required:
814 * yes
815 * Parameters:
816 * pThis - Pointer to the interface structure itself.
817 * page - Handle to page. Returned by FPDF_LoadPage
818 *function.
819 * left - The pointer to receive left position of the page
820 *view area in PDF page coordinate.
821 * top - The pointer to receive top position of the page
822 *view area in PDF page coordinate.
823 * right - The pointer to receive right position of the
824 *client area in PDF page coordinate.
825 * bottom - The pointer to receive bottom position of the
826 *client area in PDF page coordinate.
827 * Return value:
828 * None.
829 **/
830 void (*FFI_GetPageViewRect)(struct _FPDF_FORMFILLINFO* pThis,
831 FPDF_PAGE page,
832 double* left,
833 double* top,
834 double* right,
835 double* bottom);
Lei Zhang84e5a122016-02-19 14:25:10 -0800836
837 /**
838 * Method: FFI_PageEvent
jinming_wanga1cef702016-03-18 16:35:40 +0800839 * This method fires when pages have been added to or deleted from the XFA
840 * document.
Lei Zhang84e5a122016-02-19 14:25:10 -0800841 * Interface Version:
842 * 2
843 * Implementation Required:
844 * yes
845 * Parameters:
846 * pThis - Pointer to the interface structure itself.
jinming_wanga1cef702016-03-18 16:35:40 +0800847 * page_count - The number of pages to be added to or deleted from the
848 * document.
Lei Zhang84e5a122016-02-19 14:25:10 -0800849 * event_type - See FXFA_PAGEVIEWEVENT_* above.
850 * Return value:
851 * None.
jinming_wanga1cef702016-03-18 16:35:40 +0800852 * Comments:
853 * The pages to be added or deleted always start from the last page
854 * of document. This means that if parameter page_count is 2 and
855 * event type is FXFA_PAGEVIEWEVENT_POSTADDED, 2 new pages have been
856 * appended to the tail of document; If page_count is 2 and
857 * event type is FXFA_PAGEVIEWEVENT_POSTREMOVED, the last 2 pages
858 * have been deleted.
Lei Zhang84e5a122016-02-19 14:25:10 -0800859 **/
860 void (*FFI_PageEvent)(struct _FPDF_FORMFILLINFO* pThis,
jinming_wanga1cef702016-03-18 16:35:40 +0800861 int page_count,
Lei Zhang84e5a122016-02-19 14:25:10 -0800862 FPDF_DWORD event_type);
863
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700864 /**
865 * Method: FFI_PopupMenu
866 * This method will track the right context menu for XFA fields.
867 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800868 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700869 * Implementation Required:
870 * yes
871 * Parameters:
872 * pThis - Pointer to the interface structure itself.
873 * page - Handle to page. Returned by FPDF_LoadPage
874 *function.
875 * hWidget - Handle to XFA fields.
876 * menuFlag - The menu flags. Please refer to macro definition
dsinclairf2662c42016-09-14 06:23:48 -0700877 *of FXFA_MENU_XXX and this can be one or a combination of these macros.
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700878 * x - X position of the client area in PDF page
879 *coordinate.
880 * y - Y position of the client area in PDF page
881 *coordinate.
882 * Return value:
883 * TRUE indicates success; otherwise false.
884 **/
Dan Sinclair3ebd1212016-03-09 09:59:23 -0500885 FPDF_BOOL (*FFI_PopupMenu)(struct _FPDF_FORMFILLINFO* pThis,
886 FPDF_PAGE page,
887 FPDF_WIDGET hWidget,
888 int menuFlag,
889 float x,
890 float y);
Tom Sepezc46d0002015-11-30 15:46:36 -0800891
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700892 /**
893 * Method: FFI_OpenFile
894 * This method will open the specified file with the specified mode.
895 * Interface Version
Jun Fangc30d5bf2016-02-02 18:12:23 -0800896 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700897 * Implementation Required:
898 * yes
899 * Parameters:
900 * pThis - Pointer to the interface structure itself.
901 * fileFlag - The file flag.Please refer to macro definition of
902 *FXFA_SAVEAS_XXX and this can be one of these macros.
903 * wsURL - The string value of the file URL, in UTF-16LE
904 *format.
905 * mode - The mode for open file.
906 * Return value:
907 * The handle to FPDF_FILEHANDLER.
908 **/
909 FPDF_FILEHANDLER* (*FFI_OpenFile)(struct _FPDF_FORMFILLINFO* pThis,
910 int fileFlag,
911 FPDF_WIDESTRING wsURL,
912 const char* mode);
Tom Sepezc46d0002015-11-30 15:46:36 -0800913
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700914 /**
915 * Method: FFI_EmailTo
916 * This method will email the specified file stream to the specified
917 *contacter.
918 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800919 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700920 * Implementation Required:
921 * yes
922 * Parameters:
923 * pThis - Pointer to the interface structure itself.
924 * pFileHandler - Handle to the FPDF_FILEHANDLER.
925 * pTo - A semicolon-delimited list of recipients for the
926 *message,in UTF-16LE format.
927 * pSubject - The subject of the message,in UTF-16LE format.
928 * pCC - A semicolon-delimited list of CC recipients for
929 *the message,in UTF-16LE format.
930 * pBcc - A semicolon-delimited list of BCC recipients for
931 *the message,in UTF-16LE format.
932 * pMsg - Pointer to the data buffer to be sent.Can be
933 *NULL,in UTF-16LE format.
934 * Return value:
935 * None.
936 **/
937 void (*FFI_EmailTo)(struct _FPDF_FORMFILLINFO* pThis,
938 FPDF_FILEHANDLER* fileHandler,
939 FPDF_WIDESTRING pTo,
940 FPDF_WIDESTRING pSubject,
941 FPDF_WIDESTRING pCC,
942 FPDF_WIDESTRING pBcc,
943 FPDF_WIDESTRING pMsg);
Tom Sepezc46d0002015-11-30 15:46:36 -0800944
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700945 /**
946 * Method: FFI_UploadTo
947 * This method will get upload the specified file stream to the
948 *specified URL.
949 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800950 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700951 * Implementation Required:
952 * yes
953 * Parameters:
954 * pThis - Pointer to the interface structure itself.
955 * pFileHandler - Handle to the FPDF_FILEHANDLER.
956 * fileFlag - The file flag.Please refer to macro definition of
957 *FXFA_SAVEAS_XXX and this can be one of these macros.
958 * uploadTo - Pointer to the URL path, in UTF-16LE format.
959 * Return value:
960 * None.
961 **/
962 void (*FFI_UploadTo)(struct _FPDF_FORMFILLINFO* pThis,
963 FPDF_FILEHANDLER* fileHandler,
964 int fileFlag,
965 FPDF_WIDESTRING uploadTo);
Tom Sepez9857e202015-05-13 17:09:26 -0700966
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700967 /**
968 * Method: FFI_GetPlatform
969 * This method will get the current platform.
970 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800971 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700972 * Implementation Required:
973 * yes
974 * Parameters:
975 * pThis - Pointer to the interface structure itself.
976 * platform - Pointer to the data buffer to receive the
977 *platform.Can be NULL,in UTF-16LE format.
978 * length - The length of the buffer, number of bytes. Can be
979 *0.
980 * Return value:
981 * The length of the buffer, number of bytes.
982 **/
983 int (*FFI_GetPlatform)(struct _FPDF_FORMFILLINFO* pThis,
984 void* platform,
985 int length);
Tom Sepezc46d0002015-11-30 15:46:36 -0800986
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700987 /**
988 * Method: FFI_GetLanguage
989 * This method will get the current language.
990 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -0800991 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -0700992 * Implementation Required:
993 * yes
994 * Parameters:
995 * pThis - Pointer to the interface structure itself.
996 * language - Pointer to the data buffer to receive the current
997 *language.Can be NULL.
998 * length - The length of the buffer, number of bytes. Can be
999 *0.
1000 * Return value:
1001 * The length of the buffer, number of bytes.
1002 **/
1003 int (*FFI_GetLanguage)(struct _FPDF_FORMFILLINFO* pThis,
1004 void* language,
1005 int length);
Tom Sepezc46d0002015-11-30 15:46:36 -08001006
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001007 /**
1008 * Method: FFI_DownloadFromURL
1009 * This method will download the specified file from the URL.
1010 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -08001011 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001012 * Implementation Required:
1013 * yes
1014 * Parameters:
1015 * pThis - Pointer to the interface structure itself.
1016 * URL - The string value of the file URL, in UTF-16LE
1017 *format.
1018 * Return value:
1019 * The handle to FPDF_FILEHANDLER.
1020 **/
Dan Sinclair3ebd1212016-03-09 09:59:23 -05001021 FPDF_LPFILEHANDLER (*FFI_DownloadFromURL)(struct _FPDF_FORMFILLINFO* pThis,
1022 FPDF_WIDESTRING URL);
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001023 /**
1024 * Method: FFI_PostRequestURL
1025 * This method will post the request to the server URL.
1026 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -08001027 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001028 * Implementation Required:
1029 * yes
1030 * Parameters:
1031 * pThis - Pointer to the interface structure itself.
1032 * wsURL - The string value of the server URL, in UTF-16LE
1033 *format.
1034 * wsData - The post data,in UTF-16LE format.
1035 * wsContentType - The content type of the request data,in UTF-16LE
1036 *format.
1037 * wsEncode - The encode type,in UTF-16LE format.
1038 * wsHeader - The request header,in UTF-16LE format.
1039 * response - Pointer to the FPDF_BSTR to receive the response
1040 *data from server,,in UTF-16LE format.
1041 * Return value:
1042 * TRUE indicates success, otherwise FALSE.
1043 **/
Dan Sinclair3ebd1212016-03-09 09:59:23 -05001044 FPDF_BOOL (*FFI_PostRequestURL)(struct _FPDF_FORMFILLINFO* pThis,
1045 FPDF_WIDESTRING wsURL,
1046 FPDF_WIDESTRING wsData,
1047 FPDF_WIDESTRING wsContentType,
1048 FPDF_WIDESTRING wsEncode,
1049 FPDF_WIDESTRING wsHeader,
1050 FPDF_BSTR* respone);
Tom Sepezc46d0002015-11-30 15:46:36 -08001051
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001052 /**
1053 * Method: FFI_PutRequestURL
1054 * This method will put the request to the server URL.
1055 * Interface Version:
Jun Fangc30d5bf2016-02-02 18:12:23 -08001056 * 2
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001057 * Implementation Required:
1058 * yes
1059 * Parameters:
1060 * pThis - Pointer to the interface structure itself.
1061 * wsURL - The string value of the server URL, in UTF-16LE
1062 *format.
1063 * wsData - The put data, in UTF-16LE format.
1064 * wsEncode - The encode type, in UTR-16LE format.
1065 * Return value:
1066 * TRUE indicates success, otherwise FALSE.
1067 **/
Dan Sinclair3ebd1212016-03-09 09:59:23 -05001068 FPDF_BOOL (*FFI_PutRequestURL)(struct _FPDF_FORMFILLINFO* pThis,
1069 FPDF_WIDESTRING wsURL,
1070 FPDF_WIDESTRING wsData,
1071 FPDF_WIDESTRING wsEncode);
Tom Sepezc46d0002015-11-30 15:46:36 -08001072#endif // PDF_ENABLE_XFA
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001073} FPDF_FORMFILLINFO;
1074
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001075/**
Bo Xu2b7a49d2014-11-14 17:40:50 -08001076 * Function: FPDFDOC_InitFormFillEnvironment
Tom Sepez9857e202015-05-13 17:09:26 -07001077 * Init form fill environment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001078 * Comments:
Tom Sepez9857e202015-05-13 17:09:26 -07001079 * This function should be called before any form fill operation.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001080 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001081 * document - Handle to document. Returned by
1082 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001083 * pFormFillInfo - Pointer to a FPDF_FORMFILLINFO structure.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001084 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001085 * Return handler to the form fill module. NULL means fails.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001086 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001087FPDF_EXPORT FPDF_FORMHANDLE FPDF_CALLCONV
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001088FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document,
1089 FPDF_FORMFILLINFO* formInfo);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001090
1091/**
Bo Xu2b7a49d2014-11-14 17:40:50 -08001092 * Function: FPDFDOC_ExitFormFillEnvironment
Tom Sepez9857e202015-05-13 17:09:26 -07001093 * Exit form fill environment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001094 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001095 * hHandle - Handle to the form fill module. Returned by
1096 *FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001097 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001098 * NULL.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001099 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001100FPDF_EXPORT void FPDF_CALLCONV
1101FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001102
1103/**
1104 * Function: FORM_OnAfterLoadPage
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001105 * This method is required for implementing all the form related
1106 *functions. Should be invoked after user
1107 * successfully loaded a PDF page, and method
1108 *FPDFDOC_InitFormFillEnvironment had been invoked.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001109 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001110 * hHandle - Handle to the form fill module. Returned by
1111 *FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001112 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001113 * NONE.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001114 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001115FPDF_EXPORT void FPDF_CALLCONV FORM_OnAfterLoadPage(FPDF_PAGE page,
1116 FPDF_FORMHANDLE hHandle);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001117
1118/**
1119 * Function: FORM_OnBeforeClosePage
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001120 * This method is required for implementing all the form related
1121 *functions. Should be invoked before user
Tom Sepez9857e202015-05-13 17:09:26 -07001122 * close the PDF page.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001123 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001124 * page - Handle to the page. Returned by FPDF_LoadPage
1125 *function.
1126 * hHandle - Handle to the form fill module. Returned by
1127 *FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001128 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001129 * NONE.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001130 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001131FPDF_EXPORT void FPDF_CALLCONV FORM_OnBeforeClosePage(FPDF_PAGE page,
1132 FPDF_FORMHANDLE hHandle);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001133
1134/**
1135* Function: FORM_DoDocumentJSAction
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001136* This method is required for performing Document-level JavaScript
1137*action. It should be invoked after the PDF document
Tom Sepez9857e202015-05-13 17:09:26 -07001138* had been loaded.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001139* Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001140* hHandle - Handle to the form fill module. Returned by
1141*FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001142* Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001143* NONE
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001144* Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001145* If there is Document-level JavaScript action embedded in the
1146*document, this method will execute the javascript action;
Tom Sepez9857e202015-05-13 17:09:26 -07001147* otherwise, the method will do nothing.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001148**/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001149FPDF_EXPORT void FPDF_CALLCONV FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001150
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001151/**
1152* Function: FORM_DoDocumentOpenAction
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001153* This method is required for performing open-action when the document
1154*is opened.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001155* Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001156* hHandle - Handle to the form fill module. Returned by
1157*FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001158* Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001159* NONE
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001160* Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001161* This method will do nothing if there is no open-actions embedded in
1162*the document.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001163**/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001164FPDF_EXPORT void FPDF_CALLCONV
1165FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001166
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001167// additional actions type of document.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001168#define FPDFDOC_AACTION_WC \
1169 0x10 // WC, before closing document, JavaScript action.
1170#define FPDFDOC_AACTION_WS \
1171 0x11 // WS, before saving document, JavaScript action.
1172#define FPDFDOC_AACTION_DS 0x12 // DS, after saving document, JavaScript
1173 // action.
1174#define FPDFDOC_AACTION_WP \
1175 0x13 // WP, before printing document, JavaScript action.
1176#define FPDFDOC_AACTION_DP \
1177 0x14 // DP, after printing document, JavaScript action.
Nico Weber077f1a32015-08-06 15:08:57 -07001178
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001179/**
1180* Function: FORM_DoDocumentAAction
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001181* This method is required for performing the document's
1182*additional-action.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001183* Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001184* hHandle - Handle to the form fill module. Returned by
1185*FPDFDOC_InitFormFillEnvironment.
1186* aaType - The type of the additional-actions which defined
1187*above.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001188* Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001189* NONE
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001190* Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001191* This method will do nothing if there is no document
1192*additional-action corresponding to the specified aaType.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001193**/
1194
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001195FPDF_EXPORT void FPDF_CALLCONV FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle,
1196 int aaType);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001197
1198// Additional-action types of page object
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001199#define FPDFPAGE_AACTION_OPEN \
1200 0 // /O -- An action to be performed when the page is opened
1201#define FPDFPAGE_AACTION_CLOSE \
1202 1 // /C -- An action to be performed when the page is closed
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001203
1204/**
1205* Function: FORM_DoPageAAction
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001206* This method is required for performing the page object's
1207*additional-action when opened or closed.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001208* Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001209* page - Handle to the page. Returned by FPDF_LoadPage
1210*function.
1211* hHandle - Handle to the form fill module. Returned by
1212*FPDFDOC_InitFormFillEnvironment.
1213* aaType - The type of the page object's additional-actions
1214*which defined above.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001215* Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001216* NONE
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001217* Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001218* This method will do nothing if no additional-action corresponding to
1219*the specified aaType exists.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001220**/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001221FPDF_EXPORT void FPDF_CALLCONV FORM_DoPageAAction(FPDF_PAGE page,
1222 FPDF_FORMHANDLE hHandle,
1223 int aaType);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001224
1225/**
1226 * Function: FORM_OnMouseMove
Tom Sepez9857e202015-05-13 17:09:26 -07001227 * You can call this member function when the mouse cursor moves.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001228 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001229 * hHandle - Handle to the form fill module. Returned by
1230 *FPDFDOC_InitFormFillEnvironment.
1231 * page - Handle to the page. Returned by FPDF_LoadPage
1232 *function.
Tom Sepez9857e202015-05-13 17:09:26 -07001233 * modifier - Indicates whether various virtual keys are down.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001234 * page_x - Specifies the x-coordinate of the cursor in PDF user
1235 *space.
1236 * page_y - Specifies the y-coordinate of the cursor in PDF user
1237 *space.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001238 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001239 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001240 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001241FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnMouseMove(FPDF_FORMHANDLE hHandle,
1242 FPDF_PAGE page,
1243 int modifier,
1244 double page_x,
1245 double page_y);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001246
1247/**
Lei Zhang63b01262017-08-31 08:54:46 -07001248 * Function: FORM_OnFocus
1249 * This function focuses the form annotation at a given point. If the
1250 * annotation at the point already has focus, nothing happens. If there
1251 * is no annotation at the point, remove form focus.
1252 * Parameters:
1253 * hHandle - Handle to the form fill module. Returned by
1254 * FPDFDOC_InitFormFillEnvironment.
1255 * page - Handle to the page. Returned by FPDF_LoadPage.
1256 * modifier - Indicates whether various virtual keys are down.
1257 * page_x - Specifies the x-coordinate of the cursor in PDF user
1258 * space.
1259 * page_y - Specifies the y-coordinate of the cursor in PDF user
1260 * space.
1261 * Return Value:
1262 * TRUE if there is an annotation at the given point and it has focus.
1263 **/
1264FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnFocus(FPDF_FORMHANDLE hHandle,
1265 FPDF_PAGE page,
1266 int modifier,
1267 double page_x,
1268 double page_y);
1269
1270/**
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001271 * Function: FORM_OnLButtonDown
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001272 * You can call this member function when the user presses the left
1273 *mouse button.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001274 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001275 * hHandle - Handle to the form fill module. Returned by
1276 *FPDFDOC_InitFormFillEnvironment.
1277 * page - Handle to the page. Returned by FPDF_LoadPage
1278 *function.
Tom Sepez9857e202015-05-13 17:09:26 -07001279 * modifier - Indicates whether various virtual keys are down.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001280 * page_x - Specifies the x-coordinate of the cursor in PDF user
1281 *space.
1282 * page_y - Specifies the y-coordinate of the cursor in PDF user
1283 *space.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001284 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001285 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001286 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001287FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle,
1288 FPDF_PAGE page,
1289 int modifier,
1290 double page_x,
1291 double page_y);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001292
1293/**
1294 * Function: FORM_OnLButtonUp
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001295 * You can call this member function when the user releases the left
1296 *mouse button.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001297 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001298 * hHandle - Handle to the form fill module. Returned by
1299 *FPDFDOC_InitFormFillEnvironment.
1300 * page - Handle to the page. Returned by FPDF_LoadPage
1301 *function.
Tom Sepez9857e202015-05-13 17:09:26 -07001302 * modifier - Indicates whether various virtual keys are down.
1303 * page_x - Specifies the x-coordinate of the cursor in device.
1304 * page_y - Specifies the y-coordinate of the cursor in device.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001305 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001306 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001307 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001308FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle,
1309 FPDF_PAGE page,
1310 int modifier,
1311 double page_x,
1312 double page_y);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001313
Tom Sepezc46d0002015-11-30 15:46:36 -08001314#ifdef PDF_ENABLE_XFA
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001315FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle,
1316 FPDF_PAGE page,
1317 int modifier,
1318 double page_x,
1319 double page_y);
1320FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle,
1321 FPDF_PAGE page,
1322 int modifier,
1323 double page_x,
1324 double page_y);
Tom Sepezc46d0002015-11-30 15:46:36 -08001325#endif // PDF_ENABLE_XFA
Bo Xufdc00a72014-10-28 23:03:33 -07001326
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001327/**
1328 * Function: FORM_OnKeyDown
Tom Sepez9857e202015-05-13 17:09:26 -07001329 * You can call this member function when a nonsystem key is pressed.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001330 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001331 * hHandle - Handle to the form fill module. Returned by
1332 *FPDFDOC_InitFormFillEnvironment.
1333 * page - Handle to the page. Returned by FPDF_LoadPage
1334 *function.
Tom Sepez9857e202015-05-13 17:09:26 -07001335 * nKeyCode - Indicates whether various virtual keys are down.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001336 * modifier - Contains the scan code, key-transition code,
1337 *previous key state, and context code.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001338 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001339 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001340 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001341FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnKeyDown(FPDF_FORMHANDLE hHandle,
1342 FPDF_PAGE page,
1343 int nKeyCode,
1344 int modifier);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001345
1346/**
1347 * Function: FORM_OnKeyUp
Tom Sepez9857e202015-05-13 17:09:26 -07001348 * You can call this member function when a nonsystem key is released.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001349 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001350 * hHandle - Handle to the form fill module. Returned by
1351 *FPDFDOC_InitFormFillEnvironment.
1352 * page - Handle to the page. Returned by FPDF_LoadPage
1353 *function.
Tom Sepez9857e202015-05-13 17:09:26 -07001354 * nKeyCode - The virtual-key code of the given key.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001355 * modifier - Contains the scan code, key-transition code,
1356 *previous key state, and context code.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001357 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001358 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001359 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001360FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnKeyUp(FPDF_FORMHANDLE hHandle,
1361 FPDF_PAGE page,
1362 int nKeyCode,
1363 int modifier);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001364
1365/**
1366 * Function: FORM_OnChar
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001367 * You can call this member function when a keystroke translates to a
1368 *nonsystem character.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001369 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001370 * hHandle - Handle to the form fill module. Returned by
1371 *FPDFDOC_InitFormFillEnvironment.
1372 * page - Handle to the page. Returned by FPDF_LoadPage
1373 *function.
Tom Sepez9857e202015-05-13 17:09:26 -07001374 * nChar - The character code value of the key.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001375 * modifier - Contains the scan code, key-transition code,
1376 *previous key state, and context code.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001377 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001378 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001379 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001380FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FORM_OnChar(FPDF_FORMHANDLE hHandle,
1381 FPDF_PAGE page,
1382 int nChar,
1383 int modifier);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001384
1385/**
Diana Gagedce2d722017-06-20 11:17:11 -07001386 * Function: FORM_GetSelectedText
1387 * You can call this function to obtain selected text within
1388 * a form text field or form combobox text field.
1389 * Parameters:
1390 * hHandle - Handle to the form fill module. Returned by
1391 * FPDFDOC_InitFormFillEnvironment.
1392 * page - Handle to the page. Returned by FPDF_LoadPage
1393 * function.
1394 * buffer - Buffer for holding the selected text, encoded
1395 * in UTF16-LE. If NULL, |buffer| is not modified.
1396 * buflen - Length of |buffer| in bytes. If |buflen|
1397 is less than the length of the selected text
1398 string, |buffer| is not modified.
1399 * Return Value:
1400 * Length in bytes of selected text in form text field or form combobox
1401 * text field.
1402 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001403FPDF_EXPORT unsigned long FPDF_CALLCONV
1404FORM_GetSelectedText(FPDF_FORMHANDLE hHandle,
1405 FPDF_PAGE page,
1406 void* buffer,
1407 unsigned long buflen);
Diana Gagedce2d722017-06-20 11:17:11 -07001408
1409/**
Diana Gageab390972017-07-28 17:07:39 -07001410 * Function: FORM_ReplaceSelection
1411 * You can call this function to replace the selected text in a form
1412 * text field or user-editable form combobox text field with another
1413 * text string (which can be empty or non-empty). If there is no
1414 * selected text, this function will append the replacement text after
1415 * the current caret position.
Diana Gage1c7f1422017-07-24 11:19:52 -07001416 * Parameters:
1417 * hHandle - Handle to the form fill module. Returned by
1418 * FPDFDOC_InitFormFillEnvironment.
1419 * page - Handle to the page. Returned by FPDF_LoadPage
1420 * function.
Diana Gageab390972017-07-28 17:07:39 -07001421 * wsText - The text to be inserted, in UTF-16LE format.
Diana Gage1c7f1422017-07-24 11:19:52 -07001422 * Return Value:
1423 * None.
1424 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001425FPDF_EXPORT void FPDF_CALLCONV FORM_ReplaceSelection(FPDF_FORMHANDLE hHandle,
1426 FPDF_PAGE page,
1427 FPDF_WIDESTRING wsText);
Diana Gage1c7f1422017-07-24 11:19:52 -07001428
1429/**
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001430 * Function: FORM_ForceToKillFocus.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001431 * You can call this member function to force to kill the focus of the
1432 *form field which got focus.
1433 * It would kill the focus on the form field, save the value of form
1434 *field if it's changed by user.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001435 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001436 * hHandle - Handle to the form fill module. Returned by
1437 *FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001438 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001439 * TRUE indicates success; otherwise false.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001440 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001441FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
1442FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001443
Ryan Harrison9baf31f2018-01-12 18:36:30 +00001444// Form Field Types
1445// The names of the defines are stable, but the specific values associated with
1446// them are not, so do not hardcode their values.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001447#define FPDF_FORMFIELD_UNKNOWN 0 // Unknown.
1448#define FPDF_FORMFIELD_PUSHBUTTON 1 // push button type.
1449#define FPDF_FORMFIELD_CHECKBOX 2 // check box type.
1450#define FPDF_FORMFIELD_RADIOBUTTON 3 // radio button type.
1451#define FPDF_FORMFIELD_COMBOBOX 4 // combo box type.
1452#define FPDF_FORMFIELD_LISTBOX 5 // list box type.
1453#define FPDF_FORMFIELD_TEXTFIELD 6 // text field type.
Ryan Harrison9baf31f2018-01-12 18:36:30 +00001454#define FPDF_FORMFIELD_SIGNATURE 7 // text field type.
Tom Sepezc46d0002015-11-30 15:46:36 -08001455#ifdef PDF_ENABLE_XFA
Ryan Harrison9baf31f2018-01-12 18:36:30 +00001456#define FPDF_FORMFIELD_XFA 8 // Generic XFA type.
1457#endif // PDF_ENABLE_XFA
1458
1459#ifndef PDF_ENABLE_XFA
1460#define FPDF_FORMFIELD_COUNT 8
1461#else
1462#define FPDF_FORMFIELD_COUNT 9
Tom Sepezc46d0002015-11-30 15:46:36 -08001463#endif // PDF_ENABLE_XFA
Tom Sepez9857e202015-05-13 17:09:26 -07001464
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001465/**
Lei Zhangbdf72c32015-08-14 19:24:08 -07001466 * Function: FPDFPage_HasFormFieldAtPoint
1467 * Get the form field type by point.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001468 * Parameters:
Lei Zhangbdf72c32015-08-14 19:24:08 -07001469 * hHandle - Handle to the form fill module. Returned by
1470 * FPDFDOC_InitFormFillEnvironment().
1471 * page - Handle to the page. Returned by FPDF_LoadPage().
1472 * page_x - X position in PDF "user space".
1473 * page_y - Y position in PDF "user space".
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001474 * Return Value:
Lei Zhangbdf72c32015-08-14 19:24:08 -07001475 * Return the type of the form field; -1 indicates no field.
1476 * See field types above.
1477 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001478FPDF_EXPORT int FPDF_CALLCONV
1479FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
1480 FPDF_PAGE page,
1481 double page_x,
1482 double page_y);
Lei Zhangbdf72c32015-08-14 19:24:08 -07001483
1484/**
Lei Zhangbdf72c32015-08-14 19:24:08 -07001485 * Function: FPDFPage_FormFieldZOrderAtPoint
1486 * Get the form field z-order by point.
1487 * Parameters:
1488 * hHandle - Handle to the form fill module. Returned by
1489 * FPDFDOC_InitFormFillEnvironment().
1490 * page - Handle to the page. Returned by FPDF_LoadPage().
1491 * page_x - X position in PDF "user space".
1492 * page_y - Y position in PDF "user space".
1493 * Return Value:
1494 * Return the z-order of the form field; -1 indicates no field.
1495 * Higher numbers are closer to the front.
1496 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001497FPDF_EXPORT int FPDF_CALLCONV
1498FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle,
1499 FPDF_PAGE page,
1500 double page_x,
1501 double page_y);
Lei Zhangbdf72c32015-08-14 19:24:08 -07001502
1503/**
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001504 * Function: FPDF_SetFormFieldHighlightColor
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001505 * Set the highlight color of specified or all the form fields in the
1506 *document.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001507 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001508 * hHandle - Handle to the form fill module. Returned by
1509 *FPDFDOC_InitFormFillEnvironment.
1510 * doc - Handle to the document. Returned by
1511 *FPDF_LoadDocument function.
1512 * fieldType - A 32-bit integer indicating the type of a form
1513 *field(defined above).
1514 * color - The highlight color of the form field.Constructed by
1515 *0xxxrrggbb.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001516 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001517 * NONE.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001518 * Comments:
Ryan Harrison9baf31f2018-01-12 18:36:30 +00001519 * When the parameter fieldType is set to FPDF_FORMFIELD_UNKNOWN, the
1520 * highlight color will be applied to all the form fields in the
Tom Sepez9857e202015-05-13 17:09:26 -07001521 * document.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001522 * Please refresh the client window to show the highlight immediately
Ryan Harrison9baf31f2018-01-12 18:36:30 +00001523 * if necessary.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001524 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001525FPDF_EXPORT void FPDF_CALLCONV
1526FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle,
1527 int fieldType,
1528 unsigned long color);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001529
1530/**
1531 * Function: FPDF_SetFormFieldHighlightAlpha
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001532 * Set the transparency of the form field highlight color in the
1533 *document.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001534 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001535 * hHandle - Handle to the form fill module. Returned by
1536 *FPDFDOC_InitFormFillEnvironment.
1537 * doc - Handle to the document. Returned by
1538 *FPDF_LoadDocument function.
1539 * alpha - The transparency of the form field highlight color.
1540 *between 0-255.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001541 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001542 * NONE.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001543 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001544FPDF_EXPORT void FPDF_CALLCONV
1545FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, unsigned char alpha);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001546
1547/**
1548 * Function: FPDF_RemoveFormFieldHighlight
Tom Sepez9857e202015-05-13 17:09:26 -07001549 * Remove the form field highlight color in the document.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001550 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001551 * hHandle - Handle to the form fill module. Returned by
1552 *FPDFDOC_InitFormFillEnvironment.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001553 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001554 * NONE.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001555 * Comments:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001556 * Please refresh the client window to remove the highlight immediately
1557 *if necessary.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001558 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001559FPDF_EXPORT void FPDF_CALLCONV
1560FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001561
1562/**
1563* Function: FPDF_FFLDraw
jaepark75f84a52016-09-09 15:39:09 -07001564* Render FormFields and popup window on a page to a device independent
1565*bitmap.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001566* Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001567* hHandle - Handle to the form fill module. Returned by
1568*FPDFDOC_InitFormFillEnvironment.
1569* bitmap - Handle to the device independent bitmap (as the
1570*output buffer).
1571* Bitmap handle can be created by FPDFBitmap_Create
1572*function.
1573* page - Handle to the page. Returned by FPDF_LoadPage
1574*function.
1575* start_x - Left pixel position of the display area in the
1576*device coordinate.
1577* start_y - Top pixel position of the display area in the device
1578*coordinate.
Tom Sepez9857e202015-05-13 17:09:26 -07001579* size_x - Horizontal size (in pixels) for displaying the page.
1580* size_y - Vertical size (in pixels) for displaying the page.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001581* rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees
1582*clockwise),
1583* 2 (rotated 180 degrees), 3 (rotated 90 degrees
1584*counter-clockwise).
1585* flags - 0 for normal display, or combination of flags
1586*defined above.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001587* Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001588* None.
1589* Comments:
jaepark75f84a52016-09-09 15:39:09 -07001590* This function is designed to render annotations that are
1591*user-interactive, which are widget annotation (for FormFields) and popup
1592*annotation.
1593* With FPDF_ANNOT flag, this function will render popup annotation
1594*when users mouse-hover on non-widget annotation. Regardless of FPDF_ANNOT flag,
1595*this function will always render widget annotations for FormFields.
1596* In order to implement the FormFill functions, implementation should
1597*call this function after rendering functions, such as FPDF_RenderPageBitmap or
1598*FPDF_RenderPageBitmap_Start, finish rendering the page contents.
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001599**/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001600FPDF_EXPORT void FPDF_CALLCONV FPDF_FFLDraw(FPDF_FORMHANDLE hHandle,
1601 FPDF_BITMAP bitmap,
1602 FPDF_PAGE page,
1603 int start_x,
1604 int start_y,
1605 int size_x,
1606 int size_y,
1607 int rotate,
1608 int flags);
Tom Sepezc46d0002015-11-30 15:46:36 -08001609
Cary Clark399be5b2016-03-14 16:51:29 -04001610#ifdef _SKIA_SUPPORT_
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001611FPDF_EXPORT void FPDF_CALLCONV FPDF_FFLRecord(FPDF_FORMHANDLE hHandle,
1612 FPDF_RECORDER recorder,
1613 FPDF_PAGE page,
1614 int start_x,
1615 int start_y,
1616 int size_x,
1617 int size_y,
1618 int rotate,
1619 int flags);
Cary Clark399be5b2016-03-14 16:51:29 -04001620#endif
1621
Jun Fange118ce92015-02-17 06:50:08 -08001622/**
Ryan Harrison854d71c2017-10-18 12:28:14 -04001623 * Experimental API
1624 * Function: FPDF_GetFormType
1625 * Returns the type of form contained in the PDF document.
Jun Fange118ce92015-02-17 06:50:08 -08001626 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001627 * document - Handle to document.
1628 *Returned by FPDF_LoadDocument function.
1629 * docType - Document type defined as
Ryan Harrison854d71c2017-10-18 12:28:14 -04001630 *FORMTYPE_xxx.
Jun Fange118ce92015-02-17 06:50:08 -08001631 * Return Value:
Ryan Harrison854d71c2017-10-18 12:28:14 -04001632 * Integer value representing one of the FORMTYPE_xxx
1633 *values.
Jun Fange118ce92015-02-17 06:50:08 -08001634 **/
Ryan Harrison854d71c2017-10-18 12:28:14 -04001635FPDF_EXPORT int FPDF_CALLCONV FPDF_GetFormType(FPDF_DOCUMENT document);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001636
Ryan Harrisona74a6272017-10-16 10:57:48 -04001637#ifdef PDF_ENABLE_XFA
Bo Xufdc00a72014-10-28 23:03:33 -07001638/**
1639 * Function: FPDF_LoadXFA
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001640 * If the document consists of XFA fields, there should call this
1641 *method to load XFA fields.
Bo Xufdc00a72014-10-28 23:03:33 -07001642 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001643 * document - Handle to document. Returned by
1644 *FPDF_LoadDocument function.
Bo Xufdc00a72014-10-28 23:03:33 -07001645 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001646 * TRUE indicates success,otherwise FALSE.
Bo Xufdc00a72014-10-28 23:03:33 -07001647 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001648FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_LoadXFA(FPDF_DOCUMENT document);
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001649
Bo Xufdc00a72014-10-28 23:03:33 -07001650/**
1651 * Function: FPDF_Widget_Undo
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001652 * This method will implement the undo feature for the specified xfa
1653 *field.
Bo Xufdc00a72014-10-28 23:03:33 -07001654 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001655 * document - Handle to document. Returned by
1656 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001657 * hWidget - Handle to the xfa field.
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 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001661FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Undo(FPDF_DOCUMENT document,
1662 FPDF_WIDGET hWidget);
Bo Xufdc00a72014-10-28 23:03:33 -07001663/**
1664 * Function: FPDF_Widget_Redo
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001665 * This method will implement the redo feature for the specified xfa
1666 *field.
Bo Xufdc00a72014-10-28 23:03:33 -07001667 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001668 * document - Handle to document. Returned by
1669 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001670 * hWidget - Handle to the xfa field.
Bo Xufdc00a72014-10-28 23:03:33 -07001671 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001672 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001673 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001674FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Redo(FPDF_DOCUMENT document,
1675 FPDF_WIDGET hWidget);
Bo Xufdc00a72014-10-28 23:03:33 -07001676/**
1677 * Function: FPDF_Widget_SelectAll
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001678 * This method will implement the select all feature for the specified
1679 *xfa field.
Bo Xufdc00a72014-10-28 23:03:33 -07001680 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001681 * document - Handle to document. Returned by
1682 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001683 * hWidget - Handle to the xfa field.
Bo Xufdc00a72014-10-28 23:03:33 -07001684 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001685 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001686 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001687FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_SelectAll(FPDF_DOCUMENT document,
1688 FPDF_WIDGET hWidget);
Bo Xufdc00a72014-10-28 23:03:33 -07001689/**
1690 * Function: FPDF_Widget_Copy
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001691 * This method will implement the copy feature for the specified xfa
1692 *field.
Bo Xufdc00a72014-10-28 23:03:33 -07001693 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001694 * document - Handle to document. Returned by
1695 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001696 * hWidget - Handle to the xfa field.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001697 * wsText - Pointer to data buffer to receive the copied
1698 *data, in UTF-16LE format.
Tom Sepez9857e202015-05-13 17:09:26 -07001699 * size - The data buffer size.
Bo Xufdc00a72014-10-28 23:03:33 -07001700 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001701 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001702 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001703FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Copy(FPDF_DOCUMENT document,
1704 FPDF_WIDGET hWidget,
1705 FPDF_WIDESTRING wsText,
1706 FPDF_DWORD* size);
Bo Xufdc00a72014-10-28 23:03:33 -07001707/**
1708 * Function: FPDF_Widget_Cut
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001709 * This method will implement the cut feature for the specified xfa
1710 *field.
Bo Xufdc00a72014-10-28 23:03:33 -07001711 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001712 * document - Handle to document. Returned by
1713 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001714 * hWidget - Handle to the xfa field.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001715 * wsText - Pointer to data buffer to receive the cut
1716 *data,in UTF-16LE format.
Tom Sepez9857e202015-05-13 17:09:26 -07001717 * size - The data buffer size,not the byte number.
Bo Xufdc00a72014-10-28 23:03:33 -07001718 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001719 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001720 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001721FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Cut(FPDF_DOCUMENT document,
1722 FPDF_WIDGET hWidget,
1723 FPDF_WIDESTRING wsText,
1724 FPDF_DWORD* size);
Bo Xufdc00a72014-10-28 23:03:33 -07001725/**
1726 * Function: FPDF_Widget_Paste
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001727 * This method will implement the paste feature for the specified xfa
1728 *field.
Bo Xufdc00a72014-10-28 23:03:33 -07001729 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001730 * document - Handle to document. Returned by
1731 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001732 * hWidget - Handle to the xfa field.
1733 * wsText - The paste text buffer, in UTF-16LE format.
1734 * size - The data buffer size,not the byte number.
Bo Xufdc00a72014-10-28 23:03:33 -07001735 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001736 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001737 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001738FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Paste(FPDF_DOCUMENT document,
1739 FPDF_WIDGET hWidget,
1740 FPDF_WIDESTRING wsText,
1741 FPDF_DWORD size);
Bo Xufdc00a72014-10-28 23:03:33 -07001742/**
1743 * Function: FPDF_Widget_ReplaceSpellCheckWord
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001744 * This method will implement the spell check feature for the specified
1745 *xfa field.
Bo Xufdc00a72014-10-28 23:03:33 -07001746 * Parameters:
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001747 * document - Handle to document. Returned by
1748 *FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001749 * hWidget - Handle to the xfa field.
1750 * x - The x value of the specified point.
1751 * y - The y value of the specified point.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001752 * bsText - The text buffer needed to be speck check, in
1753 *UTF-16LE format.
Bo Xufdc00a72014-10-28 23:03:33 -07001754 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001755 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001756 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001757FPDF_EXPORT void FPDF_CALLCONV
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001758FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document,
1759 FPDF_WIDGET hWidget,
1760 float x,
1761 float y,
1762 FPDF_BYTESTRING bsText);
Bo Xufdc00a72014-10-28 23:03:33 -07001763/**
1764 * Function: FPDF_Widget_GetSpellCheckWords
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001765 * This method will implement the spell check feature for the specified
Tom Sepezfe91c6c2017-05-16 15:33:20 -07001766 * xfa field.
Bo Xufdc00a72014-10-28 23:03:33 -07001767 * Parameters:
Tom Sepezfe91c6c2017-05-16 15:33:20 -07001768 * document - Handle to document as returned by
1769 * FPDF_LoadDocument function.
Tom Sepez9857e202015-05-13 17:09:26 -07001770 * hWidget - Handle to the xfa field.
1771 * x - The x value of the specified point.
1772 * y - The y value of the specified point.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001773 * stringHandle - Pointer to FPDF_STRINGHANDLE to receive the
Tom Sepezfe91c6c2017-05-16 15:33:20 -07001774 * speck check text buffer, in UTF-16LE format.
1775 * Caller must free using FPDF_StringHandleRelease.
Bo Xufdc00a72014-10-28 23:03:33 -07001776 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001777 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001778 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001779FPDF_EXPORT void FPDF_CALLCONV
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001780FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document,
1781 FPDF_WIDGET hWidget,
1782 float x,
1783 float y,
1784 FPDF_STRINGHANDLE* stringHandle);
Bo Xufdc00a72014-10-28 23:03:33 -07001785/**
1786 * Function: FPDF_StringHandleCounts
Tom Sepez9857e202015-05-13 17:09:26 -07001787 * This method will get the count of the text buffer.
Bo Xufdc00a72014-10-28 23:03:33 -07001788 * Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -07001789 * stringHandle - Pointer to FPDF_STRINGHANDLE.
Bo Xufdc00a72014-10-28 23:03:33 -07001790 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001791 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001792 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001793FPDF_EXPORT int FPDF_CALLCONV
1794FPDF_StringHandleCounts(FPDF_STRINGHANDLE stringHandle);
Bo Xufdc00a72014-10-28 23:03:33 -07001795/**
1796 * Function: FPDF_StringHandleGetStringByIndex
Tom Sepez9857e202015-05-13 17:09:26 -07001797 * This method will get the specified index of the text buffer.
Bo Xufdc00a72014-10-28 23:03:33 -07001798 * Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -07001799 * stringHandle - Pointer to FPDF_STRINGHANDLE.
1800 * index - The specified index of text buffer.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001801 * bsText - Pointer to data buffer to receive the text
1802 *buffer, in UTF-16LE format.
Tom Sepez9857e202015-05-13 17:09:26 -07001803 * size - The byte size of data buffer.
Bo Xufdc00a72014-10-28 23:03:33 -07001804 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001805 * TRUE indicates success, otherwise FALSE.
Bo Xufdc00a72014-10-28 23:03:33 -07001806 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001807FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001808FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE stringHandle,
1809 int index,
1810 FPDF_BYTESTRING bsText,
1811 FPDF_DWORD* size);
Bo Xufdc00a72014-10-28 23:03:33 -07001812/**
1813 * Function: FPDF_StringHandleRelease
Tom Sepez9857e202015-05-13 17:09:26 -07001814 * This method will release the FPDF_STRINGHANDLE.
Bo Xufdc00a72014-10-28 23:03:33 -07001815 * Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -07001816 * stringHandle - Pointer to FPDF_STRINGHANDLE.
Bo Xufdc00a72014-10-28 23:03:33 -07001817 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001818 * None.
Bo Xufdc00a72014-10-28 23:03:33 -07001819 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001820FPDF_EXPORT void FPDF_CALLCONV
1821FPDF_StringHandleRelease(FPDF_STRINGHANDLE stringHandle);
Bo Xufdc00a72014-10-28 23:03:33 -07001822/**
1823 * Function: FPDF_StringHandleAddString
Tom Sepez9857e202015-05-13 17:09:26 -07001824 * This method will add the specified text buffer.
Bo Xufdc00a72014-10-28 23:03:33 -07001825 * Parameters:
Tom Sepez9857e202015-05-13 17:09:26 -07001826 * stringHandle - Pointer to FPDF_STRINGHANDLE.
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001827 * bsText - Pointer to data buffer of the text buffer, in
1828 *UTF-16LE format.
Tom Sepez9857e202015-05-13 17:09:26 -07001829 * size - The byte size of data buffer.
Bo Xufdc00a72014-10-28 23:03:33 -07001830 * Return Value:
Tom Sepez9857e202015-05-13 17:09:26 -07001831 * TRUE indicates success, otherwise FALSE.
Bo Xufdc00a72014-10-28 23:03:33 -07001832 **/
Dan Sinclair00d2ad12017-08-10 14:13:02 -04001833FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
Nico Weber9d8ec5a2015-08-04 13:00:21 -07001834FPDF_StringHandleAddString(FPDF_STRINGHANDLE stringHandle,
1835 FPDF_BYTESTRING bsText,
1836 FPDF_DWORD size);
Tom Sepezc46d0002015-11-30 15:46:36 -08001837#endif // PDF_ENABLE_XFA
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001838
1839#ifdef __cplusplus
Tom Sepez9857e202015-05-13 17:09:26 -07001840}
John Abd-El-Malek3f3b45c2014-05-23 17:28:10 -07001841#endif
1842
Tom Sepez9857e202015-05-13 17:09:26 -07001843#endif // PUBLIC_FPDF_FORMFILL_H_