Foxit PDF SDK

fs_ofdattachment.h
1 #ifndef FS_OFD_ATTACHMENT_H_
2 #define FS_OFD_ATTACHMENT_H_
3
4 #include "common/fs_common.h"
5
11 namespace foxit {
15 namespace ofd {
16 class AttachmentDirectory;
17
19 class AttachmentInfo FS_FINAL : public Object {
20 public:
24 AttachmentInfo() {}
25
35 explicit AttachmentInfo(const String& name, const String& format, const String& usage, const foxit::DateTime& creation_date, const foxit::DateTime& modification_date) :
36 name(name),
37 format(format),
38 usage(usage),
39 creation_date(creation_date),
40 modification_date(modification_date) {}
41
47 AttachmentInfo(const AttachmentInfo& other) {
48 this->name = other.name;
49 this->format = other.format;
50 this->usage = other.usage;
51 this->creation_date = other.creation_date;
52 this->modification_date = other.modification_date;
53 }
54
62 AttachmentInfo& operator = (const AttachmentInfo& other) {
63 this->name = other.name;
64 this->format = other.format;
65 this->usage = other.usage;
66 this->creation_date = other.creation_date;
67 this->modification_date = other.modification_date;
68 return *this;
69 }
70
82 void Set(const String& name, const String& format, const String& usage, const foxit::DateTime& creation_date, const foxit::DateTime& modification_date) {
83 this->name = name;
84 this->format = format;
85 this->usage = usage;
86 this->creation_date = creation_date;
87 this->modification_date = modification_date;
88 }
89
94 String name;
95
100 String format;
101
106 String usage;
107
112 foxit::DateTime creation_date;
113
118 foxit::DateTime modification_date;
119 };
120
122 class Attachment FS_FINAL : public Base {
123 public:
125 ~Attachment();
126
132 Attachment(const Attachment& other);
133
141 Attachment& operator = (const Attachment& other);
142
150 bool operator == (const Attachment& other) const;
151
159 bool operator != (const Attachment& other) const;
160
168 bool IsEmpty() const;
169
177 bool GetFile(const String& file_path);
178
186 bool GetFile(const WString& file_path);
187
195 bool GetFile(foxit::common::file::WriterCallback* file_writer);
196
202 foxit::uint32 GetID();
203
209 String GetModifier();
210
216 String GetDescription();
217
223 AttachmentInfo GetAttachmentInfo();
224
230 bool IsVisible();
231
237 bool IsDeletable();
238
244 bool IsEditable();
245
251 bool IsExportable();
252
261 bool SetFile(const String& file_path, const String& name = String());
262
271 bool SetFile(const WString& file_path, const String& name = String());
272
281 bool SetFile(foxit::common::file::ReaderCallback* file_reader, const String& name = String());
282
290 void SetName(const String& name);
291
299 void SetFormat(const String& format);
300
308 void SetUsage(const String& usage);
309
317 void SetCreationDate(const foxit::DateTime& creation_date);
318
326 void SetModifier(const String& modifier);
327
335 void SetModDate(const foxit::DateTime& modification_date);
336
344 void SetDescription(const String& description);
345
353 void SetAttachmentInfo(const AttachmentInfo& info);
354
362 void EnableVisible(bool visible);
363
371 void EnableDeletable(bool deletable);
372
380 void EnableEditable(bool editable);
381
389 void EnableExportable(bool exportable);
390
391 explicit Attachment(FS_HANDLE handle);
392 };
393
395 class Attachments FS_FINAL : public Base{
396 public:
402 typedef enum _ElectronicBillsType {
404 e_ElectronicUnknown = 0,
406 e_ElectronicRAIIssuer = 1,
408 e_ElectronicRAIReceiver = 2,
410 e_ElectronicInvoiceOrdIssuer = 3,
412 e_ElectronicInvoiceOrdReceiver = 4,
414 e_ElectronicInvoiceSpclIssuer = 5,
416 e_ElectronicInvoiceSpclReceiver = 6,
418 e_ElectronicBkerIssuer = 7,
420 e_ElectronicBkerReceiver = 8,
422 e_ElectronicBkrs = 9,
424 e_ElectronicEinvOrd = 10,
426 e_ElectronicEinvSpcl = 11,
428 e_ElectronicATRIssuer = 12,
430 e_ElectronicATRReceiver = 13,
432 e_ElectronicNTREVIssuer = 14,
434 e_ElectronicNTREVReceiver = 15,
436 e_ElectronicEFI = 16
437 } ElectronicBillsType;
438
439
441 ~Attachments();
442
448 Attachments(const Attachments& other);
449
457 Attachments& operator = (const Attachments& other);
458
466 bool operator == (const Attachments& other) const;
467
475 bool operator != (const Attachments& other) const;
476
484 bool IsEmpty() const;
485
491 int GetAttachmentCount();
492
501 Attachment GetAttachment(int index);
502
510 Attachment GetAttachmentByID(foxit::uint32 id);
511
517 Attachment AddAttachment();
518
527 bool RemoveAttachment(int index);
528
534 bool RemoveAllAttachments();
535
541 int GetElectronicBillsCount();
542
551 ElectronicBillsType GetElectronicBillsType(int index);
552
562 bool ExportElectronicBillsFile(int index, const String& file_path);
563
573 bool ExportElectronicBillsFile(int index, const WString& file_path);
574
580 int GetAttachmentDirectoryExtAttributeCount();
581
590 Attachment GetAttachmentDirectoryExtAttribute(int index);
591
597 String GetAttachmentDirectoryExtInfoFile();
598
606 bool GetAttachmentDirectoryExtInfoFile(const String& file_path);
607
615 bool GetAttachmentDirectoryExtInfoFile(const WString& file_path);
616
624 bool SetAttachmentDirectoryExtInfoFile(const String& file_path);
625
633 bool SetAttachmentDirectoryExtInfoFile(const WString& file_path);
634
640 AttachmentDirectory GetAttachmentDirectory();
641
647 AttachmentDirectory CreateAttachmentDirectory();
648
649 explicit Attachments(FS_HANDLE handle);
650 };
651
652 } // namespace ofd
653 } // namespace foxit
654
655 #endif // FS_OFD_ATTACHMENT_H_
foxit::ofd::Attachment::IsEditable
bool IsEditable()
检查附件是否可编辑。
foxit::ofd::Attachment::SetFormat
void SetFormat(const String &format)
设置格式。
foxit::ofd::Attachment::operator==
bool operator==(const Attachment &other) const
相等操作符。
foxit::ofd::Attachments::ExportElectronicBillsFile
bool ExportElectronicBillsFile(int index, const String &file_path)
导出指定索引的电子凭证文件到指定路径。
foxit::ofd::Attachment::EnableExportable
void EnableExportable(bool exportable)
设置附件可导出性。
foxit::ofd::Attachments::e_ElectronicRAIReceiver
电子凭证类型：铁路电子客票接收方。
Definition: fs_ofdattachment.h:408
IFX_FileWrite
文件写入接口。
Definition: fx_stream.h:470
foxit::ofd::Attachment::SetCreationDate
void SetCreationDate(const foxit::DateTime &creation_date)
设置创建日期。
foxit::ofd::Attachment::EnableVisible
void EnableVisible(bool visible)
设置附件可见性。
foxit::Object
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
foxit::ofd::Attachments::e_ElectronicInvoiceSpclIssuer
电子凭证类型：增值税电子专用发票开具方。
Definition: fs_ofdattachment.h:414
foxit::ofd::Attachment::GetModifier
String GetModifier()
获取修改者名称。
foxit::ofd::Attachment::SetDescription
void SetDescription(const String &description)
设置描述。
foxit::ofd::Attachments::operator==
bool operator==(const Attachments &other) const
相等操作符。
foxit::ofd::Attachments::GetElectronicBillsType
ElectronicBillsType GetElectronicBillsType(int index)
获取指定索引的电子凭证类型。
foxit::ofd::Attachments::e_ElectronicEinvSpcl
电子凭证类型：数电票专用发票。
Definition: fs_ofdattachment.h:426
foxit::ofd::Attachment
Definition: fs_ofdattachment.h:122
foxit::ofd::Attachments::e_ElectronicInvoiceOrdIssuer
电子凭证类型：增值税电子普通发票开具方。
Definition: fs_ofdattachment.h:410
foxit::DateTime
Definition: fs_basictypes.h:498
foxit::ofd::Attachments::RemoveAllAttachments
bool RemoveAllAttachments()
删除所有附件对象。
foxit::ofd::Attachment::IsDeletable
bool IsDeletable()
检查附件是否可删除。
foxit::ofd::Attachment::SetModDate
void SetModDate(const foxit::DateTime &modification_date)
设置修改日期。
foxit::ofd::Attachments::e_ElectronicBkerIssuer
电子凭证类型：银行电子回单开具方。
Definition: fs_ofdattachment.h:418
foxit::ofd::Attachments::e_ElectronicEFI
电子凭证类型：财政电子票据。
Definition: fs_ofdattachment.h:436
IFX_FileRead
文件读取接口。
Definition: fx_stream.h:587
foxit::ofd::Attachments::e_ElectronicATRReceiver
电子凭证类型：电子客票行程单接收方。
Definition: fs_ofdattachment.h:430
foxit::ofd::Attachments::e_ElectronicBkerReceiver
电子凭证类型：银行电子回单接收方。
Definition: fs_ofdattachment.h:420
foxit::ofd::Attachment::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
CFX_WideString
宽字符串类
Definition: fx_string.h:1457
foxit::ofd::Attachments::GetAttachmentCount
int GetAttachmentCount()
获取附件的数量。
foxit::ofd::Attachment::GetAttachmentInfo
AttachmentInfo GetAttachmentInfo()
获取附件信息。
foxit::ofd::Attachments::GetAttachmentDirectoryExtAttribute
Attachment GetAttachmentDirectoryExtAttribute(int index)
获取指定索引的附件目录扩展属性。
foxit::ofd::Attachments::operator !=
bool operator !=(const Attachments &other) const
不相等操作符。
foxit::ofd::Attachment::GetFile
bool GetFile(const String &file_path)
导出文件到指定路径。
foxit::ofd::AttachmentInfo::format
String format
附件格式。
Definition: fs_ofdattachment.h:100
foxit::ofd::Attachments
Definition: fs_ofdattachment.h:395
foxit::ofd::Attachment::SetFile
bool SetFile(const String &file_path, const String &name=String())
通过文件设置附件内容。
foxit::ofd::Attachment::SetName
void SetName(const String &name)
设置名称。
foxit::ofd::Attachment::SetAttachmentInfo
void SetAttachmentInfo(const AttachmentInfo &info)
设置附件信息。
foxit::ofd::Attachments::Attachments
Attachments(const Attachments &other)
构造函数，通过另一个附件集合对象。
foxit::ofd::Attachments::operator=
Attachments & operator=(const Attachments &other)
赋值操作符。
foxit::ofd::Attachment::Attachment
Attachment(const Attachment &other)
构造函数，通过另一个附件对象。
foxit::ofd::Attachments::GetAttachment
Attachment GetAttachment(int index)
获取指定索引的附件对象。
foxit::ofd::Attachments::GetAttachmentDirectoryExtInfoFile
String GetAttachmentDirectoryExtInfoFile()
获取附件目录扩展信息，格式为xml。
foxit::ofd::Attachment::GetID
foxit::uint32 GetID()
获取ID。
foxit::ofd::Attachment::~Attachment
~Attachment()
析构函数。
foxit::ofd::Attachments::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::ofd::Attachments::e_ElectronicInvoiceSpclReceiver
电子凭证类型：增值税电子专用发票接收方。
Definition: fs_ofdattachment.h:416
foxit::ofd::Attachment::GetDescription
String GetDescription()
获取描述。
foxit::ofd::Attachments::AddAttachment
Attachment AddAttachment()
添加一个新的附件对象。
foxit::ofd::Attachments::e_ElectronicUnknown
电子凭证类型：未知。
Definition: fs_ofdattachment.h:404
foxit::ofd::Attachments::SetAttachmentDirectoryExtInfoFile
bool SetAttachmentDirectoryExtInfoFile(const String &file_path)
通过文件设置附件目录扩展信息，格式为xml。
foxit::ofd::Attachments::e_ElectronicNTREVIssuer
电子凭证类型：电子非税收入一般缴款书开具方。
Definition: fs_ofdattachment.h:432
foxit::ofd::Attachments::e_ElectronicBkrs
电子凭证类型：银行电子对账单。
Definition: fs_ofdattachment.h:422
foxit::uint32
FX_UINT32 uint32
无符号 32 位整数。
Definition: fs_basictypes.h:195
foxit::FS_HANDLE
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
foxit::String
CFX_ByteString String
字节字符串。
Definition: fs_basictypes.h:224
foxit::ofd::Attachments::GetAttachmentDirectoryExtAttributeCount
int GetAttachmentDirectoryExtAttributeCount()
获取附件目录扩展属性数量。
fs_common.h
通用定义和类的头文件。
foxit::ofd::AttachmentInfo::name
String name
附件名称。
Definition: fs_ofdattachment.h:94
foxit::ofd::Attachment::operator=
Attachment & operator=(const Attachment &other)
赋值操作符。
foxit::ofd::Attachments::RemoveAttachment
bool RemoveAttachment(int index)
删除指定索引的附件对象。
foxit::ofd::Attachment::SetModifier
void SetModifier(const String &modifier)
设置修改者名称。
foxit::Base
Definition: fs_basictypes.h:465
foxit::ofd::Attachments::e_ElectronicEinvOrd
电子凭证类型：数电票普通发票。
Definition: fs_ofdattachment.h:424
foxit::ofd::AttachmentInfo::AttachmentInfo
AttachmentInfo(const AttachmentInfo &other)
构造函数，通过另一个附件信息对象。
Definition: fs_ofdattachment.h:47
foxit::ofd::Attachments::e_ElectronicATRIssuer
电子凭证类型：电子客票行程单开具方。
Definition: fs_ofdattachment.h:428
foxit::ofd::AttachmentDirectory
Definition: fs_ofdattachmentdirectory.h:20
foxit::ofd::Attachments::GetAttachmentDirectory
AttachmentDirectory GetAttachmentDirectory()
获取附件目录对象。
foxit::ofd::AttachmentInfo::creation_date
foxit::DateTime creation_date
附件创建日期。
Definition: fs_ofdattachment.h:112
foxit::ofd::Attachment::EnableEditable
void EnableEditable(bool editable)
设置附件可编辑性。
foxit
Foxit命名空间。
Definition: fs_taggedpdf.h:27
foxit::ofd::Attachments::e_ElectronicRAIIssuer
电子凭证类型：铁路电子客票开具方。
Definition: fs_ofdattachment.h:406
foxit::ofd::Attachment::IsVisible
bool IsVisible()
检查附件是否可见。
foxit::ofd::Attachment::SetUsage
void SetUsage(const String &usage)
设置用途。
CFX_ByteString
字节字符串类
Definition: fx_string.h:317
foxit::ofd::Attachments::GetAttachmentByID
Attachment GetAttachmentByID(foxit::uint32 id)
通过ID获取附件对象。
foxit::ofd::Attachment::operator !=
bool operator !=(const Attachment &other) const
不相等操作符。
foxit::ofd::AttachmentInfo::AttachmentInfo
AttachmentInfo(const String &name, const String &format, const String &usage, const foxit::DateTime &creation_date, const foxit::DateTime &modification_date)
带参数的构造函数。
Definition: fs_ofdattachment.h:35
foxit::ofd::Attachments::CreateAttachmentDirectory
AttachmentDirectory CreateAttachmentDirectory()
创建附件目录对象。
foxit::ofd::AttachmentInfo::modification_date
foxit::DateTime modification_date
附件修改日期。
Definition: fs_ofdattachment.h:118
foxit::ofd::Attachment::EnableDeletable
void EnableDeletable(bool deletable)
设置附件可删除性。
foxit::ofd::AttachmentInfo::AttachmentInfo
AttachmentInfo()
构造函数。
Definition: fs_ofdattachment.h:24
foxit::ofd::Attachment::IsExportable
bool IsExportable()
检查附件是否可导出。
foxit::ofd::Attachments::e_ElectronicInvoiceOrdReceiver
电子凭证类型：增值税电子普通发票接收方 。
Definition: fs_ofdattachment.h:412
foxit::ofd::Attachments::ElectronicBillsType
ElectronicBillsType
OFD电子凭证定义枚举类型。
Definition: fs_ofdattachment.h:402
foxit::ofd::Attachments::e_ElectronicNTREVReceiver
电子凭证类型：电子非税收入一般缴款书接收方。
Definition: fs_ofdattachment.h:434
foxit::ofd::Attachments::GetElectronicBillsCount
int GetElectronicBillsCount()
获取电子凭证的数量。
foxit::ofd::AttachmentInfo
Definition: fs_ofdattachment.h:19
foxit::ofd::AttachmentInfo::Set
void Set(const String &name, const String &format, const String &usage, const foxit::DateTime &creation_date, const foxit::DateTime &modification_date)
设置值。
Definition: fs_ofdattachment.h:82
foxit::ofd::Attachments::~Attachments
~Attachments()
析构函数。
foxit::ofd::AttachmentInfo::usage
String usage
附件用途。
Definition: fs_ofdattachment.h:106
foxit::ofd::AttachmentInfo::operator=
AttachmentInfo & operator=(const AttachmentInfo &other)
赋值操作符。
Definition: fs_ofdattachment.h:62