John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1 | // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 4 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 7 | #ifndef PUBLIC_FPDF_FORMFILL_H_ |
| 8 | #define PUBLIC_FPDF_FORMFILL_H_ |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 9 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 10 | #include "fpdfview.h" |
| 11 | |
| 12 | typedef void* FPDF_FORMHANDLE; |
| 13 | |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 14 | #ifdef PDF_ENABLE_XFA |
Nico Weber | 077f1a3 | 2015-08-06 15:08:57 -0700 | [diff] [blame] | 15 | #define DOCTYPE_PDF 0 // Normal pdf Document |
Tom Sepez | d3116dc | 2015-11-24 15:58:06 -0800 | [diff] [blame] | 16 | #define DOCTYPE_DYNAMIC_XFA 1 // Dynamic xfa Document Type |
Nico Weber | 077f1a3 | 2015-08-06 15:08:57 -0700 | [diff] [blame] | 17 | #define DOCTYPE_STATIC_XFA 2 // Static xfa Document Type |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 18 | #endif // PDF_ENABLE_XFA |
Jun Fang | e118ce9 | 2015-02-17 06:50:08 -0800 | [diff] [blame] | 19 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 20 | // Exported Functions |
| 21 | #ifdef __cplusplus |
| 22 | extern "C" { |
| 23 | #endif |
| 24 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 25 | typedef struct _IPDF_JsPlatform { |
| 26 | /** |
| 27 | * Version number of the interface. Currently must be 2. |
| 28 | **/ |
| 29 | int version; |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 30 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 31 | /* Version 1. */ |
Jochen Eisinger | 06b6002 | 2015-07-30 17:44:35 +0200 | [diff] [blame] | 32 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 33 | /** |
| 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 Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 55 | * 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 Sepez | 621d4de | 2014-07-29 14:01:21 -0700 | [diff] [blame] | 67 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 68 | /** |
| 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 87 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 88 | /** |
| 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 131 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 132 | /* |
| 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 159 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 160 | /* |
| 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 201 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 202 | /* |
| 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 235 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 236 | /* |
| 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 257 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 258 | /* |
| 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 295 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 296 | /** |
| 297 | * pointer to FPDF_FORMFILLINFO interface. |
| 298 | **/ |
| 299 | void* m_pFormfillinfo; |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 300 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 301 | /* Version 2. */ |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 302 | |
Tom Sepez | a72e8e2 | 2015-10-07 10:17:53 -0700 | [diff] [blame] | 303 | void* m_isolate; /* Unused in v3, retain for compatibility. */ |
| 304 | unsigned int m_v8EmbedderSlot; /* Unused in v3, retain for compatibility. */ |
Jochen Eisinger | 06b6002 | 2015-07-30 17:44:35 +0200 | [diff] [blame] | 305 | |
Tom Sepez | a72e8e2 | 2015-10-07 10:17:53 -0700 | [diff] [blame] | 306 | /* Version 3. */ |
| 307 | /* Version 3 moves m_Isolate and m_v8EmbedderSlot to FPDF_LIBRARY_CONFIG. */ |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 308 | } IPDF_JSPLATFORM; |
| 309 | |
| 310 | // Flags for Cursor type |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 311 | #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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 317 | |
| 318 | /** |
tsepez | 8e12029 | 2016-08-03 14:03:35 -0700 | [diff] [blame] | 319 | * Function signature for the callback function passed to the FFI_SetTimer |
| 320 | * method. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 321 | * Parameters: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 322 | * idEvent - Identifier of the timer. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 323 | * Return value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 324 | * None. |
| 325 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 326 | typedef void (*TimerCallback)(int idEvent); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 327 | |
| 328 | /** |
| 329 | * Declares of a struct type to the local system time. |
| 330 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 331 | typedef 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 341 | |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 342 | #ifdef PDF_ENABLE_XFA |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 343 | // XFA |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 344 | /** |
| 345 | * @name Pageview event flags |
| 346 | */ |
| 347 | /*@{*/ |
| 348 | /** @brief After a new pageview is added. */ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 349 | #define FXFA_PAGEVIEWEVENT_POSTADDED 1 |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 350 | /** @brief After a pageview is removed. */ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 351 | #define FXFA_PAGEVIEWEVENT_POSTREMOVED 3 |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 352 | /*@}*/ |
| 353 | |
| 354 | // menu |
| 355 | /** |
| 356 | * @name Macro Definitions for Right Context Menu Features Of XFA Fields |
| 357 | */ |
| 358 | /*@{*/ |
dsinclair | f2662c4 | 2016-09-14 06:23:48 -0700 | [diff] [blame^] | 359 | #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 Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 365 | /*@}*/ |
| 366 | |
| 367 | // file type |
| 368 | /** |
| 369 | * @name Macro Definitions for File Type. |
| 370 | */ |
| 371 | /*@{*/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 372 | #define FXFA_SAVEAS_XML 1 |
| 373 | #define FXFA_SAVEAS_XDP 2 |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 374 | /*@}*/ |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 375 | #endif // PDF_ENABLE_XFA |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 376 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 377 | typedef struct _FPDF_FORMFILLINFO { |
| 378 | /** |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 379 | * 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 Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 381 | **/ |
| 382 | int version; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 383 | |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 384 | /* Version 1. */ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 385 | /** |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 386 | *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 Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 400 | void (*Release)(struct _FPDF_FORMFILLINFO* pThis); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 401 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 402 | /** |
| 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 435 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 436 | /** |
| 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 474 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 475 | /** |
| 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 490 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 491 | /** |
| 492 | * Method: FFI_SetTimer |
tsepez | 8e12029 | 2016-08-03 14:03:35 -0700 | [diff] [blame] | 493 | * 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 Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 496 | * Interface Version: |
tsepez | 8e12029 | 2016-08-03 14:03:35 -0700 | [diff] [blame] | 497 | * 1 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 498 | * Implementation Required: |
tsepez | 8e12029 | 2016-08-03 14:03:35 -0700 | [diff] [blame] | 499 | * yes |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 500 | * 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. |
tsepez | 8e12029 | 2016-08-03 14:03:35 -0700 | [diff] [blame] | 504 | * Return value: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 505 | * 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 512 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 513 | /** |
| 514 | * Method: FFI_KillTimer |
tsepez | 8e12029 | 2016-08-03 14:03:35 -0700 | [diff] [blame] | 515 | * This method uninstalls a system timer identified by nIDEvent, as |
| 516 | * set by an earlier call to FFI_SetTimer. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 517 | * Interface Version: |
tsepez | 8e12029 | 2016-08-03 14:03:35 -0700 | [diff] [blame] | 518 | * 1 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 519 | * Implementation Required: |
tsepez | 8e12029 | 2016-08-03 14:03:35 -0700 | [diff] [blame] | 520 | * yes |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 521 | * Parameters: |
| 522 | * pThis - Pointer to the interface structure itself. |
tsepez | 8e12029 | 2016-08-03 14:03:35 -0700 | [diff] [blame] | 523 | * nTimerID - The timer ID returned by FFI_SetTimer function. |
| 524 | * Return value: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 525 | * None. |
| 526 | * */ |
| 527 | void (*FFI_KillTimer)(struct _FPDF_FORMFILLINFO* pThis, int nTimerID); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 528 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 529 | /** |
| 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 542 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 543 | /** |
| 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 557 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 558 | /** |
| 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 Sinclair | 3ebd121 | 2016-03-09 09:59:23 -0500 | [diff] [blame] | 579 | FPDF_PAGE (*FFI_GetPage)(struct _FPDF_FORMFILLINFO* pThis, |
| 580 | FPDF_DOCUMENT document, |
| 581 | int nPageIndex); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 582 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 583 | /** |
| 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 Sinclair | 3ebd121 | 2016-03-09 09:59:23 -0500 | [diff] [blame] | 597 | FPDF_PAGE (*FFI_GetCurrentPage)(struct _FPDF_FORMFILLINFO* pThis, |
| 598 | FPDF_DOCUMENT document); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 599 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 600 | /** |
| 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 615 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 616 | /** |
| 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 655 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 656 | /** |
| 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 675 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 676 | /** |
| 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. |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 686 | * zoomMode - The zoom mode for viewing page. See below. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 687 | * fPosArray - The float array which carries the position info. |
| 688 | * sizeofArray - The size of float array. |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 689 | * |
| 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 Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 700 | * 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 Xu | bb5ef88 | 2014-11-06 16:13:33 -0800 | [diff] [blame] | 711 | |
| 712 | /** |
| 713 | * pointer to IPDF_JSPLATFORM interface |
| 714 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 715 | IPDF_JSPLATFORM* m_pJsPlatform; |
Bo Xu | bb5ef88 | 2014-11-06 16:13:33 -0800 | [diff] [blame] | 716 | |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 717 | #ifdef PDF_ENABLE_XFA |
| 718 | /* Version 2. */ |
Bo Xu | bb5ef88 | 2014-11-06 16:13:33 -0800 | [diff] [blame] | 719 | /** |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 720 | * Method: FFI_DisplayCaret |
| 721 | * This method will show the caret at specified position. |
| 722 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 723 | * 2 |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 724 | * Implementation Required: |
| 725 | * yes |
| 726 | * Parameters: |
| 727 | * pThis - Pointer to the interface structure itself. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 728 | * 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 738 | * Return value: |
| 739 | * None. |
| 740 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 741 | 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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 748 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 749 | /** |
| 750 | * Method: FFI_GetCurrentPageIndex |
| 751 | * This method will get the current page index. |
| 752 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 753 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 754 | * 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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 765 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 766 | /** |
| 767 | * Method: FFI_SetCurrentPage |
| 768 | * This method will set the current page. |
| 769 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 770 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 771 | * 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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 784 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 785 | /** |
| 786 | * Method: FFI_GotoURL |
| 787 | * This method will link to the specified URL. |
| 788 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 789 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 790 | * 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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 803 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 804 | /** |
| 805 | * Method: FFI_GetPageViewRect |
| 806 | * This method will get the current page view rectangle. |
| 807 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 808 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 809 | * 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 Zhang | 84e5a12 | 2016-02-19 14:25:10 -0800 | [diff] [blame] | 832 | |
| 833 | /** |
| 834 | * Method: FFI_PageEvent |
jinming_wang | a1cef70 | 2016-03-18 16:35:40 +0800 | [diff] [blame] | 835 | * This method fires when pages have been added to or deleted from the XFA |
| 836 | * document. |
Lei Zhang | 84e5a12 | 2016-02-19 14:25:10 -0800 | [diff] [blame] | 837 | * Interface Version: |
| 838 | * 2 |
| 839 | * Implementation Required: |
| 840 | * yes |
| 841 | * Parameters: |
| 842 | * pThis - Pointer to the interface structure itself. |
jinming_wang | a1cef70 | 2016-03-18 16:35:40 +0800 | [diff] [blame] | 843 | * page_count - The number of pages to be added to or deleted from the |
| 844 | * document. |
Lei Zhang | 84e5a12 | 2016-02-19 14:25:10 -0800 | [diff] [blame] | 845 | * event_type - See FXFA_PAGEVIEWEVENT_* above. |
| 846 | * Return value: |
| 847 | * None. |
jinming_wang | a1cef70 | 2016-03-18 16:35:40 +0800 | [diff] [blame] | 848 | * 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 Zhang | 84e5a12 | 2016-02-19 14:25:10 -0800 | [diff] [blame] | 855 | **/ |
| 856 | void (*FFI_PageEvent)(struct _FPDF_FORMFILLINFO* pThis, |
jinming_wang | a1cef70 | 2016-03-18 16:35:40 +0800 | [diff] [blame] | 857 | int page_count, |
Lei Zhang | 84e5a12 | 2016-02-19 14:25:10 -0800 | [diff] [blame] | 858 | FPDF_DWORD event_type); |
| 859 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 860 | /** |
| 861 | * Method: FFI_PopupMenu |
| 862 | * This method will track the right context menu for XFA fields. |
| 863 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 864 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 865 | * 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 |
dsinclair | f2662c4 | 2016-09-14 06:23:48 -0700 | [diff] [blame^] | 873 | *of FXFA_MENU_XXX and this can be one or a combination of these macros. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 874 | * 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 Sinclair | 3ebd121 | 2016-03-09 09:59:23 -0500 | [diff] [blame] | 881 | 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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 887 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 888 | /** |
| 889 | * Method: FFI_OpenFile |
| 890 | * This method will open the specified file with the specified mode. |
| 891 | * Interface Version |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 892 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 893 | * 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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 909 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 910 | /** |
| 911 | * Method: FFI_EmailTo |
| 912 | * This method will email the specified file stream to the specified |
| 913 | *contacter. |
| 914 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 915 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 916 | * 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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 940 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 941 | /** |
| 942 | * Method: FFI_UploadTo |
| 943 | * This method will get upload the specified file stream to the |
| 944 | *specified URL. |
| 945 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 946 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 947 | * 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 962 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 963 | /** |
| 964 | * Method: FFI_GetPlatform |
| 965 | * This method will get the current platform. |
| 966 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 967 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 968 | * 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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 982 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 983 | /** |
| 984 | * Method: FFI_GetLanguage |
| 985 | * This method will get the current language. |
| 986 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 987 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 988 | * 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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 1002 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1003 | /** |
| 1004 | * Method: FFI_DownloadFromURL |
| 1005 | * This method will download the specified file from the URL. |
| 1006 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 1007 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1008 | * 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 Sinclair | 3ebd121 | 2016-03-09 09:59:23 -0500 | [diff] [blame] | 1017 | FPDF_LPFILEHANDLER (*FFI_DownloadFromURL)(struct _FPDF_FORMFILLINFO* pThis, |
| 1018 | FPDF_WIDESTRING URL); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1019 | /** |
| 1020 | * Method: FFI_PostRequestURL |
| 1021 | * This method will post the request to the server URL. |
| 1022 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 1023 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1024 | * 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 Sinclair | 3ebd121 | 2016-03-09 09:59:23 -0500 | [diff] [blame] | 1040 | 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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 1047 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1048 | /** |
| 1049 | * Method: FFI_PutRequestURL |
| 1050 | * This method will put the request to the server URL. |
| 1051 | * Interface Version: |
Jun Fang | c30d5bf | 2016-02-02 18:12:23 -0800 | [diff] [blame] | 1052 | * 2 |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1053 | * 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 Sinclair | 3ebd121 | 2016-03-09 09:59:23 -0500 | [diff] [blame] | 1064 | FPDF_BOOL (*FFI_PutRequestURL)(struct _FPDF_FORMFILLINFO* pThis, |
| 1065 | FPDF_WIDESTRING wsURL, |
| 1066 | FPDF_WIDESTRING wsData, |
| 1067 | FPDF_WIDESTRING wsEncode); |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 1068 | #endif // PDF_ENABLE_XFA |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1069 | } FPDF_FORMFILLINFO; |
| 1070 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1071 | /** |
Bo Xu | 2b7a49d | 2014-11-14 17:40:50 -0800 | [diff] [blame] | 1072 | * Function: FPDFDOC_InitFormFillEnvironment |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1073 | * Init form fill environment. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1074 | * Comments: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1075 | * This function should be called before any form fill operation. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1076 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1077 | * document - Handle to document. Returned by |
| 1078 | *FPDF_LoadDocument function. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1079 | * pFormFillInfo - Pointer to a FPDF_FORMFILLINFO structure. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1080 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1081 | * Return handler to the form fill module. NULL means fails. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1082 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1083 | DLLEXPORT FPDF_FORMHANDLE STDCALL |
| 1084 | FPDFDOC_InitFormFillEnvironment(FPDF_DOCUMENT document, |
| 1085 | FPDF_FORMFILLINFO* formInfo); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1086 | |
| 1087 | /** |
Bo Xu | 2b7a49d | 2014-11-14 17:40:50 -0800 | [diff] [blame] | 1088 | * Function: FPDFDOC_ExitFormFillEnvironment |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1089 | * Exit form fill environment. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1090 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1091 | * hHandle - Handle to the form fill module. Returned by |
| 1092 | *FPDFDOC_InitFormFillEnvironment. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1093 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1094 | * NULL. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1095 | **/ |
Bo Xu | 2b7a49d | 2014-11-14 17:40:50 -0800 | [diff] [blame] | 1096 | DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1097 | |
| 1098 | /** |
| 1099 | * Function: FORM_OnAfterLoadPage |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1100 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1104 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1105 | * hHandle - Handle to the form fill module. Returned by |
| 1106 | *FPDFDOC_InitFormFillEnvironment. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1107 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1108 | * NONE. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1109 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1110 | DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, |
| 1111 | FPDF_FORMHANDLE hHandle); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1112 | |
| 1113 | /** |
| 1114 | * Function: FORM_OnBeforeClosePage |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1115 | * This method is required for implementing all the form related |
| 1116 | *functions. Should be invoked before user |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1117 | * close the PDF page. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1118 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1119 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1123 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1124 | * NONE. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1125 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1126 | DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, |
| 1127 | FPDF_FORMHANDLE hHandle); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1128 | |
| 1129 | /** |
| 1130 | * Function: FORM_DoDocumentJSAction |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1131 | * This method is required for performing Document-level JavaScript |
| 1132 | *action. It should be invoked after the PDF document |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1133 | * had been loaded. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1134 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1135 | * hHandle - Handle to the form fill module. Returned by |
| 1136 | *FPDFDOC_InitFormFillEnvironment. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1137 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1138 | * NONE |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1139 | * Comments: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1140 | * If there is Document-level JavaScript action embedded in the |
| 1141 | *document, this method will execute the javascript action; |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1142 | * otherwise, the method will do nothing. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1143 | **/ |
| 1144 | DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle); |
| 1145 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1146 | /** |
| 1147 | * Function: FORM_DoDocumentOpenAction |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1148 | * This method is required for performing open-action when the document |
| 1149 | *is opened. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1150 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1151 | * hHandle - Handle to the form fill module. Returned by |
| 1152 | *FPDFDOC_InitFormFillEnvironment. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1153 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1154 | * NONE |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1155 | * Comments: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1156 | * This method will do nothing if there is no open-actions embedded in |
| 1157 | *the document. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1158 | **/ |
| 1159 | DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle); |
| 1160 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1161 | // additional actions type of document. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1162 | #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 Weber | 077f1a3 | 2015-08-06 15:08:57 -0700 | [diff] [blame] | 1172 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1173 | /** |
| 1174 | * Function: FORM_DoDocumentAAction |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1175 | * This method is required for performing the document's |
| 1176 | *additional-action. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1177 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1178 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1182 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1183 | * NONE |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1184 | * Comments: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1185 | * This method will do nothing if there is no document |
| 1186 | *additional-action corresponding to the specified aaType. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1187 | **/ |
| 1188 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1189 | DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, |
| 1190 | int aaType); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1191 | |
| 1192 | // Additional-action types of page object |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1193 | #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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1197 | |
| 1198 | /** |
| 1199 | * Function: FORM_DoPageAAction |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1200 | * This method is required for performing the page object's |
| 1201 | *additional-action when opened or closed. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1202 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1203 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1209 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1210 | * NONE |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1211 | * Comments: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1212 | * This method will do nothing if no additional-action corresponding to |
| 1213 | *the specified aaType exists. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1214 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1215 | DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, |
| 1216 | FPDF_FORMHANDLE hHandle, |
| 1217 | int aaType); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1218 | |
| 1219 | /** |
| 1220 | * Function: FORM_OnMouseMove |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1221 | * You can call this member function when the mouse cursor moves. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1222 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1223 | * 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1227 | * modifier - Indicates whether various virtual keys are down. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1228 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1232 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1233 | * TRUE indicates success; otherwise false. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1234 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1235 | DLLEXPORT 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1240 | |
| 1241 | /** |
| 1242 | * Function: FORM_OnLButtonDown |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1243 | * You can call this member function when the user presses the left |
| 1244 | *mouse button. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1245 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1246 | * 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1250 | * modifier - Indicates whether various virtual keys are down. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1251 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1255 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1256 | * TRUE indicates success; otherwise false. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1257 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1258 | DLLEXPORT 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1263 | |
| 1264 | /** |
| 1265 | * Function: FORM_OnLButtonUp |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1266 | * You can call this member function when the user releases the left |
| 1267 | *mouse button. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1268 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1269 | * 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1273 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1276 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1277 | * TRUE indicates success; otherwise false. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1278 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1279 | DLLEXPORT 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1284 | |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 1285 | #ifdef PDF_ENABLE_XFA |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1286 | DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonDown(FPDF_FORMHANDLE hHandle, |
| 1287 | FPDF_PAGE page, |
| 1288 | int modifier, |
| 1289 | double page_x, |
| 1290 | double page_y); |
| 1291 | DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle, |
| 1292 | FPDF_PAGE page, |
| 1293 | int modifier, |
| 1294 | double page_x, |
| 1295 | double page_y); |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 1296 | #endif // PDF_ENABLE_XFA |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1297 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1298 | /** |
| 1299 | * Function: FORM_OnKeyDown |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1300 | * You can call this member function when a nonsystem key is pressed. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1301 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1302 | * 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1306 | * nKeyCode - Indicates whether various virtual keys are down. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1307 | * modifier - Contains the scan code, key-transition code, |
| 1308 | *previous key state, and context code. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1309 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1310 | * TRUE indicates success; otherwise false. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1311 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1312 | DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, |
| 1313 | FPDF_PAGE page, |
| 1314 | int nKeyCode, |
| 1315 | int modifier); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1316 | |
| 1317 | /** |
| 1318 | * Function: FORM_OnKeyUp |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1319 | * You can call this member function when a nonsystem key is released. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1320 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1321 | * 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1325 | * nKeyCode - The virtual-key code of the given key. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1326 | * modifier - Contains the scan code, key-transition code, |
| 1327 | *previous key state, and context code. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1328 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1329 | * TRUE indicates success; otherwise false. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1330 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1331 | DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle, |
| 1332 | FPDF_PAGE page, |
| 1333 | int nKeyCode, |
| 1334 | int modifier); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1335 | |
| 1336 | /** |
| 1337 | * Function: FORM_OnChar |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1338 | * You can call this member function when a keystroke translates to a |
| 1339 | *nonsystem character. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1340 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1341 | * 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1345 | * nChar - The character code value of the key. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1346 | * modifier - Contains the scan code, key-transition code, |
| 1347 | *previous key state, and context code. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1348 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1349 | * TRUE indicates success; otherwise false. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1350 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1351 | DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle, |
| 1352 | FPDF_PAGE page, |
| 1353 | int nChar, |
| 1354 | int modifier); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1355 | |
| 1356 | /** |
| 1357 | * Function: FORM_ForceToKillFocus. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1358 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1362 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1363 | * hHandle - Handle to the form fill module. Returned by |
| 1364 | *FPDFDOC_InitFormFillEnvironment. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1365 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1366 | * TRUE indicates success; otherwise false. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1367 | **/ |
| 1368 | DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle); |
| 1369 | |
| 1370 | // Field Types |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1371 | #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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 1378 | #ifdef PDF_ENABLE_XFA |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1379 | #define FPDF_FORMFIELD_XFA 7 // text field type. |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 1380 | #endif // PDF_ENABLE_XFA |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1381 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1382 | /** |
Lei Zhang | bdf72c3 | 2015-08-14 19:24:08 -0700 | [diff] [blame] | 1383 | * Function: FPDFPage_HasFormFieldAtPoint |
| 1384 | * Get the form field type by point. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1385 | * Parameters: |
Lei Zhang | bdf72c3 | 2015-08-14 19:24:08 -0700 | [diff] [blame] | 1386 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1391 | * Return Value: |
Lei Zhang | bdf72c3 | 2015-08-14 19:24:08 -0700 | [diff] [blame] | 1392 | * Return the type of the form field; -1 indicates no field. |
| 1393 | * See field types above. |
| 1394 | **/ |
| 1395 | DLLEXPORT 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1403 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1404 | DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, |
| 1405 | FPDF_PAGE page, |
| 1406 | double page_x, |
| 1407 | double page_y); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1408 | |
| 1409 | /** |
Lei Zhang | bdf72c3 | 2015-08-14 19:24:08 -0700 | [diff] [blame] | 1410 | * 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 | **/ |
| 1422 | DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle, |
| 1423 | FPDF_PAGE page, |
| 1424 | double page_x, |
| 1425 | double page_y); |
| 1426 | |
| 1427 | /** |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1428 | * Function: FPDF_SetFormFieldHighlightColor |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1429 | * Set the highlight color of specified or all the form fields in the |
| 1430 | *document. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1431 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1432 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1440 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1441 | * NONE. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1442 | * Comments: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1443 | * When the parameter fieldType is set to zero, the highlight color |
| 1444 | *will be applied to all the form fields in the |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1445 | * document. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1446 | * Please refresh the client window to show the highlight immediately |
| 1447 | *if necessary. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1448 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1449 | DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, |
| 1450 | int fieldType, |
| 1451 | unsigned long color); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1452 | |
| 1453 | /** |
| 1454 | * Function: FPDF_SetFormFieldHighlightAlpha |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1455 | * Set the transparency of the form field highlight color in the |
| 1456 | *document. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1457 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1458 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1464 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1465 | * NONE. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1466 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1467 | DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, |
| 1468 | unsigned char alpha); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1469 | |
| 1470 | /** |
| 1471 | * Function: FPDF_RemoveFormFieldHighlight |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1472 | * Remove the form field highlight color in the document. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1473 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1474 | * hHandle - Handle to the form fill module. Returned by |
| 1475 | *FPDFDOC_InitFormFillEnvironment. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1476 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1477 | * NONE. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1478 | * Comments: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1479 | * Please refresh the client window to remove the highlight immediately |
| 1480 | *if necessary. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1481 | **/ |
| 1482 | DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle); |
| 1483 | |
| 1484 | /** |
| 1485 | * Function: FPDF_FFLDraw |
jaepark | 75f84a5 | 2016-09-09 15:39:09 -0700 | [diff] [blame] | 1486 | * Render FormFields and popup window on a page to a device independent |
| 1487 | *bitmap. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1488 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1489 | * 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 Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1501 | * size_x - Horizontal size (in pixels) for displaying the page. |
| 1502 | * size_y - Vertical size (in pixels) for displaying the page. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1503 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1509 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1510 | * None. |
| 1511 | * Comments: |
jaepark | 75f84a5 | 2016-09-09 15:39:09 -0700 | [diff] [blame] | 1512 | * 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-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1521 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1522 | DLLEXPORT 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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 1531 | |
Cary Clark | 399be5b | 2016-03-14 16:51:29 -0400 | [diff] [blame] | 1532 | #ifdef _SKIA_SUPPORT_ |
| 1533 | DLLEXPORT 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 Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 1544 | #ifdef PDF_ENABLE_XFA |
Jun Fang | e118ce9 | 2015-02-17 06:50:08 -0800 | [diff] [blame] | 1545 | /** |
| 1546 | * Function: FPDF_HasXFAField |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1547 | * This method is designed to check whether a pdf document |
| 1548 | *has XFA fields. |
Jun Fang | e118ce9 | 2015-02-17 06:50:08 -0800 | [diff] [blame] | 1549 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1550 | * document - Handle to document. |
| 1551 | *Returned by FPDF_LoadDocument function. |
| 1552 | * docType - Document type defined as |
| 1553 | *DOCTYPE_xxx. |
Jun Fang | e118ce9 | 2015-02-17 06:50:08 -0800 | [diff] [blame] | 1554 | * Return Value: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1555 | * TRUE indicates that the input document has XFA fields, |
| 1556 | *otherwise FALSE. |
Jun Fang | e118ce9 | 2015-02-17 06:50:08 -0800 | [diff] [blame] | 1557 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1558 | DLLEXPORT FPDF_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document, |
| 1559 | int* docType); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1560 | |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1561 | /** |
| 1562 | * Function: FPDF_LoadXFA |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1563 | * If the document consists of XFA fields, there should call this |
| 1564 | *method to load XFA fields. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1565 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1566 | * document - Handle to document. Returned by |
| 1567 | *FPDF_LoadDocument function. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1568 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1569 | * TRUE indicates success,otherwise FALSE. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1570 | **/ |
| 1571 | DLLEXPORT FPDF_BOOL STDCALL FPDF_LoadXFA(FPDF_DOCUMENT document); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1572 | |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1573 | /** |
| 1574 | * Function: FPDF_Widget_Undo |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1575 | * This method will implement the undo feature for the specified xfa |
| 1576 | *field. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1577 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1578 | * document - Handle to document. Returned by |
| 1579 | *FPDF_LoadDocument function. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1580 | * hWidget - Handle to the xfa field. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1581 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1582 | * None. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1583 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1584 | DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, |
| 1585 | FPDF_WIDGET hWidget); |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1586 | /** |
| 1587 | * Function: FPDF_Widget_Redo |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1588 | * This method will implement the redo feature for the specified xfa |
| 1589 | *field. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1590 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1591 | * document - Handle to document. Returned by |
| 1592 | *FPDF_LoadDocument function. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1593 | * hWidget - Handle to the xfa field. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1594 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1595 | * None. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1596 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1597 | DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document, |
| 1598 | FPDF_WIDGET hWidget); |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1599 | /** |
| 1600 | * Function: FPDF_Widget_SelectAll |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1601 | * This method will implement the select all feature for the specified |
| 1602 | *xfa field. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1603 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1604 | * document - Handle to document. Returned by |
| 1605 | *FPDF_LoadDocument function. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1606 | * hWidget - Handle to the xfa field. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1607 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1608 | * None. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1609 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1610 | DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document, |
| 1611 | FPDF_WIDGET hWidget); |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1612 | /** |
| 1613 | * Function: FPDF_Widget_Copy |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1614 | * This method will implement the copy feature for the specified xfa |
| 1615 | *field. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1616 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1617 | * document - Handle to document. Returned by |
| 1618 | *FPDF_LoadDocument function. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1619 | * hWidget - Handle to the xfa field. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1620 | * wsText - Pointer to data buffer to receive the copied |
| 1621 | *data, in UTF-16LE format. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1622 | * size - The data buffer size. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1623 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1624 | * None. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1625 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1626 | DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document, |
| 1627 | FPDF_WIDGET hWidget, |
| 1628 | FPDF_WIDESTRING wsText, |
| 1629 | FPDF_DWORD* size); |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1630 | /** |
| 1631 | * Function: FPDF_Widget_Cut |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1632 | * This method will implement the cut feature for the specified xfa |
| 1633 | *field. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1634 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1635 | * document - Handle to document. Returned by |
| 1636 | *FPDF_LoadDocument function. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1637 | * hWidget - Handle to the xfa field. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1638 | * wsText - Pointer to data buffer to receive the cut |
| 1639 | *data,in UTF-16LE format. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1640 | * size - The data buffer size,not the byte number. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1641 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1642 | * None. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1643 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1644 | DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document, |
| 1645 | FPDF_WIDGET hWidget, |
| 1646 | FPDF_WIDESTRING wsText, |
| 1647 | FPDF_DWORD* size); |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1648 | /** |
| 1649 | * Function: FPDF_Widget_Paste |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1650 | * This method will implement the paste feature for the specified xfa |
| 1651 | *field. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1652 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1653 | * document - Handle to document. Returned by |
| 1654 | *FPDF_LoadDocument function. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1655 | * 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 Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1658 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1659 | * None. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1660 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1661 | DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document, |
| 1662 | FPDF_WIDGET hWidget, |
| 1663 | FPDF_WIDESTRING wsText, |
| 1664 | FPDF_DWORD size); |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1665 | /** |
| 1666 | * Function: FPDF_Widget_ReplaceSpellCheckWord |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1667 | * This method will implement the spell check feature for the specified |
| 1668 | *xfa field. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1669 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1670 | * document - Handle to document. Returned by |
| 1671 | *FPDF_LoadDocument function. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1672 | * 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 Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1675 | * bsText - The text buffer needed to be speck check, in |
| 1676 | *UTF-16LE format. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1677 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1678 | * None. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1679 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1680 | DLLEXPORT void STDCALL |
| 1681 | FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document, |
| 1682 | FPDF_WIDGET hWidget, |
| 1683 | float x, |
| 1684 | float y, |
| 1685 | FPDF_BYTESTRING bsText); |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1686 | /** |
| 1687 | * Function: FPDF_Widget_GetSpellCheckWords |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1688 | * This method will implement the spell check feature for the specified |
| 1689 | *xfa field. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1690 | * Parameters: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1691 | * document - Handle to document. Returned by |
| 1692 | *FPDF_LoadDocument function. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1693 | * 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 Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1696 | * stringHandle - Pointer to FPDF_STRINGHANDLE to receive the |
| 1697 | *speck check text buffer, in UTF-16LE format. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1698 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1699 | * None. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1700 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1701 | DLLEXPORT void STDCALL |
| 1702 | FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document, |
| 1703 | FPDF_WIDGET hWidget, |
| 1704 | float x, |
| 1705 | float y, |
| 1706 | FPDF_STRINGHANDLE* stringHandle); |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1707 | /** |
| 1708 | * Function: FPDF_StringHandleCounts |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1709 | * This method will get the count of the text buffer. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1710 | * Parameters: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1711 | * stringHandle - Pointer to FPDF_STRINGHANDLE. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1712 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1713 | * None. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1714 | **/ |
| 1715 | DLLEXPORT int STDCALL FPDF_StringHandleCounts(FPDF_STRINGHANDLE stringHandle); |
| 1716 | /** |
| 1717 | * Function: FPDF_StringHandleGetStringByIndex |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1718 | * This method will get the specified index of the text buffer. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1719 | * Parameters: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1720 | * stringHandle - Pointer to FPDF_STRINGHANDLE. |
| 1721 | * index - The specified index of text buffer. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1722 | * bsText - Pointer to data buffer to receive the text |
| 1723 | *buffer, in UTF-16LE format. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1724 | * size - The byte size of data buffer. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1725 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1726 | * TRUE indicates success, otherwise FALSE. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1727 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1728 | DLLEXPORT FPDF_BOOL STDCALL |
| 1729 | FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE stringHandle, |
| 1730 | int index, |
| 1731 | FPDF_BYTESTRING bsText, |
| 1732 | FPDF_DWORD* size); |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1733 | /** |
| 1734 | * Function: FPDF_StringHandleRelease |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1735 | * This method will release the FPDF_STRINGHANDLE. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1736 | * Parameters: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1737 | * stringHandle - Pointer to FPDF_STRINGHANDLE. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1738 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1739 | * None. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1740 | **/ |
| 1741 | DLLEXPORT void STDCALL FPDF_StringHandleRelease(FPDF_STRINGHANDLE stringHandle); |
| 1742 | /** |
| 1743 | * Function: FPDF_StringHandleAddString |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1744 | * This method will add the specified text buffer. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1745 | * Parameters: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1746 | * stringHandle - Pointer to FPDF_STRINGHANDLE. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1747 | * bsText - Pointer to data buffer of the text buffer, in |
| 1748 | *UTF-16LE format. |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1749 | * size - The byte size of data buffer. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1750 | * Return Value: |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1751 | * TRUE indicates success, otherwise FALSE. |
Bo Xu | fdc00a7 | 2014-10-28 23:03:33 -0700 | [diff] [blame] | 1752 | **/ |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 1753 | DLLEXPORT FPDF_BOOL STDCALL |
| 1754 | FPDF_StringHandleAddString(FPDF_STRINGHANDLE stringHandle, |
| 1755 | FPDF_BYTESTRING bsText, |
| 1756 | FPDF_DWORD size); |
Tom Sepez | c46d000 | 2015-11-30 15:46:36 -0800 | [diff] [blame] | 1757 | #endif // PDF_ENABLE_XFA |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1758 | |
| 1759 | #ifdef __cplusplus |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1760 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1761 | #endif |
| 1762 | |
Tom Sepez | 9857e20 | 2015-05-13 17:09:26 -0700 | [diff] [blame] | 1763 | #endif // PUBLIC_FPDF_FORMFILL_H_ |