Trait webkit2gtk::prelude::FaviconDatabaseExt
source · [−]pub trait FaviconDatabaseExt: 'static {
fn clear(&self);
fn favicon<P: FnOnce(Result<Surface, Error>) + 'static>(
&self,
page_uri: &str,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
);
fn favicon_future(
&self,
page_uri: &str
) -> Pin<Box_<dyn Future<Output = Result<Surface, Error>> + 'static>>;
fn favicon_uri(&self, page_uri: &str) -> Option<GString>;
fn connect_favicon_changed<F: Fn(&Self, &str, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId;
}
Expand description
Required Methods
sourcefn favicon<P: FnOnce(Result<Surface, Error>) + 'static>(
&self,
page_uri: &str,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
)
fn favicon<P: FnOnce(Result<Surface, Error>) + 'static>(
&self,
page_uri: &str,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
)
Asynchronously obtains a cairo::Surface
of the favicon.
Asynchronously obtains a cairo::Surface
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 webkit_favicon_database_get_favicon_finish()
to get the result of the operation.
You must call WebContextExt::set_favicon_database_directory()
for
the WebContext
associated with this FaviconDatabase
before attempting to use this function; otherwise,
webkit_favicon_database_get_favicon_finish()
will return
FaviconDatabaseError::NotInitialized
.
page_uri
URI of the page for which we want to retrieve the favicon
cancellable
A gio::Cancellable
or None
.
callback
A GAsyncReadyCallback
to call when the request is
satisfied or None
if you don’t care about the result.
fn favicon_future(
&self,
page_uri: &str
) -> Pin<Box_<dyn Future<Output = Result<Surface, Error>> + 'static>>
sourcefn favicon_uri(&self, page_uri: &str) -> Option<GString>
fn favicon_uri(&self, page_uri: &str) -> Option<GString>
sourcefn connect_favicon_changed<F: Fn(&Self, &str, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_favicon_changed<F: Fn(&Self, &str, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId
This signal is emitted when the favicon URI of page_uri
has
been changed to favicon_uri
in the database. You can connect
to this signal and call favicon()
to get the favicon. If you are interested in the favicon of a
WebView
it’s easier to use the property::WebView::favicon
property. See WebViewExt::favicon()
for more details.
page_uri
the URI of the Web page containing the icon
favicon_uri
the URI of the favicon