diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-07-05 18:04:19 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-05 18:04:19 +0000 |
commit | 7007fd56221cb2c19444051ad34afb758c89706b (patch) | |
tree | 1fab21c7a5df5e78a55598245a94bde9913fdedd /public/fpdf_edit.h | |
parent | 6f0d8ea78adbb7f5d93e2470a6888b5417a01bca (diff) | |
download | pdfium-7007fd56221cb2c19444051ad34afb758c89706b.tar.xz |
Create content mark APIs to get values by key.
Bug: pdfium:1037
Change-Id: Ie887c0bbf3e543676adec6d8411b0b3254677d3c
Reviewed-on: https://pdfium-review.googlesource.com/37170
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'public/fpdf_edit.h')
-rw-r--r-- | public/fpdf_edit.h | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h index 6490c18c6a..380a0a236e 100644 --- a/public/fpdf_edit.h +++ b/public/fpdf_edit.h @@ -368,7 +368,18 @@ FPDFPageObjMark_GetParamValueType(FPDF_PAGEOBJECTMARK mark, unsigned long index); // Experimental API. -// Get the value of an int property in a content mark. +// Get the type of the value of a property in a content mark by key. +// +// mark - handle to a content mark. +// key - string key of the property. +// +// Returns the type of the value, or FPDF_OBJECT_UNKNOWN in case of failure. +FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV +FPDFPageObjMark_GetParamValueTypeByKey(FPDF_PAGEOBJECTMARK mark, + FPDF_BYTESTRING key); + +// Experimental API. +// Get the value of a number property in a content mark as int. // FPDFPageObjMark_GetParamValueType() should have returned FPDF_OBJECT_NUMBER // for this property. // @@ -380,12 +391,28 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPageObjMark_GetParamIntValue(FPDF_PAGEOBJECTMARK mark, unsigned long index); // Experimental API. +// Get the value of a number property in a content mark by key as int. +// FPDFPageObjMark_GetParamValueType() should have returned FPDF_OBJECT_NUMBER +// for this property. +// +// mark - handle to a content mark. +// key - string key of the property. +// out_value - pointer to variable that will receive the value. Not filled if +// false is returned. +// +// Returns TRUE if the key maps to a number value, FALSE otherwise. +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPageObjMark_GetParamIntValueByKey(FPDF_PAGEOBJECTMARK mark, + FPDF_BYTESTRING key, + int* out_value); + +// Experimental API. // Get the value of a string property in a content mark. -// |buffer| is only modified if |buflen| is longer than the length of the key. +// |buffer| is only modified if |buflen| is longer than the length of the value. // // mark - handle to a content mark. // index - index of the property. -// buffer - buffer for holding the returned key in UTF16-LE. +// buffer - buffer for holding the returned value in UTF16-LE. // buflen - length of the buffer. // // Returns the length of the value. @@ -395,6 +422,25 @@ FPDFPageObjMark_GetParamStringValue(FPDF_PAGEOBJECTMARK mark, void* buffer, unsigned long buflen); +// Experimental API. +// Get the value of a string property in a content mark by key. +// |buffer| is only modified if |buflen| is longer than the length of the value. +// +// mark - handle to a content mark. +// key - string key of the property. +// buffer - buffer for holding the returned value in UTF16-LE. +// buflen - length of the buffer. +// out_buflen - pointer to variable that will receive the length of the value. +// Not filled if false is returned. +// +// Returns TRUE if the key maps to a string value, FALSE otherwise. +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +FPDFPageObjMark_GetParamStringValueByKey(FPDF_PAGEOBJECTMARK mark, + FPDF_BYTESTRING key, + void* buffer, + unsigned long buflen, + unsigned long* out_buflen); + // Load an image from a JPEG image file and then set it into |image_object|. // // pages - pointer to the start of all loaded pages, may be NULL. |