blob: 07fdff5a9ed683096cd391862f3bc4e7d01961f6 [file] [log] [blame]
Jane Liu53aafa92017-07-12 19:55:02 -04001// Copyright 2017 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef PUBLIC_FPDF_ATTACHMENT_H_
6#define PUBLIC_FPDF_ATTACHMENT_H_
7
8// NOLINTNEXTLINE(build/include)
9#include "fpdfview.h"
10
11#ifdef __cplusplus
12extern "C" {
13#endif // __cplusplus
14
15// Experimental API.
16// Get the number of embedded files in |document|.
17//
18// document - handle to a document.
19//
20// Returns the number of embedded files in |document|.
21DLLEXPORT int STDCALL FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document);
22
23// Experimental API.
24// Get the name of the embedded file at |index| in |document|. |buffer| is
25// only modified if |buflen| is longer than the length of the file name. On
26// errors, |buffer| is unmodified and the returned length is 0.
27//
28// document - handle to a document.
29// index - the index of the requested embedded file.
30// buffer - buffer for holding the file name, encoded in UTF16-LE.
31// buflen - length of the buffer.
32//
33// Returns the length of the file name.
34DLLEXPORT unsigned long STDCALL
35FPDFDoc_GetAttachmentName(FPDF_DOCUMENT document,
36 int index,
37 void* buffer,
38 unsigned long buflen);
39
40#ifdef __cplusplus
41} // extern "C"
42#endif // __cplusplus
43
44#endif // PUBLIC_FPDF_ATTACHMENT_H_