1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use webkit2_sys;
glib_wrapper! {
pub struct BackForwardListItem(Object<webkit2_sys::WebKitBackForwardListItem, webkit2_sys::WebKitBackForwardListItemClass, BackForwardListItemClass>);
match fn {
get_type => || webkit2_sys::webkit_back_forward_list_item_get_type(),
}
}
pub const NONE_BACK_FORWARD_LIST_ITEM: Option<&BackForwardListItem> = None;
pub trait BackForwardListItemExt: 'static {
fn get_original_uri(&self) -> Option<GString>;
fn get_title(&self) -> Option<GString>;
fn get_uri(&self) -> Option<GString>;
}
impl<O: IsA<BackForwardListItem>> BackForwardListItemExt for O {
fn get_original_uri(&self) -> Option<GString> {
unsafe {
from_glib_none(webkit2_sys::webkit_back_forward_list_item_get_original_uri(self.as_ref().to_glib_none().0))
}
}
fn get_title(&self) -> Option<GString> {
unsafe {
from_glib_none(webkit2_sys::webkit_back_forward_list_item_get_title(self.as_ref().to_glib_none().0))
}
}
fn get_uri(&self) -> Option<GString> {
unsafe {
from_glib_none(webkit2_sys::webkit_back_forward_list_item_get_uri(self.as_ref().to_glib_none().0))
}
}
}
impl fmt::Display for BackForwardListItem {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "BackForwardListItem")
}
}