WebKitGTK+ Reference Manual: WebKitIconDatabase

## WebKitIconDatabase WebKitIconDatabase — A WebKit web application database |

## Functions

void | webkit_icon_database_clear ()
GdkPixbuf * | webkit_icon_database_get_icon_pixbuf ()
gchar * | webkit_icon_database_get_icon_uri ()
const gchar * | webkit_icon_database_get_path ()
GType | webkit_icon_database_get_type ()
void | webkit_icon_database_set_path ()

## Properties

gchar * | path | Read / Write

## Signals

void | icon-loaded | Run Last

## Types and Values

| WebKitIconDatabase

## Object Hierarchy

        GObject
        ╰── WebKitIconDatabase

## Description

WebKitIconDatabase provides access to website icons, as shown in tab labels, window captions or bookmarks. All views share the same icon database.

The icon database is enabled by default and stored in ~/.cache/webkit/icondatabase, depending on XDG_CACHE_HOME.

WebKit will automatically look for available icons in link elements on opened pages as well as an existing favicon.ico and load the images found into the memory cache if possible. The signal "icon-loaded" will be emitted when any icon is found and loaded. Old Icons are automatically cleaned up after 4 days.

webkit_icon_database_set_path() can be used to change the location of the database and also to disable it by passing `NULL`.

If WebKitWebSettings::enable-private-browsing is `TRUE` new icons won't be added to the database on disk and no existing icons will be deleted from it.

## Functions

### webkit_icon_database_clear ()

    void
    webkit_icon_database_clear (WebKitIconDatabase *database);

`webkit_icon_database_clear` has been deprecated since version 1.8 and should not be used in newly-written code.

Use `webkit_favicon_database_clear()` instead.

Clears all icons from the database.

#### Parameters

database | a WebKitIconDatabase |

Since 1.3.13

### webkit_icon_database_get_icon_pixbuf ()

    GdkPixbuf *
    webkit_icon_database_get_icon_pixbuf (WebKitIconDatabase *database,
                                          const gchar *page_uri);

`webkit_icon_database_get_icon_pixbuf` has been deprecated since version 1.8 and should not be used in newly-written code.

Use `webkit_favicon_database_try_get_favicon_pixbuf()` instead.

Obtains a GdkPixbuf of the favicon for the given page URI, or a default icon if there is no icon for the given page. Use `webkit_icon_database_get_icon_uri()` if you need to distinguish these cases. Usually you want to connect to WebKitIconDatabase::icon-loaded and call this method in the callback.

The pixbuf will have the largest size provided by the server and should be resized before it is displayed. See also `webkit_web_view_get_icon_pixbuf()`.

#### Parameters

database | a WebKitIconDatabase |
page_uri | URI of the page containing the icon |

#### Returns

a new reference to a GdkPixbuf, or `NULL`.

[transfer full]

Since 1.3.13

### webkit_icon_database_get_icon_uri ()

    gchar *
    webkit_icon_database_get_icon_uri (WebKitIconDatabase *database,
                                       const gchar *page_uri);

`webkit_icon_database_get_icon_uri` has been deprecated since version 1.8 and should not be used in newly-written code.

Use `webkit_favicon_database_get_favicon_uri()` instead.

Obtains the URI for the favicon for the given page URI. See also `webkit_web_view_get_icon_uri()`.

#### Parameters

database | a WebKitIconDatabase |
page_uri | URI of the page containing the icon |

#### Returns

a newly allocated URI for the favicon, or `NULL`

Since 1.3.13

### webkit_icon_database_get_path ()

    const gchar *
    webkit_icon_database_get_path (WebKitIconDatabase *database);

`webkit_icon_database_get_path` has been deprecated since version 1.8 and should not be used in newly-written code.

Use `webkit_favicon_database_get_path()` instead.

Determines the absolute path to the database folder on disk.

#### Parameters

database | a WebKitIconDatabase |

#### Returns

the absolute path of the database folder, or `NULL`

Since 1.3.13

### webkit_icon_database_get_type ()

    GType
    webkit_icon_database_get_type (void);

#### Returns

### webkit_icon_database_set_path ()

    void
    webkit_icon_database_set_path (WebKitIconDatabase *database,
                                   const gchar *path);

`webkit_icon_database_set_path` has been deprecated since version 1.8 and should not be used in newly-written code.

Use `webkit_favicon_database_set_path()` instead.

Specifies the absolute path to the database folder on disk.

Passing `NULL` or "" disables the icon database.

#### Parameters

database | a WebKitIconDatabase |
path | an absolute path to the icon database folder |

Since 1.3.13

## Types and Values

### WebKitIconDatabase

    typedef struct _WebKitIconDatabase WebKitIconDatabase;

## Property Details

### The `“path”` property

      “path”                     gchar *

The absolute path of the icon database folder.

`WebKitIconDatabase:path` has been deprecated since version 1.8 and should not be used in newly-written code.

Use WebKitFaviconDatabase::path instead.

Flags: Read / Write

Default value: NULL

Since 1.3.13

## Signal Details

### The `“icon-loaded”` signal

    void
    user_function (WebKitIconDatabase *database,
                   WebKitWebFrame     *frame,
                   gchar              *frame_uri,
                   gpointer            user_data)

This signal is emitted when a favicon is available for a page, or a child frame. See WebKitWebView::icon-loaded if you only need the favicon for the main frame of a particular WebKitWebView.

`WebKitIconDatabase::icon-loaded` has been deprecated since version 1.8 and should not be used in newly-written code.

Use WebKitFaviconDatabase::icon-loaded instead.

#### Parameters

database | the object on which the signal is emitted |
frame | the frame containing the icon |
frame_uri | the URI of the frame containing the icon |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since 1.3.13