Foxit PDF SDK
fs_bookmark.h
Go to the documentation of this file.
1 
15 #ifndef FS_BOOKMARK_H_
16 #define FS_BOOKMARK_H_
17 
18 #include "common/fs_common.h"
19 #include "pdf/actions/fs_action.h"
21 
27 namespace foxit {
31 namespace pdf {
58 class Bookmark FS_FINAL : public Base{
59  public:
65  typedef enum _Style {
67  e_StyleNormal = 0x00,
69  e_StyleItalic = 0x01,
71  e_StyleBold = 0x02
72  } Style;
73 
80  typedef enum _Position {
93  } Position;
94 
95 
103  Bookmark(const PDFDoc& pdf_doc, objects::PDFDictionary* bookmark_dict);
109  Bookmark(const Bookmark& other);
117  Bookmark& operator = (const Bookmark& other);
118 
126  bool operator == (const Bookmark& other) const;
134  bool operator != (const Bookmark& other) const;
135 
143  bool IsEmpty() const;
144 
146  ~Bookmark();
147 
159 
166  bool HasChild();
167 
174 
186 
202 
216  void SetDestination(const Destination& destination);
217 
227  WString GetTitle() const;
228 
240  void SetTitle(const WString& title);
241 
252  RGB GetColor() const;
253 
266  void SetColor(RGB color);
267 
279  uint32 GetStyle() const;
280 
295  void SetStyle(uint32 style);
296 
312  Bookmark Insert(const WString& title, Position position);
313 
331  bool MoveTo(const Bookmark& dest_bookmark, Position position);
332 
344 
363  void SetAction(const actions::Action& action);
364 
376  bool RemoveAction();
377 
389  bool IsRoot();
390 
397  bool IsFirstChild();
398 
405  bool IsLastChild();
406 
413 
414  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
415  explicit Bookmark(FS_HANDLE handle = NULL);
416 
417 };
418 } // namespace pdf
419 } // namespace foxit
420 #endif // FS_BOOKMARK_H_
421 
objects::PDFDictionary * GetDict() const
Get PDF dictionary of current bookmark.
Show bookmark title as italic text.
Definition: fs_bookmark.h:69
void SetColor(RGB color)
Set the color used for displaying title.
Bookmark GetNextSibling()
Get the next sibling bookmark.
Position
Enumeration for bookmark position.
Definition: fs_bookmark.h:80
bool IsEmpty() const
Check whether current object is empty or not.
uint32 RGB
RGB color type, 24 bits, ((b) | ((g) << 8) | ((r) << 16)))
Definition: fs_basictypes.h:214
A bookmark is the last child of another specified bookmark.
Definition: fs_bookmark.h:84
A bookmark is the previous sibling of another specified bookmark.
Definition: fs_bookmark.h:86
Show bookmark title as bold text.
Definition: fs_bookmark.h:71
WIDE STRING CLASS.
Definition: fx_string.h:1452
A bookmark is the last sibling of another specified bookmark.
Definition: fs_bookmark.h:92
Definition: fs_action.h:65
Definition: fs_pdfdoc.h:352
uint32 GetStyle() const
Get the style.
void SetAction(const actions::Action &action)
Set action.
bool IsRoot()
Check if current bookmark is the root bookmark.
bool operator!=(const Bookmark &other) const
Not equal operator.
RGB GetColor() const
Get the color used for displaying title.
void SetStyle(uint32 style)
Set the style.
WString GetTitle() const
Get the title.
bool IsFirstChild()
Check if current bookmark is the first child of its parent bookmark.
A bookmark is the next sibling of another specified bookmark.
Definition: fs_bookmark.h:88
Bookmark Insert(const WString &title, Position position)
Insert a new bookmark according to the relationship position to current bookmark.
void SetTitle(const WString &title)
Set the title.
bool MoveTo(const Bookmark &dest_bookmark, Position position)
Move current bookmark to be child or sibling of another bookmark.
A bookmark is the first child of another specified bookmark.
Definition: fs_bookmark.h:82
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:198
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
Header file for common definitions and classes.
bool RemoveAction()
Remove action.
Destination GetDestination()
Get the destination.
bool operator==(const Bookmark &other) const
Equal operator.
Header file for PDF object related definitions and classes.
Definition: fs_basictypes.h:393
Show bookmark title as normal text.
Definition: fs_bookmark.h:67
~Bookmark()
Destructor.
Definition: fs_pdfobject.h:763
bool IsLastChild()
Check if current bookmark is the last child of its parent bookmark.
Bookmark GetFirstChild()
Get the first child bookmark.
Foxit namespace.
Definition: fs_compare.h:27
Definition: fs_action.h:418
Bookmark & operator=(const Bookmark &other)
Assign operator.
A bookmark is the first sibling of another specified bookmark.
Definition: fs_bookmark.h:90
void SetDestination(const Destination &destination)
Set the destination.
Style
Enumeration for bookmark style type.
Definition: fs_bookmark.h:65
Bookmark(const PDFDoc &pdf_doc, objects::PDFDictionary *bookmark_dict)
Constructor, with parameters.
#define NULL
The null-pointer value.
Definition: fx_system.h:767
actions::Action GetAction()
Get action.
Header file for destination and action related definitions and classes.
Bookmark GetParent()
Get the parent bookmark.
Definition: fs_bookmark.h:58
bool HasChild()
Check if current bookmark has child bookmark(s).