summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorJane Liu <janeliulwq@google.com>2017-07-12 19:55:02 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-13 14:07:05 +0000
commit53aafa99985e93c527ea2803400f250025cc7f01 (patch)
treed7a9597118a377baf9fe296b42d7baa48cca1ee0 /public
parent0b6e9aed1756d19ed812895208be5cae5633325b (diff)
downloadpdfium-53aafa99985e93c527ea2803400f250025cc7f01.tar.xz
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 <janeliulwq@google.com> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'public')
-rw-r--r--public/fpdf_attachment.h44
1 files changed, 44 insertions, 0 deletions
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_