DhWebView: Devhelp 3 Reference Manual

## DhWebView DhWebView — Subclass of WebKitWebView |

## Functions

DhWebView * | dh_web_view_new ()
DhProfile * | dh_web_view_get_profile ()
const gchar * | dh_web_view_get_devhelp_title ()
void | dh_web_view_set_search_text ()
void | dh_web_view_search_next ()
void | dh_web_view_search_previous ()
gboolean | dh_web_view_can_zoom_in ()
gboolean | dh_web_view_can_zoom_out ()
gboolean | dh_web_view_can_reset_zoom ()
void | dh_web_view_zoom_in ()
void | dh_web_view_zoom_out ()
void | dh_web_view_reset_zoom ()

## Properties

DhProfile * | profile | Read / Write / Construct Only

## Signals

void | open-new-tab | Run Last

## Types and Values

struct | DhWebView

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── WebKitWebViewBase
                        ╰── WebKitWebView
                            ╰── DhWebView

## Implemented Interfaces

DhWebView implements AtkImplementorIface and GtkBuildable.

## Includes

    #include <devhelp/devhelp.h>

## Description

DhWebView is a subclass of WebKitWebView, to have a higher-level API for some features, and with some customizations for the libdevhelp use-case.

Features:

- Ctrl+scroll to zoom in/zoom out.

- Sending the “open-new-tab” signal on middle click or Ctrl+click on a link (DhNotebook handles that signal).

- Calls `gtk_show_uri_on_window()` when opening a non-local link (for example a `http://` URL).

The DhProfile is used for:

- Applying the DhSettings fonts.

- When trying to load a remote URL from developer.gnome.org, find in the DhBookList if there is an equivalent local link to load it instead of opening the URL with `gtk_show_uri_on_window()`.

## Functions

### dh_web_view_new ()

    DhWebView *
    dh_web_view_new (DhProfile *profile);

#### Parameters

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

#### Returns

a new DhWebView widget.

[transfer floating]

Since: 3.30

### dh_web_view_get_profile ()

    DhProfile *
    dh_web_view_get_profile (DhWebView *view);

#### Parameters

view | a DhWebView. |

#### Returns

the “profile”.

[transfer none]

Since: 3.30

### dh_web_view_get_devhelp_title ()

    const gchar *
    dh_web_view_get_devhelp_title (DhWebView *view);

An enhanced getter function for the “title” property: when that property is the empty string or `NULL`, this function returns “Empty Page” (translated).

#### Parameters

view | a DhWebView. |

#### Returns

the title of `view` , suitable for a tab label or window title.

Since: 3.30

### dh_web_view_set_search_text ()

    void
    dh_web_view_set_search_text (DhWebView *view,
                                 const gchar *search_text);

A more convenient API (for Devhelp needs) than WebKitFindController. If `search_text` is not empty, it calls `webkit_find_controller_search()` if not already done. If `search_text` is empty or `NULL`, it calls `webkit_find_controller_search_finish()`.

#### Parameters

view | a DhWebView. |
search_text | the search string, or `NULL`. | [nullable]

Since: 3.30

### dh_web_view_search_next ()

    void
    dh_web_view_search_next (DhWebView *view);

Like `webkit_find_controller_search_next()`, but takes into account whether `dh_web_view_set_search_text()` has been called.

#### Parameters

view | a DhWebView. |

Since: 3.30

### dh_web_view_search_previous ()

    void
    dh_web_view_search_previous (DhWebView *view);

Like `webkit_find_controller_search_previous()`, but takes into account whether `dh_web_view_set_search_text()` has been called.

#### Parameters

view | a DhWebView. |

Since: 3.30

### dh_web_view_can_zoom_in ()

    gboolean
    dh_web_view_can_zoom_in (DhWebView *view);

#### Parameters

view | a DhWebView. |

#### Returns

whether calling `dh_web_view_zoom_in()` will have an effect.

Since: 3.30

### dh_web_view_can_zoom_out ()

    gboolean
    dh_web_view_can_zoom_out (DhWebView *view);

#### Parameters

view | a DhWebView. |

#### Returns

whether calling `dh_web_view_zoom_out()` will have an effect.

Since: 3.30

### dh_web_view_can_reset_zoom ()

    gboolean
    dh_web_view_can_reset_zoom (DhWebView *view);

#### Parameters

view | a DhWebView. |

#### Returns

whether calling `dh_web_view_reset_zoom()` will have an effect.

Since: 3.30

### dh_web_view_zoom_in ()

    void
    dh_web_view_zoom_in (DhWebView *view);

Makes the text larger.

#### Parameters

view | a DhWebView. |

Since: 3.30

### dh_web_view_zoom_out ()

    void
    dh_web_view_zoom_out (DhWebView *view);

Makes the text smaller.

#### Parameters

view | a DhWebView. |

Since: 3.30

### dh_web_view_reset_zoom ()

    void
    dh_web_view_reset_zoom (DhWebView *view);

Reset the text size to the normal size.

#### Parameters

view | a DhWebView. |

Since: 3.30

## Types and Values

### struct DhWebView

    struct DhWebView;

## 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.

Flags: Read / Write / Construct Only

Since: 3.30

## Signal Details

### The `“open-new-tab”` signal

    void
    user_function (DhWebView *view,
                   gchar     *uri,
                   gpointer   user_data)

The ::open-new-tab signal is emitted when a URI needs to be opened in a new DhWebView. This happens when doing Ctrl+click or middle click on a link.

#### Parameters

view | the DhWebView emitting the signal. |
uri | the URI to open. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.30