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:
25 
36  name(name),
37  format(format),
38  usage(usage),
41 
48  this->name = other.name;
49  this->format = other.format;
50  this->usage = other.usage;
51  this->creation_date = other.creation_date;
53  }
54 
63  this->name = other.name;
64  this->format = other.format;
65  this->usage = other.usage;
66  this->creation_date = other.creation_date;
68  return *this;
69  }
70 
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 
95 
101 
107 
113 
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 
203 
210 
217 
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 {
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 
511 
518 
527  bool RemoveAttachment(int index);
528 
534  bool RemoveAllAttachments();
535 
542 
552 
562  bool ExportElectronicBillsFile(int index, const String& file_path);
563 
573  bool ExportElectronicBillsFile(int index, const WString& file_path);
574 
581 
591 
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 
641 
648 
649  explicit Attachments(FS_HANDLE handle);
650 };
651 
652 } // namespace ofd
653 } // namespace foxit
654 
655 #endif // FS_OFD_ATTACHMENT_H_
bool IsEditable()
检查附件是否可编辑。
void SetFormat(const String &format)
设置格式。
bool operator==(const Attachment &other) const
相等操作符。
bool ExportElectronicBillsFile(int index, const String &file_path)
导出指定索引的电子凭证文件到指定路径。
void EnableExportable(bool exportable)
设置附件可导出性。
电子凭证类型:铁路电子客票接收方。
Definition: fs_ofdattachment.h:408
文件写入接口。
Definition: fx_stream.h:470
void SetCreationDate(const foxit::DateTime &creation_date)
设置创建日期。
void EnableVisible(bool visible)
设置附件可见性。
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
电子凭证类型:增值税电子专用发票开具方。
Definition: fs_ofdattachment.h:414
String GetModifier()
获取修改者名称。
void SetDescription(const String &description)
设置描述。
bool operator==(const Attachments &other) const
相等操作符。
ElectronicBillsType GetElectronicBillsType(int index)
获取指定索引的电子凭证类型。
电子凭证类型:数电票专用发票。
Definition: fs_ofdattachment.h:426
Definition: fs_ofdattachment.h:122
电子凭证类型:增值税电子普通发票开具方。
Definition: fs_ofdattachment.h:410
Definition: fs_basictypes.h:498
bool RemoveAllAttachments()
删除所有附件对象。
bool IsDeletable()
检查附件是否可删除。
void SetModDate(const foxit::DateTime &modification_date)
设置修改日期。
电子凭证类型:银行电子回单开具方。
Definition: fs_ofdattachment.h:418
电子凭证类型:财政电子票据。
Definition: fs_ofdattachment.h:436
文件读取接口。
Definition: fx_stream.h:587
电子凭证类型:电子客票行程单接收方。
Definition: fs_ofdattachment.h:430
电子凭证类型:银行电子回单接收方。
Definition: fs_ofdattachment.h:420
bool IsEmpty() const
检查当前对象是否为空。
宽字符串类
Definition: fx_string.h:1457
int GetAttachmentCount()
获取附件的数量。
AttachmentInfo GetAttachmentInfo()
获取附件信息。
Attachment GetAttachmentDirectoryExtAttribute(int index)
获取指定索引的附件目录扩展属性。
bool operator !=(const Attachments &other) const
不相等操作符。
bool GetFile(const String &file_path)
导出文件到指定路径。
String format
附件格式。
Definition: fs_ofdattachment.h:100
Definition: fs_ofdattachment.h:395
bool SetFile(const String &file_path, const String &name=String())
通过文件设置附件内容。
void SetName(const String &name)
设置名称。
void SetAttachmentInfo(const AttachmentInfo &info)
设置附件信息。
Attachments(const Attachments &other)
构造函数,通过另一个附件集合对象。
Attachments & operator=(const Attachments &other)
赋值操作符。
Attachment(const Attachment &other)
构造函数,通过另一个附件对象。
Attachment GetAttachment(int index)
获取指定索引的附件对象。
String GetAttachmentDirectoryExtInfoFile()
获取附件目录扩展信息,格式为xml。
foxit::uint32 GetID()
获取ID。
~Attachment()
析构函数。
bool IsEmpty() const
检查当前对象是否为空。
电子凭证类型:增值税电子专用发票接收方。
Definition: fs_ofdattachment.h:416
String GetDescription()
获取描述。
Attachment AddAttachment()
添加一个新的附件对象。
电子凭证类型:未知。
Definition: fs_ofdattachment.h:404
bool SetAttachmentDirectoryExtInfoFile(const String &file_path)
通过文件设置附件目录扩展信息,格式为xml。
电子凭证类型:电子非税收入一般缴款书开具方。
Definition: fs_ofdattachment.h:432
电子凭证类型:银行电子对账单。
Definition: fs_ofdattachment.h:422
FX_UINT32 uint32
无符号 32 位整数。
Definition: fs_basictypes.h:195
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
CFX_ByteString String
字节字符串。
Definition: fs_basictypes.h:224
int GetAttachmentDirectoryExtAttributeCount()
获取附件目录扩展属性数量。
通用定义和类的头文件。
String name
附件名称。
Definition: fs_ofdattachment.h:94
Attachment & operator=(const Attachment &other)
赋值操作符。
bool RemoveAttachment(int index)
删除指定索引的附件对象。
void SetModifier(const String &modifier)
设置修改者名称。
Definition: fs_basictypes.h:465
电子凭证类型:数电票普通发票。
Definition: fs_ofdattachment.h:424
AttachmentInfo(const AttachmentInfo &other)
构造函数,通过另一个附件信息对象。
Definition: fs_ofdattachment.h:47
电子凭证类型:电子客票行程单开具方。
Definition: fs_ofdattachment.h:428
Definition: fs_ofdattachmentdirectory.h:20
AttachmentDirectory GetAttachmentDirectory()
获取附件目录对象。
foxit::DateTime creation_date
附件创建日期。
Definition: fs_ofdattachment.h:112
void EnableEditable(bool editable)
设置附件可编辑性。
Foxit命名空间。
Definition: fs_taggedpdf.h:27
电子凭证类型:铁路电子客票开具方。
Definition: fs_ofdattachment.h:406
bool IsVisible()
检查附件是否可见。
void SetUsage(const String &usage)
设置用途。
字节字符串类
Definition: fx_string.h:317
Attachment GetAttachmentByID(foxit::uint32 id)
通过ID获取附件对象。
bool operator !=(const Attachment &other) const
不相等操作符。
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
AttachmentDirectory CreateAttachmentDirectory()
创建附件目录对象。
foxit::DateTime modification_date
附件修改日期。
Definition: fs_ofdattachment.h:118
void EnableDeletable(bool deletable)
设置附件可删除性。
AttachmentInfo()
构造函数。
Definition: fs_ofdattachment.h:24
bool IsExportable()
检查附件是否可导出。
电子凭证类型:增值税电子普通发票接收方 。
Definition: fs_ofdattachment.h:412
ElectronicBillsType
OFD电子凭证定义枚举类型。
Definition: fs_ofdattachment.h:402
电子凭证类型:电子非税收入一般缴款书接收方。
Definition: fs_ofdattachment.h:434
int GetElectronicBillsCount()
获取电子凭证的数量。
Definition: fs_ofdattachment.h:19
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
~Attachments()
析构函数。
String usage
附件用途。
Definition: fs_ofdattachment.h:106
AttachmentInfo & operator=(const AttachmentInfo &other)
赋值操作符。
Definition: fs_ofdattachment.h:62