Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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.
If Settings:enablePrivateBrowsing 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
- newtype FaviconDatabase = FaviconDatabase (ManagedPtr FaviconDatabase)
- class (GObject o, IsDescendantOf FaviconDatabase o) => IsFaviconDatabase o
- toFaviconDatabase :: (MonadIO m, IsFaviconDatabase o) => o -> m FaviconDatabase
- faviconDatabaseClear :: (HasCallStack, MonadIO m, IsFaviconDatabase a) => a -> m ()
- faviconDatabaseGetFavicon :: (HasCallStack, MonadIO m, IsFaviconDatabase a, IsCancellable b) => a -> Text -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- faviconDatabaseGetFaviconFinish :: (HasCallStack, MonadIO m, IsFaviconDatabase a, IsAsyncResult b) => a -> b -> m Surface
- faviconDatabaseGetFaviconUri :: (HasCallStack, MonadIO m, IsFaviconDatabase a) => a -> Text -> m (Maybe Text)
- type FaviconDatabaseFaviconChangedCallback = Text -> Text -> IO ()
- afterFaviconDatabaseFaviconChanged :: (IsFaviconDatabase a, MonadIO m) => a -> ((?self :: a) => FaviconDatabaseFaviconChangedCallback) -> m SignalHandlerId
- onFaviconDatabaseFaviconChanged :: (IsFaviconDatabase a, MonadIO m) => a -> ((?self :: a) => FaviconDatabaseFaviconChangedCallback) -> m SignalHandlerId
Exported types
newtype FaviconDatabase Source #
Memory-managed wrapper type.
FaviconDatabase (ManagedPtr FaviconDatabase) |
Instances
class (GObject o, IsDescendantOf FaviconDatabase o) => IsFaviconDatabase o Source #
Type class for types which can be safely cast to FaviconDatabase
, for instance with toFaviconDatabase
.
Instances
(GObject o, IsDescendantOf FaviconDatabase o) => IsFaviconDatabase o Source # | |
Defined in GI.WebKit2.Objects.FaviconDatabase |
toFaviconDatabase :: (MonadIO m, IsFaviconDatabase o) => o -> m FaviconDatabase Source #
Cast to FaviconDatabase
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, clear, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getFavicon, getFaviconFinish, getFaviconUri, getProperty, getQdata.
Setters
clear
:: (HasCallStack, MonadIO m, IsFaviconDatabase a) | |
=> a |
|
-> m () |
Clears all icons from the database.
getFavicon
faviconDatabaseGetFavicon Source #
:: (HasCallStack, MonadIO m, IsFaviconDatabase a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously obtains a favicon image.
Asynchronously obtains an image of the favicon for the given page URI. It 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 faviconDatabaseGetFaviconFinish
to get the result of the operation.
getFaviconFinish
faviconDatabaseGetFaviconFinish Source #
:: (HasCallStack, MonadIO m, IsFaviconDatabase a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m Surface | Returns: a new favicon image, or |
Finishes an operation started with faviconDatabaseGetFavicon
.
getFaviconUri
faviconDatabaseGetFaviconUri Source #
:: (HasCallStack, MonadIO m, IsFaviconDatabase a) | |
=> a |
|
-> Text |
|
-> m (Maybe Text) | Returns: a newly allocated URI for the favicon, or |
Obtains the URI of the favicon for the given pageUri
.
Signals
faviconChanged
type FaviconDatabaseFaviconChangedCallback Source #
= Text |
|
-> Text |
|
-> IO () |
This signal is emitted when the favicon URI of pageUri
has
been changed to faviconUri
in the database. You can connect
to this signal and call faviconDatabaseGetFavicon
to get the favicon. If you are interested in the favicon of a
WebView
it's easier to use the WebView:favicon
property. See webViewGetFavicon
for more details.
afterFaviconDatabaseFaviconChanged :: (IsFaviconDatabase a, MonadIO m) => a -> ((?self :: a) => FaviconDatabaseFaviconChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the faviconChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
faviconDatabase #faviconChanged callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onFaviconDatabaseFaviconChanged :: (IsFaviconDatabase a, MonadIO m) => a -> ((?self :: a) => FaviconDatabaseFaviconChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the faviconChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
faviconDatabase #faviconChanged callback