blob: c0f9a6e4c6c424d3bef42a75da8c5111afc2a71f [file] [log] [blame]
Jane Liu4fd9a472017-06-01 18:56:09 -04001// Copyright 2017 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Jane Liu4fd9a472017-06-01 18:56:09 -04005#ifndef PUBLIC_FPDF_ANNOT_H_
6#define PUBLIC_FPDF_ANNOT_H_
7
8// NOLINTNEXTLINE(build/include)
9#include "fpdfview.h"
10
Jane Liuc5ea6302017-07-18 19:31:42 -040011#include "fpdf_doc.h"
Diana Gage40870db2017-07-19 18:16:03 -070012#include "fpdf_formfill.h"
Jane Liu4fd9a472017-06-01 18:56:09 -040013
14#ifdef __cplusplus
15extern "C" {
16#endif // __cplusplus
17
18#define FPDF_ANNOT_UNKNOWN 0
19#define FPDF_ANNOT_TEXT 1
20#define FPDF_ANNOT_LINK 2
21#define FPDF_ANNOT_FREETEXT 3
22#define FPDF_ANNOT_LINE 4
23#define FPDF_ANNOT_SQUARE 5
24#define FPDF_ANNOT_CIRCLE 6
25#define FPDF_ANNOT_POLYGON 7
26#define FPDF_ANNOT_POLYLINE 8
27#define FPDF_ANNOT_HIGHLIGHT 9
28#define FPDF_ANNOT_UNDERLINE 10
29#define FPDF_ANNOT_SQUIGGLY 11
30#define FPDF_ANNOT_STRIKEOUT 12
31#define FPDF_ANNOT_STAMP 13
32#define FPDF_ANNOT_CARET 14
33#define FPDF_ANNOT_INK 15
34#define FPDF_ANNOT_POPUP 16
35#define FPDF_ANNOT_FILEATTACHMENT 17
36#define FPDF_ANNOT_SOUND 18
37#define FPDF_ANNOT_MOVIE 19
38#define FPDF_ANNOT_WIDGET 20
39#define FPDF_ANNOT_SCREEN 21
40#define FPDF_ANNOT_PRINTERMARK 22
41#define FPDF_ANNOT_TRAPNET 23
42#define FPDF_ANNOT_WATERMARK 24
43#define FPDF_ANNOT_THREED 25
44#define FPDF_ANNOT_RICHMEDIA 26
45#define FPDF_ANNOT_XFAWIDGET 27
46
Jane Liub137e752017-07-05 15:04:33 -040047// Refer to PDF Reference (6th edition) table 8.16 for all annotation flags.
48#define FPDF_ANNOT_FLAG_NONE 0
49#define FPDF_ANNOT_FLAG_INVISIBLE (1 << 0)
50#define FPDF_ANNOT_FLAG_HIDDEN (1 << 1)
51#define FPDF_ANNOT_FLAG_PRINT (1 << 2)
52#define FPDF_ANNOT_FLAG_NOZOOM (1 << 3)
53#define FPDF_ANNOT_FLAG_NOROTATE (1 << 4)
54#define FPDF_ANNOT_FLAG_NOVIEW (1 << 5)
55#define FPDF_ANNOT_FLAG_READONLY (1 << 6)
56#define FPDF_ANNOT_FLAG_LOCKED (1 << 7)
57#define FPDF_ANNOT_FLAG_TOGGLENOVIEW (1 << 8)
58
Diana Gage7e0c05d2017-07-19 17:33:33 -070059#define FPDF_OBJECT_UNKNOWN 0
60#define FPDF_OBJECT_BOOLEAN 1
61#define FPDF_OBJECT_NUMBER 2
62#define FPDF_OBJECT_STRING 3
63#define FPDF_OBJECT_NAME 4
64#define FPDF_OBJECT_ARRAY 5
65#define FPDF_OBJECT_DICTIONARY 6
66#define FPDF_OBJECT_STREAM 7
67#define FPDF_OBJECT_NULLOBJ 8
68#define FPDF_OBJECT_REFERENCE 9
69
70// Refer to PDF Reference version 1.7 table 8.70 for field flags common to all
71// interactive form field types.
72#define FPDF_FORMFLAG_NONE 0
73#define FPDF_FORMFLAG_READONLY (1 << 0)
74#define FPDF_FORMFLAG_REQUIRED (1 << 1)
75#define FPDF_FORMFLAG_NOEXPORT (1 << 2)
76
77// Refer to PDF Reference version 1.7 table 8.77 for field flags specific to
78// interactive form text fields.
79#define FPDF_FORMFLAG_TEXT_MULTILINE (1 << 12)
80
81// Refer to PDF Reference version 1.7 table 8.79 for field flags specific to
82// interactive form choice fields.
83#define FPDF_FORMFLAG_CHOICE_COMBO (1 << 17)
84#define FPDF_FORMFLAG_CHOICE_EDIT (1 << 18)
85
Jane Liu20eafda2017-06-07 10:33:24 -040086typedef enum FPDFANNOT_COLORTYPE {
87 FPDFANNOT_COLORTYPE_Color = 0,
88 FPDFANNOT_COLORTYPE_InteriorColor
89} FPDFANNOT_COLORTYPE;
90
Jane Liu36567742017-07-06 11:13:35 -040091// Experimental API.
Jane Liubaa7ff42017-06-29 19:18:23 -040092// Check if an annotation subtype is currently supported for creation.
93// Currently supported subtypes: circle, highlight, ink, popup, square,
94// squiggly, stamp, strikeout, text, and underline.
Jane Liu20eafda2017-06-07 10:33:24 -040095//
96// subtype - the subtype to be checked.
97//
Jane Liu8ce58f52017-06-29 13:40:22 -040098// Returns true if this subtype supported.
Jane Liu20eafda2017-06-07 10:33:24 -040099DLLEXPORT FPDF_BOOL STDCALL
100FPDFAnnot_IsSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype);
101
Jane Liu36567742017-07-06 11:13:35 -0400102// Experimental API.
Jane Liu20eafda2017-06-07 10:33:24 -0400103// Create an annotation in |page| of the subtype |subtype|. If the specified
104// subtype is illegal or unsupported, then a new annotation will not be created.
Jane Liubaa7ff42017-06-29 19:18:23 -0400105// Must call FPDFPage_CloseAnnot() when the annotation returned by this
106// function is no longer needed.
Jane Liu20eafda2017-06-07 10:33:24 -0400107//
108// page - handle to a page.
109// subtype - the subtype of the new annotation.
Jane Liu20eafda2017-06-07 10:33:24 -0400110//
Jane Liud60e9ad2017-06-26 11:28:36 -0400111// Returns a handle to the new annotation object, or NULL on failure.
112DLLEXPORT FPDF_ANNOTATION STDCALL
113FPDFPage_CreateAnnot(FPDF_PAGE page, FPDF_ANNOTATION_SUBTYPE subtype);
Jane Liu20eafda2017-06-07 10:33:24 -0400114
Jane Liu36567742017-07-06 11:13:35 -0400115// Experimental API.
Jane Liu4fd9a472017-06-01 18:56:09 -0400116// Get the number of annotations in |page|.
117//
118// page - handle to a page.
119//
120// Returns the number of annotations in |page|.
121DLLEXPORT int STDCALL FPDFPage_GetAnnotCount(FPDF_PAGE page);
122
Jane Liu36567742017-07-06 11:13:35 -0400123// Experimental API.
Jane Liubaa7ff42017-06-29 19:18:23 -0400124// Get annotation in |page| at |index|. Must call FPDFPage_CloseAnnot() when the
125// annotation returned by this function is no longer needed.
Jane Liu4fd9a472017-06-01 18:56:09 -0400126//
127// page - handle to a page.
128// index - the index of the annotation.
Jane Liu4fd9a472017-06-01 18:56:09 -0400129//
Jane Liud60e9ad2017-06-26 11:28:36 -0400130// Returns a handle to the annotation object, or NULL on failure.
131DLLEXPORT FPDF_ANNOTATION STDCALL FPDFPage_GetAnnot(FPDF_PAGE page, int index);
Jane Liu4fd9a472017-06-01 18:56:09 -0400132
Jane Liu36567742017-07-06 11:13:35 -0400133// Experimental API.
Jane Liue10509a2017-06-20 16:47:41 -0400134// Close an annotation. Must be called when the annotation returned by
135// FPDFPage_CreateAnnot() or FPDFPage_GetAnnot() is no longer needed. This
136// function does not remove the annotation from the document.
137//
138// annot - handle to an annotation.
139DLLEXPORT void STDCALL FPDFPage_CloseAnnot(FPDF_ANNOTATION annot);
140
Jane Liu36567742017-07-06 11:13:35 -0400141// Experimental API.
Jane Liu8ce58f52017-06-29 13:40:22 -0400142// Remove the annotation in |page| at |index|.
143//
144// page - handle to a page.
145// index - the index of the annotation.
146//
147// Returns true if successful.
148DLLEXPORT FPDF_BOOL STDCALL FPDFPage_RemoveAnnot(FPDF_PAGE page, int index);
149
Jane Liu36567742017-07-06 11:13:35 -0400150// Experimental API.
Jane Liu4fd9a472017-06-01 18:56:09 -0400151// Get the subtype of an annotation.
152//
153// annot - handle to an annotation.
154//
155// Returns the annotation subtype.
156DLLEXPORT FPDF_ANNOTATION_SUBTYPE STDCALL
157FPDFAnnot_GetSubtype(FPDF_ANNOTATION annot);
158
Jane Liubaa7ff42017-06-29 19:18:23 -0400159// Experimental API.
Jane Liu7a9a38b2017-07-11 13:47:37 -0400160// Check if an annotation subtype is currently supported for object extraction,
161// update, and removal.
162// Currently supported subtypes: ink and stamp.
163//
164// subtype - the subtype to be checked.
165//
166// Returns true if this subtype supported.
167DLLEXPORT FPDF_BOOL STDCALL
168FPDFAnnot_IsObjectSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype);
169
170// Experimental API.
Jane Liu36567742017-07-06 11:13:35 -0400171// Update |obj| in |annot|. |obj| must be in |annot| already and must have
172// been retrieved by FPDFAnnot_GetObject(). Currently, only ink and stamp
173// annotations are supported by this API. Also note that only path, image, and
174// text objects have APIs for modification; see FPDFPath_*(), FPDFText_*(), and
175// FPDFImageObj_*().
Jane Liubaa7ff42017-06-29 19:18:23 -0400176//
177// annot - handle to an annotation.
Jane Liu36567742017-07-06 11:13:35 -0400178// obj - handle to the object that |annot| needs to update.
Jane Liubaa7ff42017-06-29 19:18:23 -0400179//
180// Return true if successful.
Jane Liu36567742017-07-06 11:13:35 -0400181DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_UpdateObject(FPDF_ANNOTATION annot,
182 FPDF_PAGEOBJECT obj);
Jane Liubaa7ff42017-06-29 19:18:23 -0400183
184// Experimental API.
Jane Liu36567742017-07-06 11:13:35 -0400185// Add |obj| to |annot|. |obj| must have been created by
186// FPDFPageObj_CreateNew{Path|Rect}() or FPDFPageObj_New{Text|Image}Obj(), and
187// will be owned by |annot|. Note that an |obj| cannot belong to more than one
188// |annot|. Currently, only ink and stamp annotations are supported by this API.
189// Also note that only path, image, and text objects have APIs for creation.
Jane Liubaa7ff42017-06-29 19:18:23 -0400190//
191// annot - handle to an annotation.
Jane Liu36567742017-07-06 11:13:35 -0400192// obj - handle to the object that is to be added to |annot|.
Jane Liubaa7ff42017-06-29 19:18:23 -0400193//
194// Return true if successful.
Jane Liu36567742017-07-06 11:13:35 -0400195DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_AppendObject(FPDF_ANNOTATION annot,
196 FPDF_PAGEOBJECT obj);
Jane Liubaa7ff42017-06-29 19:18:23 -0400197
198// Experimental API.
Jane Liu36567742017-07-06 11:13:35 -0400199// Get the total number of objects in |annot|, including path objects, text
200// objects, external objects, image objects, and shading objects.
Jane Liubaa7ff42017-06-29 19:18:23 -0400201//
202// annot - handle to an annotation.
203//
Jane Liu36567742017-07-06 11:13:35 -0400204// Returns the number of objects in |annot|.
205DLLEXPORT int STDCALL FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot);
Jane Liubaa7ff42017-06-29 19:18:23 -0400206
207// Experimental API.
Jane Liu36567742017-07-06 11:13:35 -0400208// Get the object in |annot| at |index|.
Jane Liubaa7ff42017-06-29 19:18:23 -0400209//
210// annot - handle to an annotation.
Jane Liu36567742017-07-06 11:13:35 -0400211// index - the index of the object.
Jane Liubaa7ff42017-06-29 19:18:23 -0400212//
Jane Liu36567742017-07-06 11:13:35 -0400213// Return a handle to the object, or NULL on failure.
214DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFAnnot_GetObject(FPDF_ANNOTATION annot,
215 int index);
Jane Liubaa7ff42017-06-29 19:18:23 -0400216
Jane Liu36567742017-07-06 11:13:35 -0400217// Experimental API.
Jane Liu7a9a38b2017-07-11 13:47:37 -0400218// Remove the object in |annot| at |index|.
219//
220// annot - handle to an annotation.
221// index - the index of the object to be removed.
222//
223// Return true if successful.
224DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_RemoveObject(FPDF_ANNOTATION annot,
225 int index);
226
227// Experimental API.
Jane Liu06462752017-06-27 16:41:14 -0400228// Set the color of an annotation. Fails when called on annotations with
229// appearance streams already defined; instead use
230// FPDFPath_Set{Stroke|Fill}Color().
Jane Liu20eafda2017-06-07 10:33:24 -0400231//
232// annot - handle to an annotation.
233// type - type of the color to be set.
234// R, G, B - buffer to hold the RGB value of the color. Ranges from 0 to 255.
235// A - buffer to hold the opacity. Ranges from 0 to 255.
236//
Jane Liu8ce58f52017-06-29 13:40:22 -0400237// Returns true if successful.
Jane Liu20eafda2017-06-07 10:33:24 -0400238DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetColor(FPDF_ANNOTATION annot,
239 FPDFANNOT_COLORTYPE type,
240 unsigned int R,
241 unsigned int G,
242 unsigned int B,
243 unsigned int A);
Jane Liu4fd9a472017-06-01 18:56:09 -0400244
Jane Liu36567742017-07-06 11:13:35 -0400245// Experimental API.
Jane Liu4fd9a472017-06-01 18:56:09 -0400246// Get the color of an annotation. If no color is specified, default to yellow
Jane Liu06462752017-06-27 16:41:14 -0400247// for highlight annotation, black for all else. Fails when called on
248// annotations with appearance streams already defined; instead use
249// FPDFPath_Get{Stroke|Fill}Color().
Jane Liu4fd9a472017-06-01 18:56:09 -0400250//
Jane Liu20eafda2017-06-07 10:33:24 -0400251// annot - handle to an annotation.
252// type - type of the color requested.
Jane Liu4fd9a472017-06-01 18:56:09 -0400253// R, G, B - buffer to hold the RGB value of the color. Ranges from 0 to 255.
Jane Liu20eafda2017-06-07 10:33:24 -0400254// A - buffer to hold the opacity. Ranges from 0 to 255.
Jane Liu4fd9a472017-06-01 18:56:09 -0400255//
Jane Liu8ce58f52017-06-29 13:40:22 -0400256// Returns true if successful.
Jane Liu4fd9a472017-06-01 18:56:09 -0400257DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_GetColor(FPDF_ANNOTATION annot,
258 FPDFANNOT_COLORTYPE type,
259 unsigned int* R,
260 unsigned int* G,
261 unsigned int* B,
262 unsigned int* A);
263
Jane Liu36567742017-07-06 11:13:35 -0400264// Experimental API.
Jane Liu4fd9a472017-06-01 18:56:09 -0400265// Check if the annotation is of a type that has attachment points
266// (i.e. quadpoints). Quadpoints are the vertices of the rectange that
267// encompasses the texts affected by the annotation. They provide the
Jane Liu20eafda2017-06-07 10:33:24 -0400268// coordinates in the page where the annotation is attached. Only text markup
269// annotations (i.e. highlight, strikeout, squiggly, and underline) and link
270// annotations have quadpoints.
Jane Liu4fd9a472017-06-01 18:56:09 -0400271//
272// annot - handle to an annotation.
273//
274// Returns true if the annotation is of a type that has quadpoints, false
275// otherwise.
276DLLEXPORT FPDF_BOOL STDCALL
277FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot);
278
Jane Liu36567742017-07-06 11:13:35 -0400279// Experimental API.
Jane Liu06462752017-06-27 16:41:14 -0400280// Set the attachment points (i.e. quadpoints) of an annotation. If the
281// annotation's appearance stream is defined and this annotation is of a type
282// with quadpoints, then update the bounding box too.
Jane Liu20eafda2017-06-07 10:33:24 -0400283//
284// annot - handle to an annotation.
285// quadPoints - the quadpoints to be set.
286//
Jane Liu8ce58f52017-06-29 13:40:22 -0400287// Returns true if successful.
Jane Liu20eafda2017-06-07 10:33:24 -0400288DLLEXPORT FPDF_BOOL STDCALL
Jane Liu06462752017-06-27 16:41:14 -0400289FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot,
290 const FS_QUADPOINTSF* quadPoints);
Jane Liu20eafda2017-06-07 10:33:24 -0400291
Jane Liu36567742017-07-06 11:13:35 -0400292// Experimental API.
Jane Liu06462752017-06-27 16:41:14 -0400293// Get the attachment points (i.e. quadpoints) of an annotation. If the
294// annotation's appearance stream is defined and this annotation is of a type
295// with quadpoints, then return the bounding box it specifies instead.
Jane Liu4fd9a472017-06-01 18:56:09 -0400296//
Jane Liu20eafda2017-06-07 10:33:24 -0400297// annot - handle to an annotation.
Jane Liu4fd9a472017-06-01 18:56:09 -0400298//
Jane Liud60e9ad2017-06-26 11:28:36 -0400299// Returns a quadpoints object, or an empty set of quadpoints on failure.
300DLLEXPORT FS_QUADPOINTSF STDCALL
301FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot);
Jane Liu4fd9a472017-06-01 18:56:09 -0400302
Jane Liu36567742017-07-06 11:13:35 -0400303// Experimental API.
Jane Liu06462752017-06-27 16:41:14 -0400304// Set the annotation rectangle defining the location of the annotation. If the
305// annotation's appearance stream is defined and this annotation is of a type
306// without quadpoints, then update the bounding box too.
Jane Liu20eafda2017-06-07 10:33:24 -0400307//
308// annot - handle to an annotation.
309// rect - the annotation rectangle to be set.
310//
Jane Liu8ce58f52017-06-29 13:40:22 -0400311// Returns true if successful.
Jane Liu20eafda2017-06-07 10:33:24 -0400312DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetRect(FPDF_ANNOTATION annot,
Jane Liu06462752017-06-27 16:41:14 -0400313 const FS_RECTF* rect);
Jane Liu20eafda2017-06-07 10:33:24 -0400314
Jane Liu36567742017-07-06 11:13:35 -0400315// Experimental API.
Jane Liu06462752017-06-27 16:41:14 -0400316// Get the annotation rectangle defining the location of the annotation. If the
317// annotation's appearance stream is defined and this annotation is of a type
318// without quadpoints, then return the bounding box it specifies instead.
Jane Liu4fd9a472017-06-01 18:56:09 -0400319//
320// annot - handle to an annotation.
Jane Liu4fd9a472017-06-01 18:56:09 -0400321//
Jane Liud60e9ad2017-06-26 11:28:36 -0400322// Returns a rectangle object, or an empty rectangle on failure.
323DLLEXPORT FS_RECTF STDCALL FPDFAnnot_GetRect(FPDF_ANNOTATION annot);
Jane Liu4fd9a472017-06-01 18:56:09 -0400324
Jane Liu36567742017-07-06 11:13:35 -0400325// Experimental API.
Jane Liu2e1a32b2017-07-06 12:01:25 -0400326// Check if |annot|'s dictionary has |key| as a key.
Jane Liu20eafda2017-06-07 10:33:24 -0400327//
328// annot - handle to an annotation.
Jane Liu2e1a32b2017-07-06 12:01:25 -0400329// key - the key to look for.
Jane Liu20eafda2017-06-07 10:33:24 -0400330//
Jane Liu2e1a32b2017-07-06 12:01:25 -0400331// Returns true if |key| exists.
332DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_HasKey(FPDF_ANNOTATION annot,
333 FPDF_WIDESTRING key);
Jane Liu4fd9a472017-06-01 18:56:09 -0400334
Jane Liu36567742017-07-06 11:13:35 -0400335// Experimental API.
Jane Liu57f228d2017-07-13 18:10:30 -0400336// Get the type of the value corresponding to |key| in |annot|'s dictionary.
Jane Liu4fd9a472017-06-01 18:56:09 -0400337//
338// annot - handle to an annotation.
Jane Liu2e1a32b2017-07-06 12:01:25 -0400339// key - the key to look for.
340//
341// Returns the type of the dictionary value.
342DLLEXPORT FPDF_OBJECT_TYPE STDCALL FPDFAnnot_GetValueType(FPDF_ANNOTATION annot,
343 FPDF_WIDESTRING key);
344
345// Experimental API.
346// Set the string value corresponding to |key| in |annot|'s dictionary,
347// overwriting the existing value if any. The value type would be
Jane Liu57f228d2017-07-13 18:10:30 -0400348// FPDF_OBJECT_STRING after this function call succeeds.
Jane Liu2e1a32b2017-07-06 12:01:25 -0400349//
350// annot - handle to an annotation.
351// key - the key to the dictionary entry to be set, encoded in UTF16-LE.
352// value - the string value to be set, encoded in UTF16-LE.
353//
354// Returns true if successful.
355DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetStringValue(FPDF_ANNOTATION annot,
356 FPDF_WIDESTRING key,
357 FPDF_WIDESTRING value);
358
359// Experimental API.
360// Get the string value corresponding to |key| in |annot|'s dictionary. |buffer|
361// is only modified if |buflen| is longer than the length of contents. Note that
362// if |key| does not exist in the dictionary or if |key|'s corresponding value
363// in the dictionary is not a string (i.e. the value is not of type
364// FPDF_OBJECT_STRING or FPDF_OBJECT_NAME), then an empty string would be copied
365// to |buffer| and the return value would be 2. On other errors, nothing would
366// be added to |buffer| and the return value would be 0.
367//
368// annot - handle to an annotation.
369// key - the key to the requested dictionary entry.
370// buffer - buffer for holding the value string, encoded in UTF16-LE.
Jane Liu4fd9a472017-06-01 18:56:09 -0400371// buflen - length of the buffer.
372//
Jane Liu2e1a32b2017-07-06 12:01:25 -0400373// Returns the length of the string value.
374DLLEXPORT unsigned long STDCALL FPDFAnnot_GetStringValue(FPDF_ANNOTATION annot,
375 FPDF_WIDESTRING key,
376 void* buffer,
377 unsigned long buflen);
Jane Liu4fd9a472017-06-01 18:56:09 -0400378
Jane Liub137e752017-07-05 15:04:33 -0400379// Experimental API.
380// Get the annotation flags of |annot|.
381//
382// annot - handle to an annotation.
383//
384// Returns the annotation flags.
385DLLEXPORT int STDCALL FPDFAnnot_GetFlags(FPDF_ANNOTATION annot);
386
387// Experimental API.
388// Set the |annot|'s flags to be of the value |flags|.
389//
390// annot - handle to an annotation.
391// flags - the flag values to be set.
392//
393// Returns true if successful.
394DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetFlags(FPDF_ANNOTATION annot,
395 int flags);
396
Diana Gage7e0c05d2017-07-19 17:33:33 -0700397// Experimental API.
398// Get the annotation flags of |annot|, which is an interactive form
399// annotation in |page|.
400//
401// page - handle to a page.
402// annot - handle to an interactive form annotation.
403//
404// Returns the annotation flags specific to interactive forms.
405DLLEXPORT int STDCALL FPDFAnnot_GetFormFieldFlags(FPDF_PAGE page,
406 FPDF_ANNOTATION annot);
407
Diana Gage40870db2017-07-19 18:16:03 -0700408// Experimental API.
409// Retrieves an interactive form annotation whose rectangle contains a given
410// point on a page. Must call FPDFPage_CloseAnnot() when the annotation returned
411// is no longer needed.
412//
413//
414// hHandle - handle to the form fill module, returned by
415// FPDFDOC_InitFormFillEnvironment.
416// page - handle to the page, returned by FPDF_LoadPage function.
417// page_x - X position in PDF "user space".
418// page_y - Y position in PDF "user space".
419//
420// Returns the interactive form annotation whose rectangle contains the given
421// coordinates on the page. If there is no such annotation, return NULL.
422DLLEXPORT FPDF_ANNOTATION STDCALL
423FPDFAnnot_GetFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
424 FPDF_PAGE page,
425 double page_x,
426 double page_y);
427
Jane Liu4fd9a472017-06-01 18:56:09 -0400428#ifdef __cplusplus
429} // extern "C"
430#endif // __cplusplus
431
432#endif // PUBLIC_FPDF_ANNOT_H_