diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-01-10 18:06:55 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-10 18:06:55 +0000 |
commit | a74e75d69594e469906e2a95b5f2394c88acbe7a (patch) | |
tree | 3c77b9358876819d50baa7f43a98e15dd33c2bbf /public/fpdf_annot.h | |
parent | 7d36c3e835bc32898f0064226d79a8f0f89e15ec (diff) | |
download | pdfium-a74e75d69594e469906e2a95b5f2394c88acbe7a.tar.xz |
Add FPDFAnnot_GetAP to public API.
The matching FPDFAnnot_SetAP will be added in a subsequent CL.
Change-Id: If567e02c6c56138d218498879cb4a8ee91dff080
Reviewed-on: https://pdfium-review.googlesource.com/22450
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'public/fpdf_annot.h')
-rw-r--r-- | public/fpdf_annot.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h index 1fbc366872..8841963183 100644 --- a/public/fpdf_annot.h +++ b/public/fpdf_annot.h @@ -58,6 +58,11 @@ extern "C" { #define FPDF_ANNOT_FLAG_LOCKED (1 << 7) #define FPDF_ANNOT_FLAG_TOGGLENOVIEW (1 << 8) +#define FPDF_ANNOT_APPEARANCEMODE_NORMAL 0 +#define FPDF_ANNOT_APPEARANCEMODE_ROLLOVER 1 +#define FPDF_ANNOT_APPEARANCEMODE_DOWN 2 +#define FPDF_ANNOT_APPEARANCEMODE_COUNT 3 + #define FPDF_OBJECT_UNKNOWN 0 #define FPDF_OBJECT_BOOLEAN 1 #define FPDF_OBJECT_NUMBER 2 @@ -396,6 +401,29 @@ FPDFAnnot_GetStringValue(FPDF_ANNOTATION annot, unsigned long buflen); // Experimental API. +// Get the AP (appearance string) from |annot|'s dictionary for a given +// |appearanceMode|. +// |buffer| is only modified if |buflen| is large enough to hold the whole AP +// string. If |buflen| is smaller, the total size of the AP is still returned, +// but nothing is copied. +// If there is no appearance stream for |annot| in |appearanceMode|, an empty +// string is written to |buf| and 2 is returned. +// On other errors, nothing is written to |buffer| and 0 is returned. +// +// annot - handle to an annotation. +// appearanceMode - the appearance mode (normal, rollover or down) for which +// to get the AP. +// buffer - buffer for holding the value string, encoded in UTF16-LE. +// buflen - length of the buffer. +// +// Returns the length of the string value. +FPDF_EXPORT unsigned long FPDF_CALLCONV +FPDFAnnot_GetAP(FPDF_ANNOTATION annot, + FPDF_ANNOT_APPEARANCEMODE appearanceMode, + void* buffer, + unsigned long buflen); + +// Experimental API. // Get the annotation corresponding to |key| in |annot|'s dictionary. Common // keys for linking annotations include "IRT" and "Popup". Must call // FPDFPage_CloseAnnot() when the annotation returned by this function is no |