Bookmark Class Documentation

class Bookmark

Namespace:datalogics_interface

Detailed Description

A bookmark on a page of a PDF document.

Each bookmark has a title that appears on screen, and an action that specifies what happens when a user clicks on the bookmark.

The typical action for a user-created bookmark is to move to another location in the current document, although any action (see Action) can be specified.

Referenced by

Constructor & Destructor Documentation

~Bookmark

~Bookmark()

Member Function Documentation

add_child

void add_child(Bookmark & child)

Parameters

child: Bookmark &

- the bookmark being added.

Returns:

void

Add an existing bookmark to be the child bookmark of a parent.

add_next_sibling

void add_next_sibling(Bookmark & sibling)

Parameters

sibling: Bookmark &

- The bookmark to become the new right sibling.

Returns:

void

Add a bookmark to a tree as the next (right) sibling.

add_previous_sibling

void add_previous_sibling(Bookmark & sibling)

Parameters

sibling: Bookmark &

- The bookmark to become the new left sibling.

Returns:

void

Add a bookmark to a tree as the previous (left) sibling.

add_subtree

void add_subtree(Bookmark & subtree, const std::string & title)

Parameters

subtree: Bookmark &

- The bookmark subtree to add.

title: const std::string &

- the title of the newly added subtree.

Returns:

void

Add a copy of a subtree as the new last child of a parent bookmark, and gives the subtree an initial title.

clear_action

void clear_action()

Returns:

void

Removes the action from this bookmark.

create_new_child

std::unique_ptr< Bookmark > create_new_child(const std::string & title)

Parameters

title: const std::string &

- The initial title of the new child bookmark.

Returns:

std::unique_ptr< Bookmark >

The newly created child bookmark.

(Deprecated, function may be removed in the future, use single-parameter CreateNewChild() method instead) Create a bookmark and add to a parent as the last child bookmark, and give the new bookmark an initial title.

create_new_sibling

std::unique_ptr< Bookmark > create_new_sibling(const std::string & title)

Parameters

title: const std::string &

- The initial text for the new right sibling.

Returns:

std::unique_ptr< Bookmark >

The newly created sibling bookmark.

Create a new bookmark in a tree as the next (right) sibling, using supplied string as the initial text.

destroy

void destroy()

Returns:

void

Removes a bookmark subtree from the bookmark tree containing it.

find_descendant_bookmark

std::unique_ptr< Bookmark > find_descendant_bookmark(const std::string & title)

Parameters

title: const std::string &

- The title of the bookmark for which to search.

Returns:

std::unique_ptr< Bookmark >

The bookmark within this bookmark's tree that has the supplied title. Returns NULL if there is no bookmark with the supplied title.

Find bookmark by its title within the subtree of which this bookmark is the root, searching within the subtree to a depth determined by maxDepth (e.g., 0 = this bookmark only and not any of its children, 1 = search one level below this bookmark level, etc.)

find_descendant_bookmark

std::unique_ptr< Bookmark > find_descendant_bookmark(const std::string & title, int max_depth)

Parameters

title: const std::string &

- The title of the bookmark for which to search.

max_depth: int

- If supplied, declares the number of levels below this bookmark to search. (If omitted, the entire subtree is searched.)

Returns:

std::unique_ptr< Bookmark >

The bookmark within this bookmark's tree that has the supplied title. Returns NULL if there is no bookmark with the supplied title.

Find bookmark by its title within the subtree of which this bookmark is the root, searching within the subtree to a depth determined by maxDepth (e.g., 0 = this bookmark only and not any of its children, 1 = search one level below this bookmark level, etc.)

get_count

int get_count()

Returns:

int

the number of open bookmarks.

Get the number of open bookmarks in the subtree under this bookmark.

get_indent

int get_indent()

Returns:

int

the indentation level of the bookmark.

Get the indentation level of a bookmark in its containing tree.

get_pdf_dict

PDFDict get_pdf_dict()

Returns:

PDFDict

The dictionary associated with the bookmark.

Get the dictionary associated with the bookmark.

get_previous

Returns:

std::unique_ptr< Bookmark >

The Bookmark object's previous (left) sibling. It returns null if Bookmark has no previous sibling (that is, it is its parent's first child).

Gets a bookmark's previous (left) sibling.

get_title

std::string get_title()

Returns:

std::string

The title of the bookmark.

has_children

bool has_children()

Returns:

bool

true if the bookmark has children.

Does the bookmark have children?

is_open

bool is_open()

Returns:

bool

true if the bookmark is open.

Is the bookmark open?

operator==

bool operator==(const Bookmark & other)

Parameters

other: const Bookmark &

The other Bookmark to compare against.

Returns:

bool

true if the bookmarks are equal, false otherwise.

Compare two bookmarks for equality.

set_action

void set_action(const Action & action)

Parameters

action: const Action &

- The action to set for the bookmark.

Returns:

void

Set the Action for a bookmark.

set_color

void set_color(const Color & color)

Parameters

color: const Color &

the color of the bookmark

Returns:

void

Set the color of the bookmark.

set_flags

void set_flags(BookmarkFlags flags)

Parameters

Returns:

void

Set the flags for the bookmark to the parameter values.

set_open

void set_open(bool open)

Parameters

open: bool

if the bookmark is open or closed

Returns:

void

Set if the bookmark is open or closed.

set_title

void set_title(const std::string & title)

Parameters

title: const std::string &

the title of the bookmark

Returns:

void

The title of the bookmark.

to_string

std::string to_string()

Returns:

std::string

A string describing this Bookmark and its properties.

Returns a string representation of this Bookmark.

The string includes the title, color, flags, count, indent level, open state, and view destination if available.