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"
20 #include "pdf/objects/fs_pdfobject.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 {
82 e_PosFirstChild = 0,
84 e_PosLastChild = 1,
86 e_PosPrevSibling = 2,
88 e_PosNextSibling = 3,
90 e_PosFirstSibling = 4,
92 e_PosLastSibling = 5
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
158 Bookmark GetParent();
159
166 bool HasChild();
167
173 Bookmark GetFirstChild();
174
185 Bookmark GetNextSibling();
186
201 Destination GetDestination();
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
343 actions::Action GetAction();
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
412 objects::PDFDictionary* GetDict() const;
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
foxit::pdf::Bookmark::GetDict
objects::PDFDictionary * GetDict() const
Get PDF dictionary of current bookmark.
foxit::pdf::Bookmark::e_StyleItalic
Show bookmark title as italic text.
Definition: fs_bookmark.h:69
foxit::pdf::Bookmark::SetColor
void SetColor(RGB color)
Set the color used for displaying title.
foxit::pdf::Bookmark::GetNextSibling
Bookmark GetNextSibling()
Get the next sibling bookmark.
foxit::pdf::Bookmark::Position
Position
Enumeration for bookmark position.
Definition: fs_bookmark.h:80
foxit::pdf::Bookmark::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::RGB
uint32 RGB
RGB color type, 24 bits, ((b) | ((g) << 8) | ((r) << 16)))
Definition: fs_basictypes.h:211
foxit::pdf::Bookmark::e_PosLastChild
A bookmark is the last child of another specified bookmark.
Definition: fs_bookmark.h:84
foxit::pdf::Bookmark::e_PosPrevSibling
A bookmark is the previous sibling of another specified bookmark.
Definition: fs_bookmark.h:86
foxit::pdf::Bookmark::e_StyleBold
Show bookmark title as bold text.
Definition: fs_bookmark.h:71
CFX_WideString
WIDE STRING CLASS.
Definition: fx_string.h:1461
foxit::pdf::Bookmark::e_PosLastSibling
A bookmark is the last sibling of another specified bookmark.
Definition: fs_bookmark.h:92
foxit::pdf::Destination
Definition: fs_action.h:65
foxit::pdf::PDFDoc
Definition: fs_pdfdoc.h:776
foxit::pdf::Bookmark::GetStyle
uint32 GetStyle() const
Get the style.
foxit::pdf::Bookmark::SetAction
void SetAction(const actions::Action &action)
Set action.
foxit::pdf::Bookmark::IsRoot
bool IsRoot()
Check if current bookmark is the root bookmark.
foxit::pdf::Bookmark::GetColor
RGB GetColor() const
Get the color used for displaying title.
foxit::pdf::Bookmark::SetStyle
void SetStyle(uint32 style)
Set the style.
foxit::pdf::Bookmark::operator !=
bool operator !=(const Bookmark &other) const
Not equal operator.
foxit::pdf::Bookmark::GetTitle
WString GetTitle() const
Get the title.
foxit::pdf::Bookmark::IsFirstChild
bool IsFirstChild()
Check if current bookmark is the first child of its parent bookmark.
foxit::pdf::Bookmark::e_PosNextSibling
A bookmark is the next sibling of another specified bookmark.
Definition: fs_bookmark.h:88
foxit::pdf::Bookmark::Insert
Bookmark Insert(const WString &title, Position position)
Insert a new bookmark according to the relationship position to current bookmark.
foxit::pdf::Bookmark::SetTitle
void SetTitle(const WString &title)
Set the title.
foxit::pdf::Bookmark::MoveTo
bool MoveTo(const Bookmark &dest_bookmark, Position position)
Move current bookmark to be child or sibling of another bookmark.
foxit::pdf::Bookmark::e_PosFirstChild
A bookmark is the first child of another specified bookmark.
Definition: fs_bookmark.h:82
foxit::uint32
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:195
foxit::FS_HANDLE
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
fs_common.h
Header file for common definitions and classes.
foxit::pdf::Bookmark::RemoveAction
bool RemoveAction()
Remove action.
foxit::pdf::Bookmark::GetDestination
Destination GetDestination()
Get the destination.
foxit::pdf::Bookmark::operator==
bool operator==(const Bookmark &other) const
Equal operator.
fs_pdfobject.h
Header file for PDF object related definitions and classes.
foxit::Base
Definition: fs_basictypes.h:451
foxit::pdf::Bookmark::e_StyleNormal
Show bookmark title as normal text.
Definition: fs_bookmark.h:67
foxit::pdf::Bookmark::~Bookmark
~Bookmark()
Destructor.
foxit::pdf::objects::PDFDictionary
Definition: fs_pdfobject.h:850
foxit::pdf::Bookmark::IsLastChild
bool IsLastChild()
Check if current bookmark is the last child of its parent bookmark.
foxit::pdf::Bookmark::GetFirstChild
Bookmark GetFirstChild()
Get the first child bookmark.
foxit
Foxit namespace.
Definition: fs_pdf3d.h:26
foxit::pdf::actions::Action
Definition: fs_action.h:418
foxit::pdf::Bookmark::operator=
Bookmark & operator=(const Bookmark &other)
Assign operator.
foxit::pdf::Bookmark::e_PosFirstSibling
A bookmark is the first sibling of another specified bookmark.
Definition: fs_bookmark.h:90
foxit::pdf::Bookmark::SetDestination
void SetDestination(const Destination &destination)
Set the destination.
foxit::pdf::Bookmark::Style
Style
Enumeration for bookmark style type.
Definition: fs_bookmark.h:65
foxit::pdf::Bookmark::Bookmark
Bookmark(const PDFDoc &pdf_doc, objects::PDFDictionary *bookmark_dict)
Constructor, with parameters.
NULL
#define NULL
The null-pointer value.
Definition: fx_system.h:792
foxit::pdf::Bookmark::GetAction
actions::Action GetAction()
Get action.
fs_action.h
Header file for destination and action related definitions and classes.
foxit::pdf::Bookmark::GetParent
Bookmark GetParent()
Get the parent bookmark.
foxit::pdf::Bookmark
Definition: fs_bookmark.h:58
foxit::pdf::Bookmark::HasChild
bool HasChild()
Check if current bookmark has child bookmark(s).