comet.CBookmark¶
- class comet.CBookmark¶
See also
Module hyperlink
Methods¶
- CBookmark.isValid()¶
Determine whether this bookmark is still valid and exists in a document. A bookmark may be invalid e.g. when it is deleted from the owning document by calling
remove()
- Returns
Whether the frame is still valid
- Return type
- Available
- CScript
- CBookmark.getDocument()¶
Get the document this bookmark belongs to.
- Returns
The document
- Return type
- Raises
CometError – On internal error
- Available
- CBookmark.getName()¶
Get the name of this bookmark.
- Returns
The name
- Return type
- Raises
CometError – On internal error
- Available
- CScript
- CBookmark.setName(name)¶
Change the name of this bookmark.
- Parameters
name (str) – The new name
- Return type
- Raises
TypeError – When parameter types are invalid
ValueError – When parameter name is empty str
CometError – On internal error
- Available
- CScript
- CBookmark.getDepth()¶
Get the nesting level of this bookmark.
- Returns
The 0-based nesting level
- Return type
- Raises
CometError – On internal error
- Available
- CScript
- CBookmark.getIndex()¶
Get the index of this bookmark at the local nesting level.
- Returns
The 0-based local index
- Return type
- Raises
CometError – On internal error
- Available
- CScript
- CBookmark.setIndex(index)¶
Change this bookmark’s index inside the parent level.
- Parameters
index (int) –
The new local index.
The value is clamped to valid values:
< 0 or > max index: Last
- Return type
- Raises
TypeError – When parameter types are invalid
CometError – On internal error
- Available
- CScript
- See also
- CBookmark.getParent()¶
Get the parent bookmark of this bookmark.
May return
None
when this bookmark is at the top level.- Returns
The parent bookmark
- Return type
- Raises
CometError – On internal error
- Available
- CScript
- CBookmark.setParent(parent, index=- 1)¶
Change the parent of this bookmark.
- Parameters
parent –
The new parent bookmark.
Of course this must be a valid parent, e.g. parenting underneath a child of itself is not possible.
The parameter type can be:
index (int) –
The new local index.
The value is clamped to valid values:
< 0 or > max index: Last
- Return type
- Raises
TypeError – When parameter types are invalid
CometError – On internal error
- Available
- CScript
- CBookmark.getChildren(recursive=False, name='')¶
Get childen of this bookmark.
- Parameters
- Returns
The child bookmarks
- Return type
- Raises
TypeError – When parameter types are invalid
CometError – On internal error
- Available
- CScript
- CBookmark.setColor(color)¶
Change the font color of this bookmark.
- Parameters
color (CSwatch) –
The new color.
Must be in color model
comet.kColorModelRGB
- Return type
- Raises
TypeError – When parameter types are invalid
CometError – On internal error
- Available
- CScript
- CBookmark.createBookmark(pageDestination, name, index=- 1)¶
Create a new bookmark as a child of this one.
- Parameters
- Returns
The newly created bookmark
- Return type
- Raises
TypeError – When parameter types are invalid
ValueError – When parameter name is empty
- Available
- CScript
- CBookmark.remove()¶
Remove this bookmark from the document.
All subsequent calls to this bookmarks’s functions will fail.
- Return type
- Raises
CometError – On internal error
- Available
- CScript