Bookmark Class Documentation

classBookmark

Namespace:datalogics_interface

Detailed Description

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

voidadd_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

voidadd_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

voidadd_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

voidadd_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

voidclear_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:

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:

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

voiddestroy()

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:

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, intmax_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:

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_color

Returns:

the color, or null if no color was specified

Get the color of the bookmark.

get_count

intget_count()

Returns:

the number of open bookmarks.

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

get_first_child

Returns:

The first child of Bookmark, or null if Bookmark has no children.

Gets a bookmark's first child.

get_flags

BookmarkFlagsget_flags()

Returns:

the flags

Get the flags for the bookmark.

get_indent

intget_indent()

Returns:

the indentation level of the bookmark.

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

get_last_child

Returns:

The last child of Bookmark, or null if Bookmark has no children.

Gets a bookmark's last child.

get_next

Returns:

The Bookmark object's next (right) sibling. It returns null if Bookmark has no next sibling (that is, it is its parent's last child).

Gets a bookmark's next (right) sibling.

get_parent

Returns:

The Bookmark object's parent. It returns null if Bookmark has no parent (that is, it is the root of the tree).

Gets a bookmark's parent.

get_pdf_dict

PDFDictget_pdf_dict()

Returns:

The dictionary associated with the bookmark.

Get the dictionary associated with the bookmark.

get_previous

Returns:

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::stringget_title()

Returns:

std::string

The title of the bookmark.

get_view_destination

Returns:

the view destination

If this bookmark has a GoTo action, then return the destination of the action, else return null.

has_children

boolhas_children()

Returns:

true if the bookmark has children.

Does the bookmark have children?

is_open

boolis_open()

Returns:

true if the bookmark is open.

Is the bookmark open?

operator==

booloperator==(const Bookmark &other)

Parameters

other: const Bookmark &

The other Bookmark to compare against.

Returns:

true if the bookmarks are equal, false otherwise.

Compare two bookmarks for equality.

set_action

voidset_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

voidset_color(const Color &color)

Parameters

color: const Color &

the color of the bookmark

Returns:

void

Set the color of the bookmark.

set_flags

voidset_flags(BookmarkFlagsflags)

Parameters

Returns:

void

Set the flags for the bookmark to the parameter values.

set_open

voidset_open(boolopen)

Parameters

open: bool

if the bookmark is open or closed

Returns:

void

Set if the bookmark is open or closed.

set_title

voidset_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::stringto_string()

Returns:

A string describing this Bookmark and its properties.

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