DhBookListBuilder: Devhelp 3 Reference Manual

## DhBookListBuilder DhBookListBuilder — Builds DhBookList objects |

## Functions

DhBookListBuilder * | dh_book_list_builder_new ()
void | dh_book_list_builder_add_sub_book_list ()
void | dh_book_list_builder_add_default_sub_book_lists ()
void | dh_book_list_builder_read_books_disabled_setting ()
DhBookList * | dh_book_list_builder_create_object ()

## Types and Values

struct | DhBookListBuilder

## Object Hierarchy

        GObject
        ╰── DhBookListBuilder

## Includes

    #include <devhelp/devhelp.h>

## Description

DhBookListBuilder permits to build DhBookList objects.

## Functions

### dh_book_list_builder_new ()

    DhBookListBuilder *
    dh_book_list_builder_new (void);

#### Returns

a new DhBookListBuilder.

[transfer full]

Since: 3.30

### dh_book_list_builder_add_sub_book_list ()

    void
    dh_book_list_builder_add_sub_book_list
                                   (DhBookListBuilder *builder,
                                    DhBookList *sub_book_list);

Adds `sub_book_list` .

The DhBookList object that will be created with `dh_book_list_builder_create_object()` will contain all the sub-DhBookList's added with this function (and it will listen to their signals). The sub-DhBookList's must be added in order of decreasing priority (the first sub-DhBookList added has the highest priority). The priority is used in case of book ID conflicts (see `dh_book_get_id()`).

#### Parameters

builder | a DhBookListBuilder. |
sub_book_list | a DhBookList. |

Since: 3.30

### dh_book_list_builder_add_default_sub_book_lists ()

    void
    dh_book_list_builder_add_default_sub_book_lists
                                   (DhBookListBuilder *builder);

Creates the default DhBookListDirectory's and adds them to `builder` with `dh_book_list_builder_add_sub_book_list()`.

It creates and adds a DhBookListDirectory for the following directories (in that order):

- `$XDG_DATA_HOME/doc/`

- `$XDG_DATA_HOME/gtk-doc/html/`

- `$XDG_DATA_HOME/devhelp/books/`

- For each directory in `$XDG_DATA_DIRS`:

  - `$xdg_data_dir/doc/`

  - `$xdg_data_dir/gtk-doc/html/`

  - `$xdg_data_dir/devhelp/books/`

See `g_get_user_data_dir()` and `g_get_system_data_dirs()`.

Additionally, if the libdevhelp has been compiled with the `flatpak_build` option, it creates and adds a DhBookListDirectory for the following directories (in that order, after the above ones):

- `/run/host/usr/share/doc/`

- `/run/host/usr/share/gtk-doc/html/`

- `/run/host/usr/share/devhelp/books/`

The exact list of directories is subject to change, it is not part of the API.

#### Parameters

builder | a DhBookListBuilder. |

Since: 3.30

### dh_book_list_builder_read_books_disabled_setting ()

    void
    dh_book_list_builder_read_books_disabled_setting
                                   (DhBookListBuilder *builder,
                                    DhSettings *settings);

Sets the DhSettings object from which to read the "books-disabled" GSettings key. If `settings` is `NULL` or if this function isn't called, then the DhBookList object that will be created with `dh_book_list_builder_create_object()` will not read a "books-disabled" setting.

With DhBookListBuilder it is not possible to read the "books-disabled" settings from several DhSettings objects and combine them. Only the last call to this function is taken into account when creating the DhBookList with `dh_book_list_builder_create_object()`.

#### Parameters

builder | a DhBookListBuilder. |
settings | a DhSettings, or `NULL`. | [nullable]

Since: 3.30

### dh_book_list_builder_create_object ()

    DhBookList *
    dh_book_list_builder_create_object (DhBookListBuilder *builder);

Creates the DhBookList. It actually creates a subclass of DhBookList, but the subclass is not exposed to the public API.

#### Parameters

builder | a DhBookListBuilder. |

#### Returns

the newly created DhBookList object.

[transfer full]

Since: 3.30

## Types and Values

### struct DhBookListBuilder

    struct DhBookListBuilder;