gi-webkit-3.0.14: WebKit bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.WebKit.Objects.FaviconDatabase

Contents

Description

FaviconDatabase provides access to the icons associated with web sites.

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 a memory cache if possible. That cache is frozen to an on-disk database for persistence.

The database is disabled by default. In order for icons to be stored and accessed, you will need to set an icon database path using faviconDatabaseSetPath. Disable the database again passing Nothing to the previous call.

If WebKitWebSettings::enable-private-browsing is True new icons won't be added to the on-disk database and no existing icons will be deleted from it. Nevertheless, WebKit will still store them in the in-memory cache during the current execution.

Synopsis

Exported types

Methods

clear

faviconDatabaseClear Source #

Arguments

:: (HasCallStack, MonadIO m, IsFaviconDatabase a) 
=> a

database: a FaviconDatabase

-> m () 

Clears all icons from the database.

Since: 1.8

getFaviconPixbuf

faviconDatabaseGetFaviconPixbuf Source #

Arguments

:: (HasCallStack, MonadIO m, IsFaviconDatabase a, IsCancellable b) 
=> a

database: a FaviconDatabase

-> Text

pageUri: URI of the page containing the icon

-> Word32

width: the desired width for the icon

-> Word32

height: the desired height for the icon

-> Maybe b

cancellable: A Cancellable or Nothing.

-> Maybe AsyncReadyCallback

callback: A AsyncReadyCallback to call when the request is satisfied or Nothing if you don't care about the result.

-> m () 

Asynchronously obtains a Pixbuf of the favicon for the given page URI. The advantage of this method over faviconDatabaseTryGetFaviconPixbuf is that it always returns the cached icon if it's in the database asynchronously waiting for the icon to be read from the database.

This is an asynchronous method. When the operation is finished, callback will be invoked. You can then call faviconDatabaseGetFaviconPixbufFinish to get the result of the operation. See also faviconDatabaseTryGetFaviconPixbuf.

If width and height are both 0 then this method will return the maximum available size for the icon. Note that if you specify a different size the icon will be scaled each time you call this function.

Since: 1.8

getFaviconPixbufFinish

faviconDatabaseGetFaviconPixbufFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFaviconDatabase a, IsAsyncResult b) 
=> a

database: a FaviconDatabase

-> b

result: A AsyncResult obtained from the AsyncReadyCallback passed to faviconDatabaseGetFaviconPixbuf

-> m Pixbuf

Returns: a new reference to a Pixbuf, or Nothing. (Can throw GError)

Finishes an operation started with faviconDatabaseGetFaviconPixbuf.

Since: 1.8

getFaviconUri

faviconDatabaseGetFaviconUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsFaviconDatabase a) 
=> a

database: a FaviconDatabase

-> Text

pageUri: URI of the page containing the icon

-> m Text

Returns: a newly allocated URI for the favicon, or Nothing

Obtains the URI for the favicon for the given page URI. See also webViewGetIconUri.

Since: 1.8

getPath

faviconDatabaseGetPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsFaviconDatabase a) 
=> a

database: a FaviconDatabase

-> m Text

Returns: the absolute path of the database folder, or Nothing

Determines the absolute path to the database folder on disk.

Since: 1.8

setPath

faviconDatabaseSetPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsFaviconDatabase a) 
=> a

database: a FaviconDatabase

-> Maybe Text

path: an absolute path to the icon database folder or Nothing to disable the database

-> m () 

Specifies the absolute path to the database folder on disk. The icon database will only be enabled after a call to this method.

Passing Nothing or "" as path disables the icon database.

Since: 1.8

tryGetFaviconPixbuf

faviconDatabaseTryGetFaviconPixbuf Source #

Arguments

:: (HasCallStack, MonadIO m, IsFaviconDatabase a) 
=> a

database: a FaviconDatabase

-> Text

pageUri: URI of the page containing the icon

-> Word32

width: the desired width for the icon

-> Word32

height: the desired height for the icon

-> m Pixbuf

Returns: a new reference to a Pixbuf, or Nothing if the given URI doesn't have an icon or it hasn't been loaded yet.

Obtains a Pixbuf of the favicon for the given page URI, or Nothing if there is no icon for the given page or it hasn't been loaded from disk yet. Use faviconDatabaseGetFaviconUri if you need to distinguish these cases. To make sure this method will return a valid icon when the given URI has one, you should connect to FaviconDatabase::icon-loaded and use this function in the callback.

If width and height ar both 0 then this method will return the maximum available size for the icon. Note that if you specify a different size the icon will be scaled each time you call this function.

Since: 1.8

Properties

path

Signals

iconLoaded