## DhBook DhBook — A book, usually the documentation for one library |

## Functions

DhBook * | dh_book_new ()
GList * | dh_book_get_keywords ()
GList * | dh_book_get_completions ()
GNode * | dh_book_get_tree ()
const gchar * | dh_book_get_name ()
const gchar * | dh_book_get_title ()
const gchar * | dh_book_get_language ()
const gchar * | dh_book_get_path ()
gboolean | dh_book_get_enabled ()
void | dh_book_set_enabled ()
gint | dh_book_cmp_by_path ()
gint | dh_book_cmp_by_name ()
gint | dh_book_cmp_by_title ()

## Signals

void | deleted | Run Last
void | disabled | Run Last
void | enabled | Run Last
void | updated | Run Last

## Types and Values

struct | DhBook

## Object Hierarchy

        GObject
        ╰── DhBook

## Includes

    #include <devhelp/devhelp.h>

## Description

A DhBook usually contains the documentation for one library (or application), for example GLib or GTK+. There is one DhBook for each index file found and parsed (an index file is a file with the extension `*.devhelp` or `*.devhelp2`).

## Functions

### dh_book_new ()

    DhBook *
    dh_book_new (const gchar *index_file_path);

#### Parameters

index_file_path | the path to the index file. |

#### Returns

a new DhBook object.

### dh_book_get_keywords ()

    GList *
    dh_book_get_keywords (DhBook *book);

#### Parameters

book | a DhBook. |

#### Returns

the list of all DhLink's part of `book` , or `NULL` if the book is disabled.

[element-type DhLink][transfer none][nullable]

### dh_book_get_completions ()

    GList *
    dh_book_get_completions (DhBook *book);

#### Parameters

book | a DhBook. |

#### Returns

the completions associated with the book.

[element-type utf8][transfer none][nullable]

### dh_book_get_tree ()

    GNode *
    dh_book_get_tree (DhBook *book);

Gets the general structure of the book, as a tree. The tree contains only DhLink's of type `DH_LINK_TYPE_BOOK` or `DH_LINK_TYPE_PAGE`. The other DhLink's are not contained in the tree. To have a list of all DhLink's part of the book, you need to call `dh_book_get_keywords()`.

#### Parameters

book | a DhBook. |

#### Returns

the tree of DhLink's part of the `book` , or `NULL` if the book is disabled.

[transfer none][nullable]

### dh_book_get_name ()

    const gchar *
    dh_book_get_name (DhBook *book);

#### Parameters

book | a DhBook. |

#### Returns

the book name.

### dh_book_get_title ()

    const gchar *
    dh_book_get_title (DhBook *book);

#### Parameters

book | a DhBook. |

#### Returns

the book title.

### dh_book_get_language ()

    const gchar *
    dh_book_get_language (DhBook *book);

#### Parameters

book | a DhBook. |

#### Returns

the book language.

### dh_book_get_path ()

    const gchar *
    dh_book_get_path (DhBook *book);

#### Parameters

book | a DhBook. |

#### Returns

the path to the index file.

### dh_book_get_enabled ()

    gboolean
    dh_book_get_enabled (DhBook *book);

#### Parameters

book | a DhBook. |

#### Returns

whether the book is enabled.

### dh_book_set_enabled ()

    void
    dh_book_set_enabled (DhBook *book,
                         gboolean enabled);

Enables or disables the book.

#### Parameters

book | a DhBook. |
enabled | the new value. |

### dh_book_cmp_by_path ()

    gint
    dh_book_cmp_by_path (DhBook *a,
                         DhBook *b);

Compares the DhBook's by their path to the index file.

#### Parameters

a | a DhBook. |
b | a DhBook. |

#### Returns

an integer less than, equal to, or greater than zero, if `a` is <, == or > than `b` .

### dh_book_cmp_by_name ()

    gint
    dh_book_cmp_by_name (DhBook *a,
                         DhBook *b);

Compares the DhBook's by their name.

#### Parameters

a | a DhBook. |
b | a DhBook. |

#### Returns

an integer less than, equal to, or greater than zero, if `a` is <, == or > than `b` .

### dh_book_cmp_by_title ()

    gint
    dh_book_cmp_by_title (DhBook *a,
                          DhBook *b);

Compares the DhBook's by their title.

#### Parameters

a | a DhBook. |
b | a DhBook. |

#### Returns

an integer less than, equal to, or greater than zero, if `a` is <, == or > than `b` .

## Types and Values

### struct DhBook

    struct DhBook;

## Signal Details

### The `“deleted”` signal

    void
    user_function (DhBook  *book,
                   gpointer user_data)

#### Parameters

book | the book on which the signal is emitted. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“disabled”` signal

    void
    user_function (DhBook  *book,
                   gpointer user_data)

#### Parameters

book | the book on which the signal is emitted. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“enabled”` signal

    void
    user_function (DhBook  *book,
                   gpointer user_data)

#### Parameters

book | the book on which the signal is emitted. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“updated”` signal

    void
    user_function (DhBook  *book,
                   gpointer user_data)

#### Parameters

book | the book on which the signal is emitted. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last