xref: /aosp_15_r20/external/pdfium/public/fpdf_annot.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1*3ac0a46fSAndroid Build Coastguard Worker // Copyright 2017 The PDFium Authors
2*3ac0a46fSAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
3*3ac0a46fSAndroid Build Coastguard Worker // found in the LICENSE file.
4*3ac0a46fSAndroid Build Coastguard Worker 
5*3ac0a46fSAndroid Build Coastguard Worker #ifndef PUBLIC_FPDF_ANNOT_H_
6*3ac0a46fSAndroid Build Coastguard Worker #define PUBLIC_FPDF_ANNOT_H_
7*3ac0a46fSAndroid Build Coastguard Worker 
8*3ac0a46fSAndroid Build Coastguard Worker #include <stddef.h>
9*3ac0a46fSAndroid Build Coastguard Worker 
10*3ac0a46fSAndroid Build Coastguard Worker // NOLINTNEXTLINE(build/include)
11*3ac0a46fSAndroid Build Coastguard Worker #include "fpdfview.h"
12*3ac0a46fSAndroid Build Coastguard Worker 
13*3ac0a46fSAndroid Build Coastguard Worker // NOLINTNEXTLINE(build/include)
14*3ac0a46fSAndroid Build Coastguard Worker #include "fpdf_formfill.h"
15*3ac0a46fSAndroid Build Coastguard Worker 
16*3ac0a46fSAndroid Build Coastguard Worker #ifdef __cplusplus
17*3ac0a46fSAndroid Build Coastguard Worker extern "C" {
18*3ac0a46fSAndroid Build Coastguard Worker #endif  // __cplusplus
19*3ac0a46fSAndroid Build Coastguard Worker 
20*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_UNKNOWN 0
21*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_TEXT 1
22*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_LINK 2
23*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_FREETEXT 3
24*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_LINE 4
25*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_SQUARE 5
26*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_CIRCLE 6
27*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_POLYGON 7
28*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_POLYLINE 8
29*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_HIGHLIGHT 9
30*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_UNDERLINE 10
31*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_SQUIGGLY 11
32*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_STRIKEOUT 12
33*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_STAMP 13
34*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_CARET 14
35*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_INK 15
36*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_POPUP 16
37*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_FILEATTACHMENT 17
38*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_SOUND 18
39*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_MOVIE 19
40*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_WIDGET 20
41*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_SCREEN 21
42*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_PRINTERMARK 22
43*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_TRAPNET 23
44*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_WATERMARK 24
45*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_THREED 25
46*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_RICHMEDIA 26
47*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_XFAWIDGET 27
48*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_REDACT 28
49*3ac0a46fSAndroid Build Coastguard Worker 
50*3ac0a46fSAndroid Build Coastguard Worker // Refer to PDF Reference (6th edition) table 8.16 for all annotation flags.
51*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_FLAG_NONE 0
52*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_FLAG_INVISIBLE (1 << 0)
53*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_FLAG_HIDDEN (1 << 1)
54*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_FLAG_PRINT (1 << 2)
55*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_FLAG_NOZOOM (1 << 3)
56*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_FLAG_NOROTATE (1 << 4)
57*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_FLAG_NOVIEW (1 << 5)
58*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_FLAG_READONLY (1 << 6)
59*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_FLAG_LOCKED (1 << 7)
60*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_FLAG_TOGGLENOVIEW (1 << 8)
61*3ac0a46fSAndroid Build Coastguard Worker 
62*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_APPEARANCEMODE_NORMAL 0
63*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_APPEARANCEMODE_ROLLOVER 1
64*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_APPEARANCEMODE_DOWN 2
65*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_APPEARANCEMODE_COUNT 3
66*3ac0a46fSAndroid Build Coastguard Worker 
67*3ac0a46fSAndroid Build Coastguard Worker // Refer to PDF Reference version 1.7 table 8.70 for field flags common to all
68*3ac0a46fSAndroid Build Coastguard Worker // interactive form field types.
69*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_FORMFLAG_NONE 0
70*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_FORMFLAG_READONLY (1 << 0)
71*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_FORMFLAG_REQUIRED (1 << 1)
72*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_FORMFLAG_NOEXPORT (1 << 2)
73*3ac0a46fSAndroid Build Coastguard Worker 
74*3ac0a46fSAndroid Build Coastguard Worker // Refer to PDF Reference version 1.7 table 8.77 for field flags specific to
75*3ac0a46fSAndroid Build Coastguard Worker // interactive form text fields.
76*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_FORMFLAG_TEXT_MULTILINE (1 << 12)
77*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_FORMFLAG_TEXT_PASSWORD (1 << 13)
78*3ac0a46fSAndroid Build Coastguard Worker 
79*3ac0a46fSAndroid Build Coastguard Worker // Refer to PDF Reference version 1.7 table 8.79 for field flags specific to
80*3ac0a46fSAndroid Build Coastguard Worker // interactive form choice fields.
81*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_FORMFLAG_CHOICE_COMBO (1 << 17)
82*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_FORMFLAG_CHOICE_EDIT (1 << 18)
83*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_FORMFLAG_CHOICE_MULTI_SELECT (1 << 21)
84*3ac0a46fSAndroid Build Coastguard Worker 
85*3ac0a46fSAndroid Build Coastguard Worker // Additional actions type of form field:
86*3ac0a46fSAndroid Build Coastguard Worker //   K, on key stroke, JavaScript action.
87*3ac0a46fSAndroid Build Coastguard Worker //   F, on format, JavaScript action.
88*3ac0a46fSAndroid Build Coastguard Worker //   V, on validate, JavaScript action.
89*3ac0a46fSAndroid Build Coastguard Worker //   C, on calculate, JavaScript action.
90*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_AACTION_KEY_STROKE 12
91*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_AACTION_FORMAT 13
92*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_AACTION_VALIDATE 14
93*3ac0a46fSAndroid Build Coastguard Worker #define FPDF_ANNOT_AACTION_CALCULATE 15
94*3ac0a46fSAndroid Build Coastguard Worker 
95*3ac0a46fSAndroid Build Coastguard Worker typedef enum FPDFANNOT_COLORTYPE {
96*3ac0a46fSAndroid Build Coastguard Worker   FPDFANNOT_COLORTYPE_Color = 0,
97*3ac0a46fSAndroid Build Coastguard Worker   FPDFANNOT_COLORTYPE_InteriorColor
98*3ac0a46fSAndroid Build Coastguard Worker } FPDFANNOT_COLORTYPE;
99*3ac0a46fSAndroid Build Coastguard Worker 
100*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
101*3ac0a46fSAndroid Build Coastguard Worker // Check if an annotation subtype is currently supported for creation.
102*3ac0a46fSAndroid Build Coastguard Worker // Currently supported subtypes:
103*3ac0a46fSAndroid Build Coastguard Worker //    - circle
104*3ac0a46fSAndroid Build Coastguard Worker //    - freetext
105*3ac0a46fSAndroid Build Coastguard Worker //    - highlight
106*3ac0a46fSAndroid Build Coastguard Worker //    - ink
107*3ac0a46fSAndroid Build Coastguard Worker //    - link
108*3ac0a46fSAndroid Build Coastguard Worker //    - popup
109*3ac0a46fSAndroid Build Coastguard Worker //    - square,
110*3ac0a46fSAndroid Build Coastguard Worker //    - squiggly
111*3ac0a46fSAndroid Build Coastguard Worker //    - stamp
112*3ac0a46fSAndroid Build Coastguard Worker //    - strikeout
113*3ac0a46fSAndroid Build Coastguard Worker //    - text
114*3ac0a46fSAndroid Build Coastguard Worker //    - underline
115*3ac0a46fSAndroid Build Coastguard Worker //
116*3ac0a46fSAndroid Build Coastguard Worker //   subtype   - the subtype to be checked.
117*3ac0a46fSAndroid Build Coastguard Worker //
118*3ac0a46fSAndroid Build Coastguard Worker // Returns true if this subtype supported.
119*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
120*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_IsSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype);
121*3ac0a46fSAndroid Build Coastguard Worker 
122*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
123*3ac0a46fSAndroid Build Coastguard Worker // Create an annotation in |page| of the subtype |subtype|. If the specified
124*3ac0a46fSAndroid Build Coastguard Worker // subtype is illegal or unsupported, then a new annotation will not be created.
125*3ac0a46fSAndroid Build Coastguard Worker // Must call FPDFPage_CloseAnnot() when the annotation returned by this
126*3ac0a46fSAndroid Build Coastguard Worker // function is no longer needed.
127*3ac0a46fSAndroid Build Coastguard Worker //
128*3ac0a46fSAndroid Build Coastguard Worker //   page      - handle to a page.
129*3ac0a46fSAndroid Build Coastguard Worker //   subtype   - the subtype of the new annotation.
130*3ac0a46fSAndroid Build Coastguard Worker //
131*3ac0a46fSAndroid Build Coastguard Worker // Returns a handle to the new annotation object, or NULL on failure.
132*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV
133*3ac0a46fSAndroid Build Coastguard Worker FPDFPage_CreateAnnot(FPDF_PAGE page, FPDF_ANNOTATION_SUBTYPE subtype);
134*3ac0a46fSAndroid Build Coastguard Worker 
135*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
136*3ac0a46fSAndroid Build Coastguard Worker // Get the number of annotations in |page|.
137*3ac0a46fSAndroid Build Coastguard Worker //
138*3ac0a46fSAndroid Build Coastguard Worker //   page   - handle to a page.
139*3ac0a46fSAndroid Build Coastguard Worker //
140*3ac0a46fSAndroid Build Coastguard Worker // Returns the number of annotations in |page|.
141*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetAnnotCount(FPDF_PAGE page);
142*3ac0a46fSAndroid Build Coastguard Worker 
143*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
144*3ac0a46fSAndroid Build Coastguard Worker // Get annotation in |page| at |index|. Must call FPDFPage_CloseAnnot() when the
145*3ac0a46fSAndroid Build Coastguard Worker // annotation returned by this function is no longer needed.
146*3ac0a46fSAndroid Build Coastguard Worker //
147*3ac0a46fSAndroid Build Coastguard Worker //   page  - handle to a page.
148*3ac0a46fSAndroid Build Coastguard Worker //   index - the index of the annotation.
149*3ac0a46fSAndroid Build Coastguard Worker //
150*3ac0a46fSAndroid Build Coastguard Worker // Returns a handle to the annotation object, or NULL on failure.
151*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFPage_GetAnnot(FPDF_PAGE page,
152*3ac0a46fSAndroid Build Coastguard Worker                                                             int index);
153*3ac0a46fSAndroid Build Coastguard Worker 
154*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
155*3ac0a46fSAndroid Build Coastguard Worker // Get the index of |annot| in |page|. This is the opposite of
156*3ac0a46fSAndroid Build Coastguard Worker // FPDFPage_GetAnnot().
157*3ac0a46fSAndroid Build Coastguard Worker //
158*3ac0a46fSAndroid Build Coastguard Worker //   page  - handle to the page that the annotation is on.
159*3ac0a46fSAndroid Build Coastguard Worker //   annot - handle to an annotation.
160*3ac0a46fSAndroid Build Coastguard Worker //
161*3ac0a46fSAndroid Build Coastguard Worker // Returns the index of |annot|, or -1 on failure.
162*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV FPDFPage_GetAnnotIndex(FPDF_PAGE page,
163*3ac0a46fSAndroid Build Coastguard Worker                                                      FPDF_ANNOTATION annot);
164*3ac0a46fSAndroid Build Coastguard Worker 
165*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
166*3ac0a46fSAndroid Build Coastguard Worker // Close an annotation. Must be called when the annotation returned by
167*3ac0a46fSAndroid Build Coastguard Worker // FPDFPage_CreateAnnot() or FPDFPage_GetAnnot() is no longer needed. This
168*3ac0a46fSAndroid Build Coastguard Worker // function does not remove the annotation from the document.
169*3ac0a46fSAndroid Build Coastguard Worker //
170*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
171*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT void FPDF_CALLCONV FPDFPage_CloseAnnot(FPDF_ANNOTATION annot);
172*3ac0a46fSAndroid Build Coastguard Worker 
173*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
174*3ac0a46fSAndroid Build Coastguard Worker // Remove the annotation in |page| at |index|.
175*3ac0a46fSAndroid Build Coastguard Worker //
176*3ac0a46fSAndroid Build Coastguard Worker //   page  - handle to a page.
177*3ac0a46fSAndroid Build Coastguard Worker //   index - the index of the annotation.
178*3ac0a46fSAndroid Build Coastguard Worker //
179*3ac0a46fSAndroid Build Coastguard Worker // Returns true if successful.
180*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_RemoveAnnot(FPDF_PAGE page,
181*3ac0a46fSAndroid Build Coastguard Worker                                                          int index);
182*3ac0a46fSAndroid Build Coastguard Worker 
183*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
184*3ac0a46fSAndroid Build Coastguard Worker // Get the subtype of an annotation.
185*3ac0a46fSAndroid Build Coastguard Worker //
186*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
187*3ac0a46fSAndroid Build Coastguard Worker //
188*3ac0a46fSAndroid Build Coastguard Worker // Returns the annotation subtype.
189*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_ANNOTATION_SUBTYPE FPDF_CALLCONV
190*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetSubtype(FPDF_ANNOTATION annot);
191*3ac0a46fSAndroid Build Coastguard Worker 
192*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
193*3ac0a46fSAndroid Build Coastguard Worker // Check if an annotation subtype is currently supported for object extraction,
194*3ac0a46fSAndroid Build Coastguard Worker // update, and removal.
195*3ac0a46fSAndroid Build Coastguard Worker // Currently supported subtypes: ink and stamp.
196*3ac0a46fSAndroid Build Coastguard Worker //
197*3ac0a46fSAndroid Build Coastguard Worker //   subtype   - the subtype to be checked.
198*3ac0a46fSAndroid Build Coastguard Worker //
199*3ac0a46fSAndroid Build Coastguard Worker // Returns true if this subtype supported.
200*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
201*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_IsObjectSupportedSubtype(FPDF_ANNOTATION_SUBTYPE subtype);
202*3ac0a46fSAndroid Build Coastguard Worker 
203*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
204*3ac0a46fSAndroid Build Coastguard Worker // Update |obj| in |annot|. |obj| must be in |annot| already and must have
205*3ac0a46fSAndroid Build Coastguard Worker // been retrieved by FPDFAnnot_GetObject(). Currently, only ink and stamp
206*3ac0a46fSAndroid Build Coastguard Worker // annotations are supported by this API. Also note that only path, image, and
207*3ac0a46fSAndroid Build Coastguard Worker // text objects have APIs for modification; see FPDFPath_*(), FPDFText_*(), and
208*3ac0a46fSAndroid Build Coastguard Worker // FPDFImageObj_*().
209*3ac0a46fSAndroid Build Coastguard Worker //
210*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
211*3ac0a46fSAndroid Build Coastguard Worker //   obj    - handle to the object that |annot| needs to update.
212*3ac0a46fSAndroid Build Coastguard Worker //
213*3ac0a46fSAndroid Build Coastguard Worker // Return true if successful.
214*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
215*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_UpdateObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj);
216*3ac0a46fSAndroid Build Coastguard Worker 
217*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
218*3ac0a46fSAndroid Build Coastguard Worker // Add a new InkStroke, represented by an array of points, to the InkList of
219*3ac0a46fSAndroid Build Coastguard Worker // |annot|. The API creates an InkList if one doesn't already exist in |annot|.
220*3ac0a46fSAndroid Build Coastguard Worker // This API works only for ink annotations. Please refer to ISO 32000-1:2008
221*3ac0a46fSAndroid Build Coastguard Worker // spec, section 12.5.6.13.
222*3ac0a46fSAndroid Build Coastguard Worker //
223*3ac0a46fSAndroid Build Coastguard Worker //   annot       - handle to an annotation.
224*3ac0a46fSAndroid Build Coastguard Worker //   points      - pointer to a FS_POINTF array representing input points.
225*3ac0a46fSAndroid Build Coastguard Worker //   point_count - number of elements in |points| array. This should not exceed
226*3ac0a46fSAndroid Build Coastguard Worker //                 the maximum value that can be represented by an int32_t).
227*3ac0a46fSAndroid Build Coastguard Worker //
228*3ac0a46fSAndroid Build Coastguard Worker // Returns the 0-based index at which the new InkStroke is added in the InkList
229*3ac0a46fSAndroid Build Coastguard Worker // of the |annot|. Returns -1 on failure.
230*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_AddInkStroke(FPDF_ANNOTATION annot,
231*3ac0a46fSAndroid Build Coastguard Worker                                                      const FS_POINTF* points,
232*3ac0a46fSAndroid Build Coastguard Worker                                                      size_t point_count);
233*3ac0a46fSAndroid Build Coastguard Worker 
234*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
235*3ac0a46fSAndroid Build Coastguard Worker // Removes an InkList in |annot|.
236*3ac0a46fSAndroid Build Coastguard Worker // This API works only for ink annotations.
237*3ac0a46fSAndroid Build Coastguard Worker //
238*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
239*3ac0a46fSAndroid Build Coastguard Worker //
240*3ac0a46fSAndroid Build Coastguard Worker // Return true on successful removal of /InkList entry from context of the
241*3ac0a46fSAndroid Build Coastguard Worker // non-null ink |annot|. Returns false on failure.
242*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
243*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_RemoveInkList(FPDF_ANNOTATION annot);
244*3ac0a46fSAndroid Build Coastguard Worker 
245*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
246*3ac0a46fSAndroid Build Coastguard Worker // Add |obj| to |annot|. |obj| must have been created by
247*3ac0a46fSAndroid Build Coastguard Worker // FPDFPageObj_CreateNew{Path|Rect}() or FPDFPageObj_New{Text|Image}Obj(), and
248*3ac0a46fSAndroid Build Coastguard Worker // will be owned by |annot|. Note that an |obj| cannot belong to more than one
249*3ac0a46fSAndroid Build Coastguard Worker // |annot|. Currently, only ink and stamp annotations are supported by this API.
250*3ac0a46fSAndroid Build Coastguard Worker // Also note that only path, image, and text objects have APIs for creation.
251*3ac0a46fSAndroid Build Coastguard Worker //
252*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
253*3ac0a46fSAndroid Build Coastguard Worker //   obj    - handle to the object that is to be added to |annot|.
254*3ac0a46fSAndroid Build Coastguard Worker //
255*3ac0a46fSAndroid Build Coastguard Worker // Return true if successful.
256*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
257*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj);
258*3ac0a46fSAndroid Build Coastguard Worker 
259*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
260*3ac0a46fSAndroid Build Coastguard Worker // Get the total number of objects in |annot|, including path objects, text
261*3ac0a46fSAndroid Build Coastguard Worker // objects, external objects, image objects, and shading objects.
262*3ac0a46fSAndroid Build Coastguard Worker //
263*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
264*3ac0a46fSAndroid Build Coastguard Worker //
265*3ac0a46fSAndroid Build Coastguard Worker // Returns the number of objects in |annot|.
266*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot);
267*3ac0a46fSAndroid Build Coastguard Worker 
268*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
269*3ac0a46fSAndroid Build Coastguard Worker // Get the object in |annot| at |index|.
270*3ac0a46fSAndroid Build Coastguard Worker //
271*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
272*3ac0a46fSAndroid Build Coastguard Worker //   index  - the index of the object.
273*3ac0a46fSAndroid Build Coastguard Worker //
274*3ac0a46fSAndroid Build Coastguard Worker // Return a handle to the object, or NULL on failure.
275*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV
276*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetObject(FPDF_ANNOTATION annot, int index);
277*3ac0a46fSAndroid Build Coastguard Worker 
278*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
279*3ac0a46fSAndroid Build Coastguard Worker // Remove the object in |annot| at |index|.
280*3ac0a46fSAndroid Build Coastguard Worker //
281*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
282*3ac0a46fSAndroid Build Coastguard Worker //   index  - the index of the object to be removed.
283*3ac0a46fSAndroid Build Coastguard Worker //
284*3ac0a46fSAndroid Build Coastguard Worker // Return true if successful.
285*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
286*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_RemoveObject(FPDF_ANNOTATION annot, int index);
287*3ac0a46fSAndroid Build Coastguard Worker 
288*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
289*3ac0a46fSAndroid Build Coastguard Worker // Set the color of an annotation. Fails when called on annotations with
290*3ac0a46fSAndroid Build Coastguard Worker // appearance streams already defined; instead use
291*3ac0a46fSAndroid Build Coastguard Worker // FPDFPath_Set{Stroke|Fill}Color().
292*3ac0a46fSAndroid Build Coastguard Worker //
293*3ac0a46fSAndroid Build Coastguard Worker //   annot    - handle to an annotation.
294*3ac0a46fSAndroid Build Coastguard Worker //   type     - type of the color to be set.
295*3ac0a46fSAndroid Build Coastguard Worker //   R, G, B  - buffer to hold the RGB value of the color. Ranges from 0 to 255.
296*3ac0a46fSAndroid Build Coastguard Worker //   A        - buffer to hold the opacity. Ranges from 0 to 255.
297*3ac0a46fSAndroid Build Coastguard Worker //
298*3ac0a46fSAndroid Build Coastguard Worker // Returns true if successful.
299*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetColor(FPDF_ANNOTATION annot,
300*3ac0a46fSAndroid Build Coastguard Worker                                                        FPDFANNOT_COLORTYPE type,
301*3ac0a46fSAndroid Build Coastguard Worker                                                        unsigned int R,
302*3ac0a46fSAndroid Build Coastguard Worker                                                        unsigned int G,
303*3ac0a46fSAndroid Build Coastguard Worker                                                        unsigned int B,
304*3ac0a46fSAndroid Build Coastguard Worker                                                        unsigned int A);
305*3ac0a46fSAndroid Build Coastguard Worker 
306*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
307*3ac0a46fSAndroid Build Coastguard Worker // Get the color of an annotation. If no color is specified, default to yellow
308*3ac0a46fSAndroid Build Coastguard Worker // for highlight annotation, black for all else. Fails when called on
309*3ac0a46fSAndroid Build Coastguard Worker // annotations with appearance streams already defined; instead use
310*3ac0a46fSAndroid Build Coastguard Worker // FPDFPath_Get{Stroke|Fill}Color().
311*3ac0a46fSAndroid Build Coastguard Worker //
312*3ac0a46fSAndroid Build Coastguard Worker //   annot    - handle to an annotation.
313*3ac0a46fSAndroid Build Coastguard Worker //   type     - type of the color requested.
314*3ac0a46fSAndroid Build Coastguard Worker //   R, G, B  - buffer to hold the RGB value of the color. Ranges from 0 to 255.
315*3ac0a46fSAndroid Build Coastguard Worker //   A        - buffer to hold the opacity. Ranges from 0 to 255.
316*3ac0a46fSAndroid Build Coastguard Worker //
317*3ac0a46fSAndroid Build Coastguard Worker // Returns true if successful.
318*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetColor(FPDF_ANNOTATION annot,
319*3ac0a46fSAndroid Build Coastguard Worker                                                        FPDFANNOT_COLORTYPE type,
320*3ac0a46fSAndroid Build Coastguard Worker                                                        unsigned int* R,
321*3ac0a46fSAndroid Build Coastguard Worker                                                        unsigned int* G,
322*3ac0a46fSAndroid Build Coastguard Worker                                                        unsigned int* B,
323*3ac0a46fSAndroid Build Coastguard Worker                                                        unsigned int* A);
324*3ac0a46fSAndroid Build Coastguard Worker 
325*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
326*3ac0a46fSAndroid Build Coastguard Worker // Check if the annotation is of a type that has attachment points
327*3ac0a46fSAndroid Build Coastguard Worker // (i.e. quadpoints). Quadpoints are the vertices of the rectangle that
328*3ac0a46fSAndroid Build Coastguard Worker // encompasses the texts affected by the annotation. They provide the
329*3ac0a46fSAndroid Build Coastguard Worker // coordinates in the page where the annotation is attached. Only text markup
330*3ac0a46fSAndroid Build Coastguard Worker // annotations (i.e. highlight, strikeout, squiggly, and underline) and link
331*3ac0a46fSAndroid Build Coastguard Worker // annotations have quadpoints.
332*3ac0a46fSAndroid Build Coastguard Worker //
333*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
334*3ac0a46fSAndroid Build Coastguard Worker //
335*3ac0a46fSAndroid Build Coastguard Worker // Returns true if the annotation is of a type that has quadpoints, false
336*3ac0a46fSAndroid Build Coastguard Worker // otherwise.
337*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
338*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot);
339*3ac0a46fSAndroid Build Coastguard Worker 
340*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
341*3ac0a46fSAndroid Build Coastguard Worker // Replace the attachment points (i.e. quadpoints) set of an annotation at
342*3ac0a46fSAndroid Build Coastguard Worker // |quad_index|. This index needs to be within the result of
343*3ac0a46fSAndroid Build Coastguard Worker // FPDFAnnot_CountAttachmentPoints().
344*3ac0a46fSAndroid Build Coastguard Worker // If the annotation's appearance stream is defined and this annotation is of a
345*3ac0a46fSAndroid Build Coastguard Worker // type with quadpoints, then update the bounding box too if the new quadpoints
346*3ac0a46fSAndroid Build Coastguard Worker // define a bigger one.
347*3ac0a46fSAndroid Build Coastguard Worker //
348*3ac0a46fSAndroid Build Coastguard Worker //   annot       - handle to an annotation.
349*3ac0a46fSAndroid Build Coastguard Worker //   quad_index  - index of the set of quadpoints.
350*3ac0a46fSAndroid Build Coastguard Worker //   quad_points - the quadpoints to be set.
351*3ac0a46fSAndroid Build Coastguard Worker //
352*3ac0a46fSAndroid Build Coastguard Worker // Returns true if successful.
353*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
354*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot,
355*3ac0a46fSAndroid Build Coastguard Worker                               size_t quad_index,
356*3ac0a46fSAndroid Build Coastguard Worker                               const FS_QUADPOINTSF* quad_points);
357*3ac0a46fSAndroid Build Coastguard Worker 
358*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
359*3ac0a46fSAndroid Build Coastguard Worker // Append to the list of attachment points (i.e. quadpoints) of an annotation.
360*3ac0a46fSAndroid Build Coastguard Worker // If the annotation's appearance stream is defined and this annotation is of a
361*3ac0a46fSAndroid Build Coastguard Worker // type with quadpoints, then update the bounding box too if the new quadpoints
362*3ac0a46fSAndroid Build Coastguard Worker // define a bigger one.
363*3ac0a46fSAndroid Build Coastguard Worker //
364*3ac0a46fSAndroid Build Coastguard Worker //   annot       - handle to an annotation.
365*3ac0a46fSAndroid Build Coastguard Worker //   quad_points - the quadpoints to be set.
366*3ac0a46fSAndroid Build Coastguard Worker //
367*3ac0a46fSAndroid Build Coastguard Worker // Returns true if successful.
368*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
369*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_AppendAttachmentPoints(FPDF_ANNOTATION annot,
370*3ac0a46fSAndroid Build Coastguard Worker                                  const FS_QUADPOINTSF* quad_points);
371*3ac0a46fSAndroid Build Coastguard Worker 
372*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
373*3ac0a46fSAndroid Build Coastguard Worker // Get the number of sets of quadpoints of an annotation.
374*3ac0a46fSAndroid Build Coastguard Worker //
375*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
376*3ac0a46fSAndroid Build Coastguard Worker //
377*3ac0a46fSAndroid Build Coastguard Worker // Returns the number of sets of quadpoints, or 0 on failure.
378*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT size_t FPDF_CALLCONV
379*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_CountAttachmentPoints(FPDF_ANNOTATION annot);
380*3ac0a46fSAndroid Build Coastguard Worker 
381*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
382*3ac0a46fSAndroid Build Coastguard Worker // Get the attachment points (i.e. quadpoints) of an annotation.
383*3ac0a46fSAndroid Build Coastguard Worker //
384*3ac0a46fSAndroid Build Coastguard Worker //   annot       - handle to an annotation.
385*3ac0a46fSAndroid Build Coastguard Worker //   quad_index  - index of the set of quadpoints.
386*3ac0a46fSAndroid Build Coastguard Worker //   quad_points - receives the quadpoints; must not be NULL.
387*3ac0a46fSAndroid Build Coastguard Worker //
388*3ac0a46fSAndroid Build Coastguard Worker // Returns true if successful.
389*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
390*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot,
391*3ac0a46fSAndroid Build Coastguard Worker                               size_t quad_index,
392*3ac0a46fSAndroid Build Coastguard Worker                               FS_QUADPOINTSF* quad_points);
393*3ac0a46fSAndroid Build Coastguard Worker 
394*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
395*3ac0a46fSAndroid Build Coastguard Worker // Set the annotation rectangle defining the location of the annotation. If the
396*3ac0a46fSAndroid Build Coastguard Worker // annotation's appearance stream is defined and this annotation is of a type
397*3ac0a46fSAndroid Build Coastguard Worker // without quadpoints, then update the bounding box too if the new rectangle
398*3ac0a46fSAndroid Build Coastguard Worker // defines a bigger one.
399*3ac0a46fSAndroid Build Coastguard Worker //
400*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
401*3ac0a46fSAndroid Build Coastguard Worker //   rect   - the annotation rectangle to be set.
402*3ac0a46fSAndroid Build Coastguard Worker //
403*3ac0a46fSAndroid Build Coastguard Worker // Returns true if successful.
404*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetRect(FPDF_ANNOTATION annot,
405*3ac0a46fSAndroid Build Coastguard Worker                                                       const FS_RECTF* rect);
406*3ac0a46fSAndroid Build Coastguard Worker 
407*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
408*3ac0a46fSAndroid Build Coastguard Worker // Get the annotation rectangle defining the location of the annotation.
409*3ac0a46fSAndroid Build Coastguard Worker //
410*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
411*3ac0a46fSAndroid Build Coastguard Worker //   rect   - receives the rectangle; must not be NULL.
412*3ac0a46fSAndroid Build Coastguard Worker //
413*3ac0a46fSAndroid Build Coastguard Worker // Returns true if successful.
414*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetRect(FPDF_ANNOTATION annot,
415*3ac0a46fSAndroid Build Coastguard Worker                                                       FS_RECTF* rect);
416*3ac0a46fSAndroid Build Coastguard Worker 
417*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
418*3ac0a46fSAndroid Build Coastguard Worker // Get the vertices of a polygon or polyline annotation. |buffer| is an array of
419*3ac0a46fSAndroid Build Coastguard Worker // points of the annotation. If |length| is less than the returned length, or
420*3ac0a46fSAndroid Build Coastguard Worker // |annot| or |buffer| is NULL, |buffer| will not be modified.
421*3ac0a46fSAndroid Build Coastguard Worker //
422*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation, as returned by e.g. FPDFPage_GetAnnot()
423*3ac0a46fSAndroid Build Coastguard Worker //   buffer - buffer for holding the points.
424*3ac0a46fSAndroid Build Coastguard Worker //   length - length of the buffer in points.
425*3ac0a46fSAndroid Build Coastguard Worker //
426*3ac0a46fSAndroid Build Coastguard Worker // Returns the number of points if the annotation is of type polygon or
427*3ac0a46fSAndroid Build Coastguard Worker // polyline, 0 otherwise.
428*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV
429*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetVertices(FPDF_ANNOTATION annot,
430*3ac0a46fSAndroid Build Coastguard Worker                       FS_POINTF* buffer,
431*3ac0a46fSAndroid Build Coastguard Worker                       unsigned long length);
432*3ac0a46fSAndroid Build Coastguard Worker 
433*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
434*3ac0a46fSAndroid Build Coastguard Worker // Get the number of paths in the ink list of an ink annotation.
435*3ac0a46fSAndroid Build Coastguard Worker //
436*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation, as returned by e.g. FPDFPage_GetAnnot()
437*3ac0a46fSAndroid Build Coastguard Worker //
438*3ac0a46fSAndroid Build Coastguard Worker // Returns the number of paths in the ink list if the annotation is of type ink,
439*3ac0a46fSAndroid Build Coastguard Worker // 0 otherwise.
440*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV
441*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetInkListCount(FPDF_ANNOTATION annot);
442*3ac0a46fSAndroid Build Coastguard Worker 
443*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
444*3ac0a46fSAndroid Build Coastguard Worker // Get a path in the ink list of an ink annotation. |buffer| is an array of
445*3ac0a46fSAndroid Build Coastguard Worker // points of the path. If |length| is less than the returned length, or |annot|
446*3ac0a46fSAndroid Build Coastguard Worker // or |buffer| is NULL, |buffer| will not be modified.
447*3ac0a46fSAndroid Build Coastguard Worker //
448*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation, as returned by e.g. FPDFPage_GetAnnot()
449*3ac0a46fSAndroid Build Coastguard Worker //   path_index - index of the path
450*3ac0a46fSAndroid Build Coastguard Worker //   buffer - buffer for holding the points.
451*3ac0a46fSAndroid Build Coastguard Worker //   length - length of the buffer in points.
452*3ac0a46fSAndroid Build Coastguard Worker //
453*3ac0a46fSAndroid Build Coastguard Worker // Returns the number of points of the path if the annotation is of type ink, 0
454*3ac0a46fSAndroid Build Coastguard Worker // otherwise.
455*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV
456*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetInkListPath(FPDF_ANNOTATION annot,
457*3ac0a46fSAndroid Build Coastguard Worker                          unsigned long path_index,
458*3ac0a46fSAndroid Build Coastguard Worker                          FS_POINTF* buffer,
459*3ac0a46fSAndroid Build Coastguard Worker                          unsigned long length);
460*3ac0a46fSAndroid Build Coastguard Worker 
461*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
462*3ac0a46fSAndroid Build Coastguard Worker // Get the starting and ending coordinates of a line annotation.
463*3ac0a46fSAndroid Build Coastguard Worker //
464*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation, as returned by e.g. FPDFPage_GetAnnot()
465*3ac0a46fSAndroid Build Coastguard Worker //   start - starting point
466*3ac0a46fSAndroid Build Coastguard Worker //   end - ending point
467*3ac0a46fSAndroid Build Coastguard Worker //
468*3ac0a46fSAndroid Build Coastguard Worker // Returns true if the annotation is of type line, |start| and |end| are not
469*3ac0a46fSAndroid Build Coastguard Worker // NULL, false otherwise.
470*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetLine(FPDF_ANNOTATION annot,
471*3ac0a46fSAndroid Build Coastguard Worker                                                       FS_POINTF* start,
472*3ac0a46fSAndroid Build Coastguard Worker                                                       FS_POINTF* end);
473*3ac0a46fSAndroid Build Coastguard Worker 
474*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
475*3ac0a46fSAndroid Build Coastguard Worker // Set the characteristics of the annotation's border (rounded rectangle).
476*3ac0a46fSAndroid Build Coastguard Worker //
477*3ac0a46fSAndroid Build Coastguard Worker //   annot              - handle to an annotation
478*3ac0a46fSAndroid Build Coastguard Worker //   horizontal_radius  - horizontal corner radius, in default user space units
479*3ac0a46fSAndroid Build Coastguard Worker //   vertical_radius    - vertical corner radius, in default user space units
480*3ac0a46fSAndroid Build Coastguard Worker //   border_width       - border width, in default user space units
481*3ac0a46fSAndroid Build Coastguard Worker //
482*3ac0a46fSAndroid Build Coastguard Worker // Returns true if setting the border for |annot| succeeds, false otherwise.
483*3ac0a46fSAndroid Build Coastguard Worker //
484*3ac0a46fSAndroid Build Coastguard Worker // If |annot| contains an appearance stream that overrides the border values,
485*3ac0a46fSAndroid Build Coastguard Worker // then the appearance stream will be removed on success.
486*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetBorder(FPDF_ANNOTATION annot,
487*3ac0a46fSAndroid Build Coastguard Worker                                                         float horizontal_radius,
488*3ac0a46fSAndroid Build Coastguard Worker                                                         float vertical_radius,
489*3ac0a46fSAndroid Build Coastguard Worker                                                         float border_width);
490*3ac0a46fSAndroid Build Coastguard Worker 
491*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
492*3ac0a46fSAndroid Build Coastguard Worker // Get the characteristics of the annotation's border (rounded rectangle).
493*3ac0a46fSAndroid Build Coastguard Worker //
494*3ac0a46fSAndroid Build Coastguard Worker //   annot              - handle to an annotation
495*3ac0a46fSAndroid Build Coastguard Worker //   horizontal_radius  - horizontal corner radius, in default user space units
496*3ac0a46fSAndroid Build Coastguard Worker //   vertical_radius    - vertical corner radius, in default user space units
497*3ac0a46fSAndroid Build Coastguard Worker //   border_width       - border width, in default user space units
498*3ac0a46fSAndroid Build Coastguard Worker //
499*3ac0a46fSAndroid Build Coastguard Worker // Returns true if |horizontal_radius|, |vertical_radius| and |border_width| are
500*3ac0a46fSAndroid Build Coastguard Worker // not NULL, false otherwise.
501*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
502*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetBorder(FPDF_ANNOTATION annot,
503*3ac0a46fSAndroid Build Coastguard Worker                     float* horizontal_radius,
504*3ac0a46fSAndroid Build Coastguard Worker                     float* vertical_radius,
505*3ac0a46fSAndroid Build Coastguard Worker                     float* border_width);
506*3ac0a46fSAndroid Build Coastguard Worker 
507*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
508*3ac0a46fSAndroid Build Coastguard Worker // Get the JavaScript of an event of the annotation's additional actions.
509*3ac0a46fSAndroid Build Coastguard Worker // |buffer| is only modified if |buflen| is large enough to hold the whole
510*3ac0a46fSAndroid Build Coastguard Worker // JavaScript string. If |buflen| is smaller, the total size of the JavaScript
511*3ac0a46fSAndroid Build Coastguard Worker // is still returned, but nothing is copied.  If there is no JavaScript for
512*3ac0a46fSAndroid Build Coastguard Worker // |event| in |annot|, an empty string is written to |buf| and 2 is returned,
513*3ac0a46fSAndroid Build Coastguard Worker // denoting the size of the null terminator in the buffer.  On other errors,
514*3ac0a46fSAndroid Build Coastguard Worker // nothing is written to |buffer| and 0 is returned.
515*3ac0a46fSAndroid Build Coastguard Worker //
516*3ac0a46fSAndroid Build Coastguard Worker //    hHandle     -   handle to the form fill module, returned by
517*3ac0a46fSAndroid Build Coastguard Worker //                    FPDFDOC_InitFormFillEnvironment().
518*3ac0a46fSAndroid Build Coastguard Worker //    annot       -   handle to an interactive form annotation.
519*3ac0a46fSAndroid Build Coastguard Worker //    event       -   event type, one of the FPDF_ANNOT_AACTION_* values.
520*3ac0a46fSAndroid Build Coastguard Worker //    buffer      -   buffer for holding the value string, encoded in UTF-16LE.
521*3ac0a46fSAndroid Build Coastguard Worker //    buflen      -   length of the buffer in bytes.
522*3ac0a46fSAndroid Build Coastguard Worker //
523*3ac0a46fSAndroid Build Coastguard Worker // Returns the length of the string value in bytes, including the 2-byte
524*3ac0a46fSAndroid Build Coastguard Worker // null terminator.
525*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV
526*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFormAdditionalActionJavaScript(FPDF_FORMHANDLE hHandle,
527*3ac0a46fSAndroid Build Coastguard Worker                                             FPDF_ANNOTATION annot,
528*3ac0a46fSAndroid Build Coastguard Worker                                             int event,
529*3ac0a46fSAndroid Build Coastguard Worker                                             FPDF_WCHAR* buffer,
530*3ac0a46fSAndroid Build Coastguard Worker                                             unsigned long buflen);
531*3ac0a46fSAndroid Build Coastguard Worker 
532*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
533*3ac0a46fSAndroid Build Coastguard Worker // Check if |annot|'s dictionary has |key| as a key.
534*3ac0a46fSAndroid Build Coastguard Worker //
535*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
536*3ac0a46fSAndroid Build Coastguard Worker //   key    - the key to look for, encoded in UTF-8.
537*3ac0a46fSAndroid Build Coastguard Worker //
538*3ac0a46fSAndroid Build Coastguard Worker // Returns true if |key| exists.
539*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_HasKey(FPDF_ANNOTATION annot,
540*3ac0a46fSAndroid Build Coastguard Worker                                                      FPDF_BYTESTRING key);
541*3ac0a46fSAndroid Build Coastguard Worker 
542*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
543*3ac0a46fSAndroid Build Coastguard Worker // Get the type of the value corresponding to |key| in |annot|'s dictionary.
544*3ac0a46fSAndroid Build Coastguard Worker //
545*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
546*3ac0a46fSAndroid Build Coastguard Worker //   key    - the key to look for, encoded in UTF-8.
547*3ac0a46fSAndroid Build Coastguard Worker //
548*3ac0a46fSAndroid Build Coastguard Worker // Returns the type of the dictionary value.
549*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV
550*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetValueType(FPDF_ANNOTATION annot, FPDF_BYTESTRING key);
551*3ac0a46fSAndroid Build Coastguard Worker 
552*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
553*3ac0a46fSAndroid Build Coastguard Worker // Set the string value corresponding to |key| in |annot|'s dictionary,
554*3ac0a46fSAndroid Build Coastguard Worker // overwriting the existing value if any. The value type would be
555*3ac0a46fSAndroid Build Coastguard Worker // FPDF_OBJECT_STRING after this function call succeeds.
556*3ac0a46fSAndroid Build Coastguard Worker //
557*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
558*3ac0a46fSAndroid Build Coastguard Worker //   key    - the key to the dictionary entry to be set, encoded in UTF-8.
559*3ac0a46fSAndroid Build Coastguard Worker //   value  - the string value to be set, encoded in UTF-16LE.
560*3ac0a46fSAndroid Build Coastguard Worker //
561*3ac0a46fSAndroid Build Coastguard Worker // Returns true if successful.
562*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
563*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_SetStringValue(FPDF_ANNOTATION annot,
564*3ac0a46fSAndroid Build Coastguard Worker                          FPDF_BYTESTRING key,
565*3ac0a46fSAndroid Build Coastguard Worker                          FPDF_WIDESTRING value);
566*3ac0a46fSAndroid Build Coastguard Worker 
567*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
568*3ac0a46fSAndroid Build Coastguard Worker // Get the string value corresponding to |key| in |annot|'s dictionary. |buffer|
569*3ac0a46fSAndroid Build Coastguard Worker // is only modified if |buflen| is longer than the length of contents. Note that
570*3ac0a46fSAndroid Build Coastguard Worker // if |key| does not exist in the dictionary or if |key|'s corresponding value
571*3ac0a46fSAndroid Build Coastguard Worker // in the dictionary is not a string (i.e. the value is not of type
572*3ac0a46fSAndroid Build Coastguard Worker // FPDF_OBJECT_STRING or FPDF_OBJECT_NAME), then an empty string would be copied
573*3ac0a46fSAndroid Build Coastguard Worker // to |buffer| and the return value would be 2. On other errors, nothing would
574*3ac0a46fSAndroid Build Coastguard Worker // be added to |buffer| and the return value would be 0.
575*3ac0a46fSAndroid Build Coastguard Worker //
576*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
577*3ac0a46fSAndroid Build Coastguard Worker //   key    - the key to the requested dictionary entry, encoded in UTF-8.
578*3ac0a46fSAndroid Build Coastguard Worker //   buffer - buffer for holding the value string, encoded in UTF-16LE.
579*3ac0a46fSAndroid Build Coastguard Worker //   buflen - length of the buffer in bytes.
580*3ac0a46fSAndroid Build Coastguard Worker //
581*3ac0a46fSAndroid Build Coastguard Worker // Returns the length of the string value in bytes.
582*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV
583*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetStringValue(FPDF_ANNOTATION annot,
584*3ac0a46fSAndroid Build Coastguard Worker                          FPDF_BYTESTRING key,
585*3ac0a46fSAndroid Build Coastguard Worker                          FPDF_WCHAR* buffer,
586*3ac0a46fSAndroid Build Coastguard Worker                          unsigned long buflen);
587*3ac0a46fSAndroid Build Coastguard Worker 
588*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
589*3ac0a46fSAndroid Build Coastguard Worker // Get the float value corresponding to |key| in |annot|'s dictionary. Writes
590*3ac0a46fSAndroid Build Coastguard Worker // value to |value| and returns True if |key| exists in the dictionary and
591*3ac0a46fSAndroid Build Coastguard Worker // |key|'s corresponding value is a number (FPDF_OBJECT_NUMBER), False
592*3ac0a46fSAndroid Build Coastguard Worker // otherwise.
593*3ac0a46fSAndroid Build Coastguard Worker //
594*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
595*3ac0a46fSAndroid Build Coastguard Worker //   key    - the key to the requested dictionary entry, encoded in UTF-8.
596*3ac0a46fSAndroid Build Coastguard Worker //   value  - receives the value, must not be NULL.
597*3ac0a46fSAndroid Build Coastguard Worker //
598*3ac0a46fSAndroid Build Coastguard Worker // Returns True if value found, False otherwise.
599*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
600*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetNumberValue(FPDF_ANNOTATION annot,
601*3ac0a46fSAndroid Build Coastguard Worker                          FPDF_BYTESTRING key,
602*3ac0a46fSAndroid Build Coastguard Worker                          float* value);
603*3ac0a46fSAndroid Build Coastguard Worker 
604*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
605*3ac0a46fSAndroid Build Coastguard Worker // Set the AP (appearance string) in |annot|'s dictionary for a given
606*3ac0a46fSAndroid Build Coastguard Worker // |appearanceMode|.
607*3ac0a46fSAndroid Build Coastguard Worker //
608*3ac0a46fSAndroid Build Coastguard Worker //   annot          - handle to an annotation.
609*3ac0a46fSAndroid Build Coastguard Worker //   appearanceMode - the appearance mode (normal, rollover or down) for which
610*3ac0a46fSAndroid Build Coastguard Worker //                    to get the AP.
611*3ac0a46fSAndroid Build Coastguard Worker //   value          - the string value to be set, encoded in UTF-16LE. If
612*3ac0a46fSAndroid Build Coastguard Worker //                    nullptr is passed, the AP is cleared for that mode. If the
613*3ac0a46fSAndroid Build Coastguard Worker //                    mode is Normal, APs for all modes are cleared.
614*3ac0a46fSAndroid Build Coastguard Worker //
615*3ac0a46fSAndroid Build Coastguard Worker // Returns true if successful.
616*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
617*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_SetAP(FPDF_ANNOTATION annot,
618*3ac0a46fSAndroid Build Coastguard Worker                 FPDF_ANNOT_APPEARANCEMODE appearanceMode,
619*3ac0a46fSAndroid Build Coastguard Worker                 FPDF_WIDESTRING value);
620*3ac0a46fSAndroid Build Coastguard Worker 
621*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
622*3ac0a46fSAndroid Build Coastguard Worker // Get the AP (appearance string) from |annot|'s dictionary for a given
623*3ac0a46fSAndroid Build Coastguard Worker // |appearanceMode|.
624*3ac0a46fSAndroid Build Coastguard Worker // |buffer| is only modified if |buflen| is large enough to hold the whole AP
625*3ac0a46fSAndroid Build Coastguard Worker // string. If |buflen| is smaller, the total size of the AP is still returned,
626*3ac0a46fSAndroid Build Coastguard Worker // but nothing is copied.
627*3ac0a46fSAndroid Build Coastguard Worker // If there is no appearance stream for |annot| in |appearanceMode|, an empty
628*3ac0a46fSAndroid Build Coastguard Worker // string is written to |buf| and 2 is returned.
629*3ac0a46fSAndroid Build Coastguard Worker // On other errors, nothing is written to |buffer| and 0 is returned.
630*3ac0a46fSAndroid Build Coastguard Worker //
631*3ac0a46fSAndroid Build Coastguard Worker //   annot          - handle to an annotation.
632*3ac0a46fSAndroid Build Coastguard Worker //   appearanceMode - the appearance mode (normal, rollover or down) for which
633*3ac0a46fSAndroid Build Coastguard Worker //                    to get the AP.
634*3ac0a46fSAndroid Build Coastguard Worker //   buffer         - buffer for holding the value string, encoded in UTF-16LE.
635*3ac0a46fSAndroid Build Coastguard Worker //   buflen         - length of the buffer in bytes.
636*3ac0a46fSAndroid Build Coastguard Worker //
637*3ac0a46fSAndroid Build Coastguard Worker // Returns the length of the string value in bytes.
638*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV
639*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetAP(FPDF_ANNOTATION annot,
640*3ac0a46fSAndroid Build Coastguard Worker                 FPDF_ANNOT_APPEARANCEMODE appearanceMode,
641*3ac0a46fSAndroid Build Coastguard Worker                 FPDF_WCHAR* buffer,
642*3ac0a46fSAndroid Build Coastguard Worker                 unsigned long buflen);
643*3ac0a46fSAndroid Build Coastguard Worker 
644*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
645*3ac0a46fSAndroid Build Coastguard Worker // Get the annotation corresponding to |key| in |annot|'s dictionary. Common
646*3ac0a46fSAndroid Build Coastguard Worker // keys for linking annotations include "IRT" and "Popup". Must call
647*3ac0a46fSAndroid Build Coastguard Worker // FPDFPage_CloseAnnot() when the annotation returned by this function is no
648*3ac0a46fSAndroid Build Coastguard Worker // longer needed.
649*3ac0a46fSAndroid Build Coastguard Worker //
650*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to an annotation.
651*3ac0a46fSAndroid Build Coastguard Worker //   key    - the key to the requested dictionary entry, encoded in UTF-8.
652*3ac0a46fSAndroid Build Coastguard Worker //
653*3ac0a46fSAndroid Build Coastguard Worker // Returns a handle to the linked annotation object, or NULL on failure.
654*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV
655*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetLinkedAnnot(FPDF_ANNOTATION annot, FPDF_BYTESTRING key);
656*3ac0a46fSAndroid Build Coastguard Worker 
657*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
658*3ac0a46fSAndroid Build Coastguard Worker // Get the annotation flags of |annot|.
659*3ac0a46fSAndroid Build Coastguard Worker //
660*3ac0a46fSAndroid Build Coastguard Worker //   annot    - handle to an annotation.
661*3ac0a46fSAndroid Build Coastguard Worker //
662*3ac0a46fSAndroid Build Coastguard Worker // Returns the annotation flags.
663*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetFlags(FPDF_ANNOTATION annot);
664*3ac0a46fSAndroid Build Coastguard Worker 
665*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
666*3ac0a46fSAndroid Build Coastguard Worker // Set the |annot|'s flags to be of the value |flags|.
667*3ac0a46fSAndroid Build Coastguard Worker //
668*3ac0a46fSAndroid Build Coastguard Worker //   annot      - handle to an annotation.
669*3ac0a46fSAndroid Build Coastguard Worker //   flags      - the flag values to be set.
670*3ac0a46fSAndroid Build Coastguard Worker //
671*3ac0a46fSAndroid Build Coastguard Worker // Returns true if successful.
672*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetFlags(FPDF_ANNOTATION annot,
673*3ac0a46fSAndroid Build Coastguard Worker                                                        int flags);
674*3ac0a46fSAndroid Build Coastguard Worker 
675*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
676*3ac0a46fSAndroid Build Coastguard Worker // Get the annotation flags of |annot|.
677*3ac0a46fSAndroid Build Coastguard Worker //
678*3ac0a46fSAndroid Build Coastguard Worker //    hHandle     -   handle to the form fill module, returned by
679*3ac0a46fSAndroid Build Coastguard Worker //                    FPDFDOC_InitFormFillEnvironment().
680*3ac0a46fSAndroid Build Coastguard Worker //    annot       -   handle to an interactive form annotation.
681*3ac0a46fSAndroid Build Coastguard Worker //
682*3ac0a46fSAndroid Build Coastguard Worker // Returns the annotation flags specific to interactive forms.
683*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV
684*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFormFieldFlags(FPDF_FORMHANDLE handle,
685*3ac0a46fSAndroid Build Coastguard Worker                             FPDF_ANNOTATION annot);
686*3ac0a46fSAndroid Build Coastguard Worker 
687*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
688*3ac0a46fSAndroid Build Coastguard Worker // Retrieves an interactive form annotation whose rectangle contains a given
689*3ac0a46fSAndroid Build Coastguard Worker // point on a page. Must call FPDFPage_CloseAnnot() when the annotation returned
690*3ac0a46fSAndroid Build Coastguard Worker // is no longer needed.
691*3ac0a46fSAndroid Build Coastguard Worker //
692*3ac0a46fSAndroid Build Coastguard Worker //
693*3ac0a46fSAndroid Build Coastguard Worker //    hHandle     -   handle to the form fill module, returned by
694*3ac0a46fSAndroid Build Coastguard Worker //                    FPDFDOC_InitFormFillEnvironment().
695*3ac0a46fSAndroid Build Coastguard Worker //    page        -   handle to the page, returned by FPDF_LoadPage function.
696*3ac0a46fSAndroid Build Coastguard Worker //    point       -   position in PDF "user space".
697*3ac0a46fSAndroid Build Coastguard Worker //
698*3ac0a46fSAndroid Build Coastguard Worker // Returns the interactive form annotation whose rectangle contains the given
699*3ac0a46fSAndroid Build Coastguard Worker // coordinates on the page. If there is no such annotation, return NULL.
700*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV
701*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
702*3ac0a46fSAndroid Build Coastguard Worker                               FPDF_PAGE page,
703*3ac0a46fSAndroid Build Coastguard Worker                               const FS_POINTF* point);
704*3ac0a46fSAndroid Build Coastguard Worker 
705*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
706*3ac0a46fSAndroid Build Coastguard Worker // Gets the name of |annot|, which is an interactive form annotation.
707*3ac0a46fSAndroid Build Coastguard Worker // |buffer| is only modified if |buflen| is longer than the length of contents.
708*3ac0a46fSAndroid Build Coastguard Worker // In case of error, nothing will be added to |buffer| and the return value will
709*3ac0a46fSAndroid Build Coastguard Worker // be 0. Note that return value of empty string is 2 for "\0\0".
710*3ac0a46fSAndroid Build Coastguard Worker //
711*3ac0a46fSAndroid Build Coastguard Worker //    hHandle     -   handle to the form fill module, returned by
712*3ac0a46fSAndroid Build Coastguard Worker //                    FPDFDOC_InitFormFillEnvironment().
713*3ac0a46fSAndroid Build Coastguard Worker //    annot       -   handle to an interactive form annotation.
714*3ac0a46fSAndroid Build Coastguard Worker //    buffer      -   buffer for holding the name string, encoded in UTF-16LE.
715*3ac0a46fSAndroid Build Coastguard Worker //    buflen      -   length of the buffer in bytes.
716*3ac0a46fSAndroid Build Coastguard Worker //
717*3ac0a46fSAndroid Build Coastguard Worker // Returns the length of the string value in bytes.
718*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV
719*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFormFieldName(FPDF_FORMHANDLE hHandle,
720*3ac0a46fSAndroid Build Coastguard Worker                            FPDF_ANNOTATION annot,
721*3ac0a46fSAndroid Build Coastguard Worker                            FPDF_WCHAR* buffer,
722*3ac0a46fSAndroid Build Coastguard Worker                            unsigned long buflen);
723*3ac0a46fSAndroid Build Coastguard Worker 
724*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
725*3ac0a46fSAndroid Build Coastguard Worker // Gets the alternate name of |annot|, which is an interactive form annotation.
726*3ac0a46fSAndroid Build Coastguard Worker // |buffer| is only modified if |buflen| is longer than the length of contents.
727*3ac0a46fSAndroid Build Coastguard Worker // In case of error, nothing will be added to |buffer| and the return value will
728*3ac0a46fSAndroid Build Coastguard Worker // be 0. Note that return value of empty string is 2 for "\0\0".
729*3ac0a46fSAndroid Build Coastguard Worker //
730*3ac0a46fSAndroid Build Coastguard Worker //    hHandle     -   handle to the form fill module, returned by
731*3ac0a46fSAndroid Build Coastguard Worker //                    FPDFDOC_InitFormFillEnvironment().
732*3ac0a46fSAndroid Build Coastguard Worker //    annot       -   handle to an interactive form annotation.
733*3ac0a46fSAndroid Build Coastguard Worker //    buffer      -   buffer for holding the alternate name string, encoded in
734*3ac0a46fSAndroid Build Coastguard Worker //                    UTF-16LE.
735*3ac0a46fSAndroid Build Coastguard Worker //    buflen      -   length of the buffer in bytes.
736*3ac0a46fSAndroid Build Coastguard Worker //
737*3ac0a46fSAndroid Build Coastguard Worker // Returns the length of the string value in bytes.
738*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV
739*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFormFieldAlternateName(FPDF_FORMHANDLE hHandle,
740*3ac0a46fSAndroid Build Coastguard Worker                                     FPDF_ANNOTATION annot,
741*3ac0a46fSAndroid Build Coastguard Worker                                     FPDF_WCHAR* buffer,
742*3ac0a46fSAndroid Build Coastguard Worker                                     unsigned long buflen);
743*3ac0a46fSAndroid Build Coastguard Worker 
744*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
745*3ac0a46fSAndroid Build Coastguard Worker // Gets the form field type of |annot|, which is an interactive form annotation.
746*3ac0a46fSAndroid Build Coastguard Worker //
747*3ac0a46fSAndroid Build Coastguard Worker //    hHandle     -   handle to the form fill module, returned by
748*3ac0a46fSAndroid Build Coastguard Worker //                    FPDFDOC_InitFormFillEnvironment().
749*3ac0a46fSAndroid Build Coastguard Worker //    annot       -   handle to an interactive form annotation.
750*3ac0a46fSAndroid Build Coastguard Worker //
751*3ac0a46fSAndroid Build Coastguard Worker // Returns the type of the form field (one of the FPDF_FORMFIELD_* values) on
752*3ac0a46fSAndroid Build Coastguard Worker // success. Returns -1 on error.
753*3ac0a46fSAndroid Build Coastguard Worker // See field types in fpdf_formfill.h.
754*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV
755*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFormFieldType(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot);
756*3ac0a46fSAndroid Build Coastguard Worker 
757*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
758*3ac0a46fSAndroid Build Coastguard Worker // Gets the value of |annot|, which is an interactive form annotation.
759*3ac0a46fSAndroid Build Coastguard Worker // |buffer| is only modified if |buflen| is longer than the length of contents.
760*3ac0a46fSAndroid Build Coastguard Worker // In case of error, nothing will be added to |buffer| and the return value will
761*3ac0a46fSAndroid Build Coastguard Worker // be 0. Note that return value of empty string is 2 for "\0\0".
762*3ac0a46fSAndroid Build Coastguard Worker //
763*3ac0a46fSAndroid Build Coastguard Worker //    hHandle     -   handle to the form fill module, returned by
764*3ac0a46fSAndroid Build Coastguard Worker //                    FPDFDOC_InitFormFillEnvironment().
765*3ac0a46fSAndroid Build Coastguard Worker //    annot       -   handle to an interactive form annotation.
766*3ac0a46fSAndroid Build Coastguard Worker //    buffer      -   buffer for holding the value string, encoded in UTF-16LE.
767*3ac0a46fSAndroid Build Coastguard Worker //    buflen      -   length of the buffer in bytes.
768*3ac0a46fSAndroid Build Coastguard Worker //
769*3ac0a46fSAndroid Build Coastguard Worker // Returns the length of the string value in bytes.
770*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV
771*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFormFieldValue(FPDF_FORMHANDLE hHandle,
772*3ac0a46fSAndroid Build Coastguard Worker                             FPDF_ANNOTATION annot,
773*3ac0a46fSAndroid Build Coastguard Worker                             FPDF_WCHAR* buffer,
774*3ac0a46fSAndroid Build Coastguard Worker                             unsigned long buflen);
775*3ac0a46fSAndroid Build Coastguard Worker 
776*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
777*3ac0a46fSAndroid Build Coastguard Worker // Get the number of options in the |annot|'s "Opt" dictionary. Intended for
778*3ac0a46fSAndroid Build Coastguard Worker // use with listbox and combobox widget annotations.
779*3ac0a46fSAndroid Build Coastguard Worker //
780*3ac0a46fSAndroid Build Coastguard Worker //   hHandle - handle to the form fill module, returned by
781*3ac0a46fSAndroid Build Coastguard Worker //             FPDFDOC_InitFormFillEnvironment.
782*3ac0a46fSAndroid Build Coastguard Worker //   annot   - handle to an annotation.
783*3ac0a46fSAndroid Build Coastguard Worker //
784*3ac0a46fSAndroid Build Coastguard Worker // Returns the number of options in "Opt" dictionary on success. Return value
785*3ac0a46fSAndroid Build Coastguard Worker // will be -1 if annotation does not have an "Opt" dictionary or other error.
786*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetOptionCount(FPDF_FORMHANDLE hHandle,
787*3ac0a46fSAndroid Build Coastguard Worker                                                        FPDF_ANNOTATION annot);
788*3ac0a46fSAndroid Build Coastguard Worker 
789*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
790*3ac0a46fSAndroid Build Coastguard Worker // Get the string value for the label of the option at |index| in |annot|'s
791*3ac0a46fSAndroid Build Coastguard Worker // "Opt" dictionary. Intended for use with listbox and combobox widget
792*3ac0a46fSAndroid Build Coastguard Worker // annotations. |buffer| is only modified if |buflen| is longer than the length
793*3ac0a46fSAndroid Build Coastguard Worker // of contents. If index is out of range or in case of other error, nothing
794*3ac0a46fSAndroid Build Coastguard Worker // will be added to |buffer| and the return value will be 0. Note that
795*3ac0a46fSAndroid Build Coastguard Worker // return value of empty string is 2 for "\0\0".
796*3ac0a46fSAndroid Build Coastguard Worker //
797*3ac0a46fSAndroid Build Coastguard Worker //   hHandle - handle to the form fill module, returned by
798*3ac0a46fSAndroid Build Coastguard Worker //             FPDFDOC_InitFormFillEnvironment.
799*3ac0a46fSAndroid Build Coastguard Worker //   annot   - handle to an annotation.
800*3ac0a46fSAndroid Build Coastguard Worker //   index   - numeric index of the option in the "Opt" array
801*3ac0a46fSAndroid Build Coastguard Worker //   buffer  - buffer for holding the value string, encoded in UTF-16LE.
802*3ac0a46fSAndroid Build Coastguard Worker //   buflen  - length of the buffer in bytes.
803*3ac0a46fSAndroid Build Coastguard Worker //
804*3ac0a46fSAndroid Build Coastguard Worker // Returns the length of the string value in bytes.
805*3ac0a46fSAndroid Build Coastguard Worker // If |annot| does not have an "Opt" array, |index| is out of range or if any
806*3ac0a46fSAndroid Build Coastguard Worker // other error occurs, returns 0.
807*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV
808*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetOptionLabel(FPDF_FORMHANDLE hHandle,
809*3ac0a46fSAndroid Build Coastguard Worker                          FPDF_ANNOTATION annot,
810*3ac0a46fSAndroid Build Coastguard Worker                          int index,
811*3ac0a46fSAndroid Build Coastguard Worker                          FPDF_WCHAR* buffer,
812*3ac0a46fSAndroid Build Coastguard Worker                          unsigned long buflen);
813*3ac0a46fSAndroid Build Coastguard Worker 
814*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
815*3ac0a46fSAndroid Build Coastguard Worker // Determine whether or not the option at |index| in |annot|'s "Opt" dictionary
816*3ac0a46fSAndroid Build Coastguard Worker // is selected. Intended for use with listbox and combobox widget annotations.
817*3ac0a46fSAndroid Build Coastguard Worker //
818*3ac0a46fSAndroid Build Coastguard Worker //   handle  - handle to the form fill module, returned by
819*3ac0a46fSAndroid Build Coastguard Worker //             FPDFDOC_InitFormFillEnvironment.
820*3ac0a46fSAndroid Build Coastguard Worker //   annot   - handle to an annotation.
821*3ac0a46fSAndroid Build Coastguard Worker //   index   - numeric index of the option in the "Opt" array.
822*3ac0a46fSAndroid Build Coastguard Worker //
823*3ac0a46fSAndroid Build Coastguard Worker // Returns true if the option at |index| in |annot|'s "Opt" dictionary is
824*3ac0a46fSAndroid Build Coastguard Worker // selected, false otherwise.
825*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
826*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_IsOptionSelected(FPDF_FORMHANDLE handle,
827*3ac0a46fSAndroid Build Coastguard Worker                            FPDF_ANNOTATION annot,
828*3ac0a46fSAndroid Build Coastguard Worker                            int index);
829*3ac0a46fSAndroid Build Coastguard Worker 
830*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
831*3ac0a46fSAndroid Build Coastguard Worker // Get the float value of the font size for an |annot| with variable text.
832*3ac0a46fSAndroid Build Coastguard Worker // If 0, the font is to be auto-sized: its size is computed as a function of
833*3ac0a46fSAndroid Build Coastguard Worker // the height of the annotation rectangle.
834*3ac0a46fSAndroid Build Coastguard Worker //
835*3ac0a46fSAndroid Build Coastguard Worker //   hHandle - handle to the form fill module, returned by
836*3ac0a46fSAndroid Build Coastguard Worker //             FPDFDOC_InitFormFillEnvironment.
837*3ac0a46fSAndroid Build Coastguard Worker //   annot   - handle to an annotation.
838*3ac0a46fSAndroid Build Coastguard Worker //   value   - Required. Float which will be set to font size on success.
839*3ac0a46fSAndroid Build Coastguard Worker //
840*3ac0a46fSAndroid Build Coastguard Worker // Returns true if the font size was set in |value|, false on error or if
841*3ac0a46fSAndroid Build Coastguard Worker // |value| not provided.
842*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
843*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFontSize(FPDF_FORMHANDLE hHandle,
844*3ac0a46fSAndroid Build Coastguard Worker                       FPDF_ANNOTATION annot,
845*3ac0a46fSAndroid Build Coastguard Worker                       float* value);
846*3ac0a46fSAndroid Build Coastguard Worker 
847*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
848*3ac0a46fSAndroid Build Coastguard Worker // Determine if |annot| is a form widget that is checked. Intended for use with
849*3ac0a46fSAndroid Build Coastguard Worker // checkbox and radio button widgets.
850*3ac0a46fSAndroid Build Coastguard Worker //
851*3ac0a46fSAndroid Build Coastguard Worker //   hHandle - handle to the form fill module, returned by
852*3ac0a46fSAndroid Build Coastguard Worker //             FPDFDOC_InitFormFillEnvironment.
853*3ac0a46fSAndroid Build Coastguard Worker //   annot   - handle to an annotation.
854*3ac0a46fSAndroid Build Coastguard Worker //
855*3ac0a46fSAndroid Build Coastguard Worker // Returns true if |annot| is a form widget and is checked, false otherwise.
856*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_IsChecked(FPDF_FORMHANDLE hHandle,
857*3ac0a46fSAndroid Build Coastguard Worker                                                         FPDF_ANNOTATION annot);
858*3ac0a46fSAndroid Build Coastguard Worker 
859*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
860*3ac0a46fSAndroid Build Coastguard Worker // Set the list of focusable annotation subtypes. Annotations of subtype
861*3ac0a46fSAndroid Build Coastguard Worker // FPDF_ANNOT_WIDGET are by default focusable. New subtypes set using this API
862*3ac0a46fSAndroid Build Coastguard Worker // will override the existing subtypes.
863*3ac0a46fSAndroid Build Coastguard Worker //
864*3ac0a46fSAndroid Build Coastguard Worker //   hHandle  - handle to the form fill module, returned by
865*3ac0a46fSAndroid Build Coastguard Worker //              FPDFDOC_InitFormFillEnvironment.
866*3ac0a46fSAndroid Build Coastguard Worker //   subtypes - list of annotation subtype which can be tabbed over.
867*3ac0a46fSAndroid Build Coastguard Worker //   count    - total number of annotation subtype in list.
868*3ac0a46fSAndroid Build Coastguard Worker // Returns true if list of annotation subtype is set successfully, false
869*3ac0a46fSAndroid Build Coastguard Worker // otherwise.
870*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
871*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_SetFocusableSubtypes(FPDF_FORMHANDLE hHandle,
872*3ac0a46fSAndroid Build Coastguard Worker                                const FPDF_ANNOTATION_SUBTYPE* subtypes,
873*3ac0a46fSAndroid Build Coastguard Worker                                size_t count);
874*3ac0a46fSAndroid Build Coastguard Worker 
875*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
876*3ac0a46fSAndroid Build Coastguard Worker // Get the count of focusable annotation subtypes as set by host
877*3ac0a46fSAndroid Build Coastguard Worker // for a |hHandle|.
878*3ac0a46fSAndroid Build Coastguard Worker //
879*3ac0a46fSAndroid Build Coastguard Worker //   hHandle  - handle to the form fill module, returned by
880*3ac0a46fSAndroid Build Coastguard Worker //              FPDFDOC_InitFormFillEnvironment.
881*3ac0a46fSAndroid Build Coastguard Worker // Returns the count of focusable annotation subtypes or -1 on error.
882*3ac0a46fSAndroid Build Coastguard Worker // Note : Annotations of type FPDF_ANNOT_WIDGET are by default focusable.
883*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV
884*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFocusableSubtypesCount(FPDF_FORMHANDLE hHandle);
885*3ac0a46fSAndroid Build Coastguard Worker 
886*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
887*3ac0a46fSAndroid Build Coastguard Worker // Get the list of focusable annotation subtype as set by host.
888*3ac0a46fSAndroid Build Coastguard Worker //
889*3ac0a46fSAndroid Build Coastguard Worker //   hHandle  - handle to the form fill module, returned by
890*3ac0a46fSAndroid Build Coastguard Worker //              FPDFDOC_InitFormFillEnvironment.
891*3ac0a46fSAndroid Build Coastguard Worker //   subtypes - receives the list of annotation subtype which can be tabbed
892*3ac0a46fSAndroid Build Coastguard Worker //              over. Caller must have allocated |subtypes| more than or
893*3ac0a46fSAndroid Build Coastguard Worker //              equal to the count obtained from
894*3ac0a46fSAndroid Build Coastguard Worker //              FPDFAnnot_GetFocusableSubtypesCount() API.
895*3ac0a46fSAndroid Build Coastguard Worker //   count    - size of |subtypes|.
896*3ac0a46fSAndroid Build Coastguard Worker // Returns true on success and set list of annotation subtype to |subtypes|,
897*3ac0a46fSAndroid Build Coastguard Worker // false otherwise.
898*3ac0a46fSAndroid Build Coastguard Worker // Note : Annotations of type FPDF_ANNOT_WIDGET are by default focusable.
899*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
900*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFocusableSubtypes(FPDF_FORMHANDLE hHandle,
901*3ac0a46fSAndroid Build Coastguard Worker                                FPDF_ANNOTATION_SUBTYPE* subtypes,
902*3ac0a46fSAndroid Build Coastguard Worker                                size_t count);
903*3ac0a46fSAndroid Build Coastguard Worker 
904*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
905*3ac0a46fSAndroid Build Coastguard Worker // Gets FPDF_LINK object for |annot|. Intended to use for link annotations.
906*3ac0a46fSAndroid Build Coastguard Worker //
907*3ac0a46fSAndroid Build Coastguard Worker //   annot   - handle to an annotation.
908*3ac0a46fSAndroid Build Coastguard Worker //
909*3ac0a46fSAndroid Build Coastguard Worker // Returns FPDF_LINK from the FPDF_ANNOTATION and NULL on failure,
910*3ac0a46fSAndroid Build Coastguard Worker // if the input annot is NULL or input annot's subtype is not link.
911*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_LINK FPDF_CALLCONV FPDFAnnot_GetLink(FPDF_ANNOTATION annot);
912*3ac0a46fSAndroid Build Coastguard Worker 
913*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
914*3ac0a46fSAndroid Build Coastguard Worker // Gets the count of annotations in the |annot|'s control group.
915*3ac0a46fSAndroid Build Coastguard Worker // A group of interactive form annotations is collectively called a form
916*3ac0a46fSAndroid Build Coastguard Worker // control group. Here, |annot|, an interactive form annotation, should be
917*3ac0a46fSAndroid Build Coastguard Worker // either a radio button or a checkbox.
918*3ac0a46fSAndroid Build Coastguard Worker //
919*3ac0a46fSAndroid Build Coastguard Worker //   hHandle - handle to the form fill module, returned by
920*3ac0a46fSAndroid Build Coastguard Worker //             FPDFDOC_InitFormFillEnvironment.
921*3ac0a46fSAndroid Build Coastguard Worker //   annot   - handle to an annotation.
922*3ac0a46fSAndroid Build Coastguard Worker //
923*3ac0a46fSAndroid Build Coastguard Worker // Returns number of controls in its control group or -1 on error.
924*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV
925*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFormControlCount(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot);
926*3ac0a46fSAndroid Build Coastguard Worker 
927*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
928*3ac0a46fSAndroid Build Coastguard Worker // Gets the index of |annot| in |annot|'s control group.
929*3ac0a46fSAndroid Build Coastguard Worker // A group of interactive form annotations is collectively called a form
930*3ac0a46fSAndroid Build Coastguard Worker // control group. Here, |annot|, an interactive form annotation, should be
931*3ac0a46fSAndroid Build Coastguard Worker // either a radio button or a checkbox.
932*3ac0a46fSAndroid Build Coastguard Worker //
933*3ac0a46fSAndroid Build Coastguard Worker //   hHandle - handle to the form fill module, returned by
934*3ac0a46fSAndroid Build Coastguard Worker //             FPDFDOC_InitFormFillEnvironment.
935*3ac0a46fSAndroid Build Coastguard Worker //   annot   - handle to an annotation.
936*3ac0a46fSAndroid Build Coastguard Worker //
937*3ac0a46fSAndroid Build Coastguard Worker // Returns index of a given |annot| in its control group or -1 on error.
938*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT int FPDF_CALLCONV
939*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFormControlIndex(FPDF_FORMHANDLE hHandle, FPDF_ANNOTATION annot);
940*3ac0a46fSAndroid Build Coastguard Worker 
941*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
942*3ac0a46fSAndroid Build Coastguard Worker // Gets the export value of |annot| which is an interactive form annotation.
943*3ac0a46fSAndroid Build Coastguard Worker // Intended for use with radio button and checkbox widget annotations.
944*3ac0a46fSAndroid Build Coastguard Worker // |buffer| is only modified if |buflen| is longer than the length of contents.
945*3ac0a46fSAndroid Build Coastguard Worker // In case of error, nothing will be added to |buffer| and the return value
946*3ac0a46fSAndroid Build Coastguard Worker // will be 0. Note that return value of empty string is 2 for "\0\0".
947*3ac0a46fSAndroid Build Coastguard Worker //
948*3ac0a46fSAndroid Build Coastguard Worker //    hHandle     -   handle to the form fill module, returned by
949*3ac0a46fSAndroid Build Coastguard Worker //                    FPDFDOC_InitFormFillEnvironment().
950*3ac0a46fSAndroid Build Coastguard Worker //    annot       -   handle to an interactive form annotation.
951*3ac0a46fSAndroid Build Coastguard Worker //    buffer      -   buffer for holding the value string, encoded in UTF-16LE.
952*3ac0a46fSAndroid Build Coastguard Worker //    buflen      -   length of the buffer in bytes.
953*3ac0a46fSAndroid Build Coastguard Worker //
954*3ac0a46fSAndroid Build Coastguard Worker // Returns the length of the string value in bytes.
955*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT unsigned long FPDF_CALLCONV
956*3ac0a46fSAndroid Build Coastguard Worker FPDFAnnot_GetFormFieldExportValue(FPDF_FORMHANDLE hHandle,
957*3ac0a46fSAndroid Build Coastguard Worker                                   FPDF_ANNOTATION annot,
958*3ac0a46fSAndroid Build Coastguard Worker                                   FPDF_WCHAR* buffer,
959*3ac0a46fSAndroid Build Coastguard Worker                                   unsigned long buflen);
960*3ac0a46fSAndroid Build Coastguard Worker 
961*3ac0a46fSAndroid Build Coastguard Worker // Experimental API.
962*3ac0a46fSAndroid Build Coastguard Worker // Add a URI action to |annot|, overwriting the existing action, if any.
963*3ac0a46fSAndroid Build Coastguard Worker //
964*3ac0a46fSAndroid Build Coastguard Worker //   annot  - handle to a link annotation.
965*3ac0a46fSAndroid Build Coastguard Worker //   uri    - the URI to be set, encoded in 7-bit ASCII.
966*3ac0a46fSAndroid Build Coastguard Worker //
967*3ac0a46fSAndroid Build Coastguard Worker // Returns true if successful.
968*3ac0a46fSAndroid Build Coastguard Worker FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetURI(FPDF_ANNOTATION annot,
969*3ac0a46fSAndroid Build Coastguard Worker                                                      const char* uri);
970*3ac0a46fSAndroid Build Coastguard Worker 
971*3ac0a46fSAndroid Build Coastguard Worker #ifdef __cplusplus
972*3ac0a46fSAndroid Build Coastguard Worker }  // extern "C"
973*3ac0a46fSAndroid Build Coastguard Worker #endif  // __cplusplus
974*3ac0a46fSAndroid Build Coastguard Worker 
975*3ac0a46fSAndroid Build Coastguard Worker #endif  // PUBLIC_FPDF_ANNOT_H_
976