PoDoFo  0.9.20
Public Member Functions | Protected Member Functions | List of all members
PoDoFo::PdfOutlineItem Class Reference

#include <PdfOutlines.h>

Inheritance diagram for PoDoFo::PdfOutlineItem:
PoDoFo::PdfOutlines

Public Member Functions

PdfOutlineItemCreateChild (const PdfString &title, const std::shared_ptr< PdfDestination > &dest)
 
PdfOutlineItemCreateNext (const PdfString &title, const std::shared_ptr< PdfDestination > &dest)
 
PdfOutlineItemCreateNext (const PdfString &title, const std::shared_ptr< PdfAction > &action)
 
void InsertChild (PdfOutlineItem *item)
 
PdfOutlineItemPrev () const
 
PdfOutlineItemNext () const
 
PdfOutlineItemFirst () const
 
PdfOutlineItemLast () const
 
PdfOutlineItemGetParentOutline () const
 
void Erase ()
 
void SetDestination (const std::shared_ptr< PdfDestination > &dest)
 
std::shared_ptr< PdfDestinationGetDestination () const
 
void SetAction (const std::shared_ptr< PdfAction > &action)
 
std::shared_ptr< PdfActionGetAction () const
 
void SetTitle (const PdfString &title)
 
const PdfStringGetTitle () const
 
void SetTextFormat (PdfOutlineFormat format)
 
PdfOutlineFormat GetTextFormat () const
 
void SetTextColor (double r, double g, double b)
 
double GetTextColorRed () const
 
double GetTextColorBlue () const
 
double GetTextColorGreen () const
 

Protected Member Functions

 PdfOutlineItem (PdfDocument &doc)
 
 PdfOutlineItem (PdfDocument &doc, const PdfString &title, const std::shared_ptr< PdfDestination > &dest, PdfOutlineItem *parentOutline)
 
 PdfOutlineItem (PdfDocument &doc, const PdfString &title, const std::shared_ptr< PdfAction > &action, PdfOutlineItem *parentOutline)
 
 PdfOutlineItem (PdfObject &obj, PdfOutlineItem *parentOutline, PdfOutlineItem *previous)
 

Detailed Description

A PDF outline item has an title and a destination. It is an element in the documents outline which shows its hierarchical structure.

See also
PdfDocument
PdfOutlines
PdfDestination

Constructor & Destructor Documentation

PdfOutlineItem::PdfOutlineItem ( PdfDocument doc)
protected

Create a new PdfOutlineItem dictionary

Parameters
parentparent vector of objects
PdfOutlineItem::PdfOutlineItem ( PdfDocument doc,
const PdfString title,
const std::shared_ptr< PdfDestination > &  dest,
PdfOutlineItem parentOutline 
)
protected

Create a new PdfOutlineItem from scratch

Parameters
titletitle of this item
destdestination of this item
parentOutlineparent of this outline item in the outline item hierarchie
parentparent vector of objects which is required to create new objects
PdfOutlineItem::PdfOutlineItem ( PdfDocument doc,
const PdfString title,
const std::shared_ptr< PdfAction > &  action,
PdfOutlineItem parentOutline 
)
protected

Create a new PdfOutlineItem from scratch

Parameters
titletitle of this item
actionaction of this item
parentOutlineparent of this outline item in the outline item hierarchie
parentparent vector of objects which is required to create new objects
PdfOutlineItem::PdfOutlineItem ( PdfObject obj,
PdfOutlineItem parentOutline,
PdfOutlineItem previous 
)
protected

Create a PdfOutlineItem from an existing PdfObject

Parameters
objan existing outline item
parentOutlineparent of this outline item in the outline item hierarchie
previousprevious item of this item

Member Function Documentation

PdfOutlineItem * PdfOutlineItem::CreateChild ( const PdfString title,
const std::shared_ptr< PdfDestination > &  dest 
)

Create a PdfOutlineItem that is a child of this item

