Foxit PDF SDK

fs_pdfattachments.h
Go to the documentation of this file.
1
15 #ifndef FS_PDFATTACHMENTS_H_
16 #define FS_PDFATTACHMENTS_H_
17
18 #include "common/fs_common.h"
19 #include "pdf/fs_filespec.h"
20 #include "pdf/objects/fs_pdfnametree.h"
21
27 namespace foxit {
31 namespace pdf {
40 class Attachments FS_FINAL : public Base {
41 public:
64 explicit Attachments(const PDFDoc& doc, const objects::PDFNameTree& nametree = foxit::pdf::objects::PDFNameTree());
66 ~Attachments();
72 Attachments(const Attachments& other);
80 Attachments& operator = (const Attachments& other);
81
89 bool operator == (const Attachments& other) const;
97 bool operator != (const Attachments& other) const;
98
106 bool IsEmpty() const;
107
113 int GetCount();
114
123 WString GetKey(int index);
124
132 FileSpec GetEmbeddedFile(const WString& key);
133
144 bool SetEmbeddedFile(const WString& key, const FileSpec& file_spec);
145
161 bool AddEmbeddedFile(const WString& key, const FileSpec& file_spec);
162
178 bool AddFromFilePath(const WString& key, const wchar_t* file_path);
179
190 bool RemoveEmbeddedFile(const WString& key);
191
197 bool RemoveAllEmbeddedFiles();
198
208 bool ExtractEmbeddedFileTo(const WString& key, const wchar_t* dst_file_path);
209
215 objects::PDFNameTree GetNameTree() const;
216
217 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
218 explicit Attachments(FS_HANDLE handle = NULL);
219 };
220 } // namespace pdf
221 } // namespace foxit
222
223 #endif // FS_PDFATTACHMENTS_H_
224
foxit::pdf::Attachments::operator==
bool operator==(const Attachments &other) const
Equal operator.
foxit::FS_HANDLE
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
foxit::pdf::FileSpec
Definition: fs_filespec.h:38
foxit::pdf::Attachments::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::pdf::Attachments::GetKey
WString GetKey(int index)
Get the key of an attachment defined in the EmbeddedFiles name tree, by index.
foxit::pdf::Attachments::~Attachments
~Attachments()
Destructor.
fs_common.h
Header file for common definitions and classes.
foxit::pdf::Attachments::GetEmbeddedFile
FileSpec GetEmbeddedFile(const WString &key)
Get the attachment (as file specification object) of a specified key.
foxit::pdf::Attachments::RemoveAllEmbeddedFiles
bool RemoveAllEmbeddedFiles()
Remove all attachments.
fs_pdfnametree.h
Header file for PDF name tree related definitions and classes.
foxit::pdf::Attachments::operator!=
bool operator!=(const Attachments &other) const
Not equal operator.
foxit::pdf::Attachments::operator=
Attachments & operator=(const Attachments &other)
Assign operator.
foxit::pdf::Attachments::GetNameTree
objects::PDFNameTree GetNameTree() const
Get the EmbeddedFiles name tree.
foxit
Foxit namespace.
Definition: fs_taggedpdf.h:27
fs_filespec.h
Header file for file specification related definitions and classes.
NULL
#define NULL
The null-pointer value.
Definition: fx_system.h:792
foxit::pdf::PDFDoc
Definition: fs_pdfdoc.h:776
foxit::pdf::Attachments::GetCount
int GetCount()
Get the count of attachments.
foxit::pdf::Attachments::AddEmbeddedFile
bool AddEmbeddedFile(const WString &key, const FileSpec &file_spec)
Add an embedded attachment (as file specification object) with new key name.
foxit::pdf::Attachments::Attachments
Attachments(const PDFDoc &doc, const objects::PDFNameTree &nametree=foxit::pdf::objects::PDFNameTree())
Constructor, with parameters. from a PDF document object and an EmbeddedFiles name tree (if any).
CFX_WideString
WIDE STRING CLASS.
Definition: fx_string.h:1461
foxit::pdf::Attachments::RemoveEmbeddedFile
bool RemoveEmbeddedFile(const WString &key)
Remove an attachment by key.
foxit::pdf::Attachments::ExtractEmbeddedFileTo
bool ExtractEmbeddedFileTo(const WString &key, const wchar_t *dst_file_path)
Extract an attachment and save it to a specified file path.
foxit::Base
Definition: fs_basictypes.h:451
foxit::pdf::objects::PDFNameTree
Definition: fs_pdfnametree.h:72
foxit::pdf::Attachments::AddFromFilePath
bool AddFromFilePath(const WString &key, const wchar_t *file_path)
Add a new attachment from specified file path with new key name.
foxit::pdf::Attachments::SetEmbeddedFile
bool SetEmbeddedFile(const WString &key, const FileSpec &file_spec)
Set an embedded attachment (as file specification object) for a specified key.
foxit::pdf::Attachments
Definition: fs_pdfattachments.h:40