DhBookTree: Devhelp 3 Reference Manual

## DhBookTree DhBookTree — A GtkTreeView containing the tree structure of a DhBookList |

## Functions

DhBookTree * | dh_book_tree_new ()
DhProfile * | dh_book_tree_get_profile ()
DhLink * | dh_book_tree_get_selected_link ()
void | dh_book_tree_select_uri ()

## Properties

DhProfile * | profile | Read / Write / Construct Only

## Signals

void | link-selected | Run Last

## Types and Values

struct | DhBookTree

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkTreeView
                        ╰── DhBookTree

## Implemented Interfaces

DhBookTree implements AtkImplementorIface, GtkBuildable and GtkScrollable.

## Includes

    #include <devhelp/devhelp.h>

## Description

DhBookTree is a GtkTreeView (showing a tree, not a list) containing the general tree structure of the DhBook's contained in a DhBookList (the DhBookList part of the provided DhProfile).

DhBookTree calls the `dh_book_get_tree()` function to get the tree structure of a DhBook. As such the tree contains only DhLink's of type `DH_LINK_TYPE_BOOK` or `DH_LINK_TYPE_PAGE`.

When an element is selected, the “link-selected” signal is emitted. Only one element can be selected at a time.

## Functions

### dh_book_tree_new ()

    DhBookTree *
    dh_book_tree_new (DhProfile *profile);

#### Parameters

profile | a DhProfile, or `NULL` for the default profile. | [nullable]

#### Returns

a new DhBookTree widget.

[transfer floating]

### dh_book_tree_get_profile ()

    DhProfile *
    dh_book_tree_get_profile (DhBookTree *tree);

#### Parameters

tree | a DhBookTree. |

#### Returns

the DhProfile of `tree` .

[transfer none]

Since: 3.30

### dh_book_tree_get_selected_link ()

    DhLink *
    dh_book_tree_get_selected_link (DhBookTree *tree);

#### Parameters

tree | a DhBookTree. |

#### Returns

the currently selected DhLink in `tree` , or `NULL` if the selection is empty or if a language group row is selected. Unref with `dh_link_unref()` when no longer needed.

[transfer full][nullable]

Since: 3.30

### dh_book_tree_select_uri ()

    void
    dh_book_tree_select_uri (DhBookTree *tree,
                             const gchar *uri);

Selects the row corresponding to `uri` . It searches in the tree a DhLink being at `uri` (if it's an exact match), or containing `uri` (if `uri` contains an anchor).

#### Parameters

tree | a DhBookTree. |
uri | the URI to select. |

## Types and Values

### struct DhBookTree

    struct DhBookTree;

## Property Details

### The `“profile”` property

      “profile”                  DhProfile *

The DhProfile. If set to `NULL`, the default profile as returned by `dh_profile_get_default()` is used.

Owner: DhBookTree

Flags: Read / Write / Construct Only

Since: 3.30

## Signal Details

### The `“link-selected”` signal

    void
    user_function (DhBookTree *tree,
                   DhLink     *link,
                   gpointer    user_data)

#### Parameters

tree | the DhBookTree. |
link | the selected DhLink. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last