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() [1/4]

PdfOutlineItem::PdfOutlineItem ( PdfDocument doc)
protected

Create a new PdfOutlineItem dictionary

Parameters
parentparent vector of objects

◆ PdfOutlineItem() [2/4]

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() [3/4]

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() [4/4]

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

◆ CreateChild()

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

◆ CreateNext() [1/2]

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

◆ CreateNext() [2/2]

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

◆ Erase()

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.

◆ First()

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

◆ GetAction()

shared_ptr< PdfAction > PdfOutlineItem::GetAction ( ) const

Get the action of this outline.

Returns
the action, if there is one, or nullptr

◆ GetDestination()

shared_ptr< PdfDestination > PdfOutlineItem::GetDestination ( ) const

Get the destination of this outline.

Returns
the destination, if there is one, or nullptr

◆ GetParentOutline()

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

◆ GetTextColorBlue()

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

◆ GetTextColorGreen()

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

◆ GetTextColorRed()

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

◆ GetTextFormat()

PdfOutlineFormat PdfOutlineItem::GetTextFormat ( ) const

Get the text format of the title

Returns
the text format of the title

◆ GetTitle()

const PdfString & PdfOutlineItem::GetTitle ( ) const

Get the title of this item

Returns
the title as PdfString

◆ InsertChild()

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

◆ Last()

PdfOutlineItem * PoDoFo::PdfOutlineItem::Last ( ) const
inline
Returns
the last outline item that is a child of this item

◆ Next()

PdfOutlineItem * PoDoFo::PdfOutlineItem::Next ( ) const
inline
Returns
the next item or nullptr if this is the last on the current level

◆ Prev()

PdfOutlineItem * PoDoFo::PdfOutlineItem::Prev ( ) const
inline
Returns
the previous item or nullptr if this is the first on the current level

◆ SetAction()

void PdfOutlineItem::SetAction ( const std::shared_ptr< PdfAction > &  action)

Set the action of this outline.

Parameters
actionthe action

◆ SetDestination()

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

Set the destination of this outline.

Parameters
destthe destination

◆ SetTextColor()

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

◆ SetTextFormat()

void PdfOutlineItem::SetTextFormat ( PdfOutlineFormat  format)

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

Parameters
formatthe formatting options for the title

◆ SetTitle()

void PdfOutlineItem::SetTitle ( const PdfString title)

Set the title of this outline item

Parameters
titlethe title to use