Parameters
titletitle of this item
destdestination of this item
PdfOutlineItem * PdfOutlineItem::CreateNext ( const PdfString title,
const std::shared_ptr< PdfDestination > &  dest 
)

Create a PdfOutlineItem that is on the same level and follows the current item.

Parameters
titletitle of this item
destdestination of this item
PdfOutlineItem * PdfOutlineItem::CreateNext ( const PdfString title,
const std::shared_ptr< PdfAction > &  action 
)

Create a PdfOutlineItem that is on the same level and follows the current item.

Parameters
titletitle of this item
actionaction of this item
void PdfOutlineItem::Erase ( )

Deletes this outline item and all its children from the outline hierarchy and removes all objects from the list of PdfObjects All pointers to this item will be invalid after this function call.

PdfOutlineItem* PoDoFo::PdfOutlineItem::First ( ) const
inline
Returns
the first outline item that is a child of this item
shared_ptr< PdfAction > PdfOutlineItem::GetAction ( ) const

Get the action of this outline.

Returns
the action, if there is one, or nullptr
shared_ptr< PdfDestination > PdfOutlineItem::GetDestination ( ) const

Get the destination of this outline.

Returns
the destination, if there is one, or nullptr
PdfOutlineItem* PoDoFo::PdfOutlineItem::GetParentOutline ( ) const
inline
Returns
the parent item of this item or nullptr if it is the top level outlines dictionary
double PdfOutlineItem::GetTextColorBlue ( ) const

Get the color of the title of this item. Supported since PDF 1.4.

Returns
the red color component
See also
SetTextColor
double PdfOutlineItem::GetTextColorGreen ( ) const

Get the color of the title of this item. Supported since PDF 1.4.

Returns
the red color component
See also
SetTextColor
double PdfOutlineItem::GetTextColorRed ( ) const

Get the color of the title of this item. Supported since PDF 1.4.

Returns
the red color component
See also
SetTextColor
PdfOutlineFormat PdfOutlineItem::GetTextFormat ( ) const

Get the text format of the title

Returns
the text format of the title
const PdfString & PdfOutlineItem::GetTitle ( ) const

Get the title of this item

Returns
the title as PdfString
void PdfOutlineItem::InsertChild ( PdfOutlineItem item)

Inserts a new PdfOutlineItem as a child of this outline item. The former can't be in the same tree as this one, as the tree property would be broken. If this prerequisite is violated, a PdfError exception (code PdfErrorCode::OutlineItemAlreadyPresent) is thrown and nothing is changed. The item inserted is not copied, i.e. Erase() calls affect the original! Therefore also shared ownership is in effect, i.e. deletion by where it comes from damages the data structure it's inserted into.

Parameters
iteman existing outline item
PdfOutlineItem* PoDoFo::PdfOutlineItem::Last ( ) const
inline
Returns
the last outline item that is a child of this item
PdfOutlineItem* PoDoFo::PdfOutlineItem::Next ( ) const
inline
Returns
the next item or nullptr if this is the last on the current level
PdfOutlineItem* PoDoFo::PdfOutlineItem::Prev ( ) const
inline
Returns
the previous item or nullptr if this is the first on the current level
void PdfOutlineItem::SetAction ( const std::shared_ptr< PdfAction > &  action)

Set the action of this outline.

Parameters
actionthe action
void PdfOutlineItem::SetDestination ( const std::shared_ptr< PdfDestination > &  dest)

Set the destination of this outline.

Parameters
destthe destination
void PdfOutlineItem::SetTextColor ( double  r,
double  g,
double  b 
)

Set the color of the title of this item. This property is supported since PDF 1.4.

Parameters
rred color component
ggreen color component
bblue color component
void PdfOutlineItem::SetTextFormat ( PdfOutlineFormat  format)

Set the text format of the title. Supported since PDF 1.4.

Parameters
formatthe formatting options for the title
void PdfOutlineItem::SetTitle ( const PdfString title)

Set the title of this outline item

Parameters
titlethe title to use