From 53aafa99985e93c527ea2803400f250025cc7f01 Mon Sep 17 00:00:00 2001 From: Jane Liu Date: Wed, 12 Jul 2017 19:55:02 -0400 Subject: Basic APIs and test for retrieving embedded attachment count and name 1. Added APIs for retrieving embedded attachment count and file name. * Added an embedder test testing them. Bug=pdfium:174 Change-Id: I181b8e0b81495d8a7fd8c3f79dbbc0f907f5e3fd Reviewed-on: https://pdfium-review.googlesource.com/7490 Commit-Queue: Jane Liu Reviewed-by: dsinclair --- public/fpdf_attachment.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 public/fpdf_attachment.h (limited to 'public') diff --git a/public/fpdf_attachment.h b/public/fpdf_attachment.h new file mode 100644 index 0000000000..07fdff5a9e --- /dev/null +++ b/public/fpdf_attachment.h @@ -0,0 +1,44 @@ +// Copyright 2017 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PUBLIC_FPDF_ATTACHMENT_H_ +#define PUBLIC_FPDF_ATTACHMENT_H_ + +// NOLINTNEXTLINE(build/include) +#include "fpdfview.h" + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// Experimental API. +// Get the number of embedded files in |document|. +// +// document - handle to a document. +// +// Returns the number of embedded files in |document|. +DLLEXPORT int STDCALL FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document); + +// Experimental API. +// Get the name of the embedded file at |index| in |document|. |buffer| is +// only modified if |buflen| is longer than the length of the file name. On +// errors, |buffer| is unmodified and the returned length is 0. +// +// document - handle to a document. +// index - the index of the requested embedded file. +// buffer - buffer for holding the file name, encoded in UTF16-LE. +// buflen - length of the buffer. +// +// Returns the length of the file name. +DLLEXPORT unsigned long STDCALL +FPDFDoc_GetAttachmentName(FPDF_DOCUMENT document, + int index, + void* buffer, + unsigned long buflen); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +#endif // PUBLIC_FPDF_ATTACHMENT_H_ -- cgit v1.2.3