Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
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.
- newtype FaviconDatabase = FaviconDatabase (ManagedPtr FaviconDatabase)
- class GObject o => IsFaviconDatabase o
- toFaviconDatabase :: IsFaviconDatabase o => o -> IO FaviconDatabase
- noFaviconDatabase :: Maybe FaviconDatabase
- data FaviconDatabaseClearMethodInfo
- faviconDatabaseClear :: (HasCallStack, MonadIO m, IsFaviconDatabase a) => a -> m ()
- data FaviconDatabaseGetFaviconPixbufMethodInfo
- faviconDatabaseGetFaviconPixbuf :: (HasCallStack, MonadIO m, IsFaviconDatabase a, IsCancellable b) => a -> Text -> Word32 -> Word32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- data FaviconDatabaseGetFaviconPixbufFinishMethodInfo
- faviconDatabaseGetFaviconPixbufFinish :: (HasCallStack, MonadIO m, IsFaviconDatabase a, IsAsyncResult b) => a -> b -> m Pixbuf
- data FaviconDatabaseGetFaviconUriMethodInfo
- faviconDatabaseGetFaviconUri :: (HasCallStack, MonadIO m, IsFaviconDatabase a) => a -> Text -> m Text
- data FaviconDatabaseGetPathMethodInfo
- faviconDatabaseGetPath :: (HasCallStack, MonadIO m, IsFaviconDatabase a) => a -> m Text
- data FaviconDatabaseSetPathMethodInfo
- faviconDatabaseSetPath :: (HasCallStack, MonadIO m, IsFaviconDatabase a) => a -> Maybe Text -> m ()
- data FaviconDatabaseTryGetFaviconPixbufMethodInfo
- faviconDatabaseTryGetFaviconPixbuf :: (HasCallStack, MonadIO m, IsFaviconDatabase a) => a -> Text -> Word32 -> Word32 -> m Pixbuf
- data FaviconDatabasePathPropertyInfo
- clearFaviconDatabasePath :: (MonadIO m, IsFaviconDatabase o) => o -> m ()
- constructFaviconDatabasePath :: IsFaviconDatabase o => Text -> IO (GValueConstruct o)
- faviconDatabasePath :: AttrLabelProxy "path"
- getFaviconDatabasePath :: (MonadIO m, IsFaviconDatabase o) => o -> m Text
- setFaviconDatabasePath :: (MonadIO m, IsFaviconDatabase o) => o -> Text -> m ()
- type C_FaviconDatabaseIconLoadedCallback = Ptr () -> CString -> Ptr () -> IO ()
- type FaviconDatabaseIconLoadedCallback = Text -> IO ()
- data FaviconDatabaseIconLoadedSignalInfo
- afterFaviconDatabaseIconLoaded :: (IsFaviconDatabase a, MonadIO m) => a -> FaviconDatabaseIconLoadedCallback -> m SignalHandlerId
- genClosure_FaviconDatabaseIconLoaded :: FaviconDatabaseIconLoadedCallback -> IO Closure
- mk_FaviconDatabaseIconLoadedCallback :: C_FaviconDatabaseIconLoadedCallback -> IO (FunPtr C_FaviconDatabaseIconLoadedCallback)
- noFaviconDatabaseIconLoadedCallback :: Maybe FaviconDatabaseIconLoadedCallback
- onFaviconDatabaseIconLoaded :: (IsFaviconDatabase a, MonadIO m) => a -> FaviconDatabaseIconLoadedCallback -> m SignalHandlerId
- wrap_FaviconDatabaseIconLoadedCallback :: FaviconDatabaseIconLoadedCallback -> Ptr () -> CString -> Ptr () -> IO ()
Exported types
newtype FaviconDatabase Source #
GObject FaviconDatabase Source # | |
IsObject FaviconDatabase Source # | |
IsFaviconDatabase FaviconDatabase Source # | |
((~) * info (ResolveFaviconDatabaseMethod t FaviconDatabase), MethodInfo * info FaviconDatabase p) => IsLabel t (FaviconDatabase -> p) Source # | |
((~) * info (ResolveFaviconDatabaseMethod t FaviconDatabase), MethodInfo * info FaviconDatabase p) => IsLabelProxy t (FaviconDatabase -> p) Source # | |
HasAttributeList * FaviconDatabase Source # | |
type AttributeList FaviconDatabase Source # | |
type SignalList FaviconDatabase Source # | |
class GObject o => IsFaviconDatabase o Source #
toFaviconDatabase :: IsFaviconDatabase o => o -> IO FaviconDatabase Source #
Methods
clear
data FaviconDatabaseClearMethodInfo Source #
((~) * signature (m ()), MonadIO m, IsFaviconDatabase a) => MethodInfo * FaviconDatabaseClearMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsFaviconDatabase a) | |
=> a |
|
-> m () |
Clears all icons from the database.
Since: 1.8
getFaviconPixbuf
data FaviconDatabaseGetFaviconPixbufMethodInfo Source #
((~) * signature (Text -> Word32 -> Word32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsFaviconDatabase a, IsCancellable b) => MethodInfo * FaviconDatabaseGetFaviconPixbufMethodInfo a signature Source # | |
faviconDatabaseGetFaviconPixbuf Source #
:: (HasCallStack, MonadIO m, IsFaviconDatabase a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Word32 |
|
-> Word32 |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> 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
data FaviconDatabaseGetFaviconPixbufFinishMethodInfo Source #
((~) * signature (b -> m Pixbuf), MonadIO m, IsFaviconDatabase a, IsAsyncResult b) => MethodInfo * FaviconDatabaseGetFaviconPixbufFinishMethodInfo a signature Source # | |
faviconDatabaseGetFaviconPixbufFinish Source #
:: (HasCallStack, MonadIO m, IsFaviconDatabase a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m Pixbuf | Returns: a new reference to a |
Finishes an operation started with faviconDatabaseGetFaviconPixbuf
.
Since: 1.8
getFaviconUri
data FaviconDatabaseGetFaviconUriMethodInfo Source #
((~) * signature (Text -> m Text), MonadIO m, IsFaviconDatabase a) => MethodInfo * FaviconDatabaseGetFaviconUriMethodInfo a signature Source # | |
faviconDatabaseGetFaviconUri Source #
:: (HasCallStack, MonadIO m, IsFaviconDatabase a) | |
=> a |
|
-> Text |
|
-> m Text | Returns: a newly allocated URI for the favicon, or |
Obtains the URI for the favicon for the given page URI.
See also webViewGetIconUri
.
Since: 1.8
getPath
data FaviconDatabaseGetPathMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsFaviconDatabase a) => MethodInfo * FaviconDatabaseGetPathMethodInfo a signature Source # | |
faviconDatabaseGetPath Source #
:: (HasCallStack, MonadIO m, IsFaviconDatabase a) | |
=> a |
|
-> m Text | Returns: the absolute path of the database folder, or |
Determines the absolute path to the database folder on disk.
Since: 1.8
setPath
data FaviconDatabaseSetPathMethodInfo Source #
((~) * signature (Maybe Text -> m ()), MonadIO m, IsFaviconDatabase a) => MethodInfo * FaviconDatabaseSetPathMethodInfo a signature Source # | |
faviconDatabaseSetPath Source #
:: (HasCallStack, MonadIO m, IsFaviconDatabase a) | |
=> a |
|
-> Maybe Text |
|
-> 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
data FaviconDatabaseTryGetFaviconPixbufMethodInfo Source #
((~) * signature (Text -> Word32 -> Word32 -> m Pixbuf), MonadIO m, IsFaviconDatabase a) => MethodInfo * FaviconDatabaseTryGetFaviconPixbufMethodInfo a signature Source # | |
faviconDatabaseTryGetFaviconPixbuf Source #
:: (HasCallStack, MonadIO m, IsFaviconDatabase a) | |
=> a |
|
-> Text |
|
-> Word32 |
|
-> Word32 |
|
-> m Pixbuf | Returns: a new reference to a |
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
data FaviconDatabasePathPropertyInfo Source #
clearFaviconDatabasePath :: (MonadIO m, IsFaviconDatabase o) => o -> m () Source #
constructFaviconDatabasePath :: IsFaviconDatabase o => Text -> IO (GValueConstruct o) Source #
faviconDatabasePath :: AttrLabelProxy "path" Source #
getFaviconDatabasePath :: (MonadIO m, IsFaviconDatabase o) => o -> m Text Source #
setFaviconDatabasePath :: (MonadIO m, IsFaviconDatabase o) => o -> Text -> m () Source #
Signals
iconLoaded
type FaviconDatabaseIconLoadedCallback = Text -> IO () Source #
afterFaviconDatabaseIconLoaded :: (IsFaviconDatabase a, MonadIO m) => a -> FaviconDatabaseIconLoadedCallback -> m SignalHandlerId Source #
mk_FaviconDatabaseIconLoadedCallback :: C_FaviconDatabaseIconLoadedCallback -> IO (FunPtr C_FaviconDatabaseIconLoadedCallback) Source #
onFaviconDatabaseIconLoaded :: (IsFaviconDatabase a, MonadIO m) => a -> FaviconDatabaseIconLoadedCallback -> m SignalHandlerId Source #
wrap_FaviconDatabaseIconLoadedCallback :: FaviconDatabaseIconLoadedCallback -> Ptr () -> CString -> Ptr () -> IO () Source #