Loading...
Searching...
No Matches
FileAttachment.h
Go to the documentation of this file.
1//---------------------------------------------------------------------------------------
2// Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3// Consult legal.txt regarding legal and license information.
4//---------------------------------------------------------------------------------------
5#ifndef PDFTRON_H_CPPPDFAnnotsFileAttachment
6#define PDFTRON_H_CPPPDFAnnotsFileAttachment
7
8#include <PDF/Annots/Markup.h>
9
10namespace pdftron {
11 namespace PDF {
12 namespace Annots {
17class FileAttachment : public Markup
18{
19 public:
31
40
47 FileAttachment(const Annot& ann) : Markup(ann.GetSDFObj()) {}
48
71 static FileAttachment Create(SDF::SDFDoc& doc, const Rect& pos, FileSpec fs, Icon icon_name = e_PushPin );
72 static FileAttachment CreateAnnot(SDF::SDFDoc& doc, const Rect& pos, FileSpec fs, Icon icon_name = e_PushPin);
73
96 static FileAttachment Create(SDF::SDFDoc& doc, const Rect& pos, const UString& path, Icon icon_name = e_PushPin );
97 static FileAttachment CreateAnnot(SDF::SDFDoc& doc, const Rect& pos, const UString& path, Icon icon_name = e_PushPin);
98
116 static FileAttachment Create(SDF::SDFDoc& doc, const Rect& pos, const UString& path, const char* icon_name );
117
122
129 void SetFileSpec(const FileSpec& file);
130
147 bool Export(const UString& save_as = "") const;
148
149
150
157 Icon GetIcon() const;
158
169
180 const char* GetIconName() const;
181
192 void SetIconName(const char* iname);
193
194 // @cond PRIVATE_DOC
195 #ifndef SWIGHIDDEN
196 FileAttachment(TRN_Annot fileattachment);
197 #endif
198 // @endcond
199
200}; //class file attachment
201 }; //namespace Annot
202 }; //namespace PDF
203}; //namespace pdftron
204
205#include <Impl/Page.inl>
206
207#endif // PDFTRON_H_CPPPDFAnnotsFileAttachment
Annot(SDF::Obj d=0)
SDF::Obj GetSDFObj() const
void SetIcon(Icon type=e_PushPin)
void SetIconName(const char *iname)
static FileAttachment CreateAnnot(SDF::SDFDoc &doc, const Rect &pos, FileSpec fs, Icon icon_name=e_PushPin)
static FileAttachment Create(SDF::SDFDoc &doc, const Rect &pos, const UString &path, Icon icon_name=e_PushPin)
static FileAttachment Create(SDF::SDFDoc &doc, const Rect &pos, const UString &path, const char *icon_name)
static FileAttachment CreateAnnot(SDF::SDFDoc &doc, const Rect &pos, const UString &path, Icon icon_name=e_PushPin)
void SetFileSpec(const FileSpec &file)
@ e_Paperclip
The icon has a paper clip appearance.
@ e_Graph
The icon has graph appearance.
@ e_PushPin
The icon has a push pin appearance.
@ e_Tag
The icon has tag appearance.
@ e_Unknown
The icon has unrecognized appearance type.
bool Export(const UString &save_as="") const
static FileAttachment Create(SDF::SDFDoc &doc, const Rect &pos, FileSpec fs, Icon icon_name=e_PushPin)