Added APIs for setting annotation flag values
1. Added APIs for getting/setting/unsetting annotation flag values in
annotation dictionaries.
* Added an embedder test testing all the new functions.
Bug=pdfium:737
Change-Id: Ib6bbcf05d6e93c43ec4dcd7120db71bc244afdbf
Reviewed-on: https://pdfium-review.googlesource.com/7154
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h
index 89edd01..971662f 100644
--- a/public/fpdf_annot.h
+++ b/public/fpdf_annot.h
@@ -45,6 +45,18 @@
#define FPDF_ANNOT_RICHMEDIA 26
#define FPDF_ANNOT_XFAWIDGET 27
+// Refer to PDF Reference (6th edition) table 8.16 for all annotation flags.
+#define FPDF_ANNOT_FLAG_NONE 0
+#define FPDF_ANNOT_FLAG_INVISIBLE (1 << 0)
+#define FPDF_ANNOT_FLAG_HIDDEN (1 << 1)
+#define FPDF_ANNOT_FLAG_PRINT (1 << 2)
+#define FPDF_ANNOT_FLAG_NOZOOM (1 << 3)
+#define FPDF_ANNOT_FLAG_NOROTATE (1 << 4)
+#define FPDF_ANNOT_FLAG_NOVIEW (1 << 5)
+#define FPDF_ANNOT_FLAG_READONLY (1 << 6)
+#define FPDF_ANNOT_FLAG_LOCKED (1 << 7)
+#define FPDF_ANNOT_FLAG_TOGGLENOVIEW (1 << 8)
+
typedef enum FPDFANNOT_COLORTYPE {
FPDFANNOT_COLORTYPE_Color = 0,
FPDFANNOT_COLORTYPE_InteriorColor
@@ -275,6 +287,24 @@
void* buffer,
unsigned long buflen);
+// Experimental API.
+// Get the annotation flags of |annot|.
+//
+// annot - handle to an annotation.
+//
+// Returns the annotation flags.
+DLLEXPORT int STDCALL FPDFAnnot_GetFlags(FPDF_ANNOTATION annot);
+
+// Experimental API.
+// Set the |annot|'s flags to be of the value |flags|.
+//
+// annot - handle to an annotation.
+// flags - the flag values to be set.
+//
+// Returns true if successful.
+DLLEXPORT FPDF_BOOL STDCALL FPDFAnnot_SetFlags(FPDF_ANNOTATION annot,
+ int flags);
+
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus