Foxit PDF SDK
fs_pdfnametree.h
Go to the documentation of this file.
1 
15 #ifndef FS_PDFNAMETREE_H_
16 #define FS_PDFNAMETREE_H_
17 
18 #include "common/fs_common.h"
20 
26 namespace foxit {
30 namespace pdf {
34 namespace objects {
72 class PDFNameTree FS_FINAL : public Base {
73  public:
79  typedef enum _Type {
81  e_Dests = 1,
87  e_Pages = 4,
90  } Type;
91 
104  PDFNameTree(const PDFDoc& document, Type type);
106  PDFNameTree();
108  ~PDFNameTree();
109 
115  PDFNameTree(const PDFNameTree& other);
123  PDFNameTree& operator = (const PDFNameTree& other);
124 
132  bool operator == (const PDFNameTree& other) const;
140  bool operator != (const PDFNameTree& other) const;
141 
149  bool IsEmpty() const;
150 
157  Type GetType();
158 
167  bool HasName(const WString& name);
168 
174  int GetCount();
175 
184  WString GetName(int index);
185 
195  objects::PDFObject* GetObj(const WString& name);
196 
210  bool SetObj(const WString& name, objects::PDFObject* pdf_object);
211 
222  bool Rename(const WString& old_name, const WString& new_name);
223 
240  bool Add(const WString& name, objects::PDFObject* pdf_object);
241 
251  bool RemoveObj(const WString& name);
252 
258  bool RemoveAllObjs();
259  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
260  explicit PDFNameTree(FS_HANDLE handle);
261 };
262 
263 } // namespace objects
264 } // namespace pdf
265 } // namespace foxit
266 #endif // FS_PDFNAMETREE_H_
267 
bool RemoveObj(const WString &name)
Remove a key name from current name tree, along with its value (as PDF object).
"Dests" name tree.
Definition: fs_pdfnametree.h:81
bool operator==(const PDFNameTree &other) const
Equal operator.
bool operator !=(const PDFNameTree &other) const
Not equal operator.
PDFNameTree & operator=(const PDFNameTree &other)
Assign operator.
"EmbeddedFiles" name tree.
Definition: fs_pdfnametree.h:85
"JavaScript" name tree.
Definition: fs_pdfnametree.h:83
WIDE STRING CLASS.
Definition: fx_string.h:1452
bool SetObj(const WString &name, objects::PDFObject *pdf_object)
Set the value (as PDF object) of a specified key name.
Definition: fs_pdfdoc.h:508
bool Add(const WString &name, objects::PDFObject *pdf_object)
Add a new key name with a PDF object as its value.
Type GetType()
Get the type of current name tree.
"Templates" name tree.
Definition: fs_pdfnametree.h:89
WString GetName(int index)
Get a key name in the name tree, by index.
Type
Enumeration for name tree type.
Definition: fs_pdfnametree.h:79
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:214
Header file for common definitions and classes.
bool IsEmpty() const
Check whether current object is empty or not.
Definition: fs_pdfnametree.h:72
bool Rename(const WString &old_name, const WString &new_name)
Rename an existing key name to a new key name.
Header file for PDF object related definitions and classes.
Definition: fs_basictypes.h:407
bool RemoveAllObjs()
Remove all key names from current name tree, along with theirs value (as PDF object).
bool HasName(const WString &name)
Check if the specified key name exists in current name tree.
Foxit namespace.
Definition: fs_taggedpdf.h:27
"Pages" name tree.
Definition: fs_pdfnametree.h:87
Definition: fs_pdfobject.h:55
int GetCount()
Get the count of elements in current name tree.
objects::PDFObject * GetObj(const WString &name)
Get the value (as PDF object) of a specified key name.