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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT
use glib::object::IsA;
#[cfg(any(feature = "v2_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
use glib::translate::*;
use std::fmt;
glib::wrapper! {
#[doc(alias = "WebKitFrame")]
pub struct Frame(Object<ffi::WebKitFrame, ffi::WebKitFrameClass>);
match fn {
type_ => || ffi::webkit_frame_get_type(),
}
}
impl Frame {
pub const NONE: Option<&'static Frame> = None;
}
pub trait FrameExt: 'static {
#[cfg(any(feature = "v2_26", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_26")))]
#[doc(alias = "webkit_frame_get_id")]
#[doc(alias = "get_id")]
fn id(&self) -> u64;
//#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
//#[cfg(any(feature = "v2_2", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
//#[doc(alias = "webkit_frame_get_javascript_context_for_script_world")]
//#[doc(alias = "get_javascript_context_for_script_world")]
//fn javascript_context_for_script_world(&self, world: &impl IsA<ScriptWorld>) -> /*Ignored*/Option<java_script_core::GlobalContextRef>;
//#[cfg_attr(feature = "v2_22", deprecated = "Since 2.22")]
//#[cfg(any(feature = "v2_2", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
//#[doc(alias = "webkit_frame_get_javascript_global_context")]
//#[doc(alias = "get_javascript_global_context")]
//fn javascript_global_context(&self) -> /*Ignored*/Option<java_script_core::GlobalContextRef>;
//#[cfg(any(feature = "v2_22", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_22")))]
//#[doc(alias = "webkit_frame_get_js_context")]
//#[doc(alias = "get_js_context")]
//fn js_context(&self) -> /*Ignored*/Option<java_script_core::Context>;
//#[cfg(any(feature = "v2_22", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_22")))]
//#[doc(alias = "webkit_frame_get_js_context_for_script_world")]
//#[doc(alias = "get_js_context_for_script_world")]
//fn js_context_for_script_world(&self, world: &impl IsA<ScriptWorld>) -> /*Ignored*/Option<java_script_core::Context>;
//#[cfg(any(feature = "v2_22", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_22")))]
//#[doc(alias = "webkit_frame_get_js_value_for_dom_object")]
//#[doc(alias = "get_js_value_for_dom_object")]
//fn js_value_for_dom_object(&self, dom_object: &impl IsA<DOMObject>) -> /*Ignored*/Option<java_script_core::Value>;
//#[cfg(any(feature = "v2_22", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_22")))]
//#[doc(alias = "webkit_frame_get_js_value_for_dom_object_in_script_world")]
//#[doc(alias = "get_js_value_for_dom_object_in_script_world")]
//fn js_value_for_dom_object_in_script_world(&self, dom_object: &impl IsA<DOMObject>, world: &impl IsA<ScriptWorld>) -> /*Ignored*/Option<java_script_core::Value>;
#[cfg(any(feature = "v2_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
#[doc(alias = "webkit_frame_get_uri")]
#[doc(alias = "get_uri")]
fn uri(&self) -> Option<glib::GString>;
#[cfg(any(feature = "v2_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
#[doc(alias = "webkit_frame_is_main_frame")]
fn is_main_frame(&self) -> bool;
}
impl<O: IsA<Frame>> FrameExt for O {
#[cfg(any(feature = "v2_26", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_26")))]
fn id(&self) -> u64 {
unsafe {
ffi::webkit_frame_get_id(self.as_ref().to_glib_none().0)
}
}
//#[cfg(any(feature = "v2_2", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
//fn javascript_context_for_script_world(&self, world: &impl IsA<ScriptWorld>) -> /*Ignored*/Option<java_script_core::GlobalContextRef> {
// unsafe { TODO: call ffi:webkit_frame_get_javascript_context_for_script_world() }
//}
//#[cfg(any(feature = "v2_2", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
//fn javascript_global_context(&self) -> /*Ignored*/Option<java_script_core::GlobalContextRef> {
// unsafe { TODO: call ffi:webkit_frame_get_javascript_global_context() }
//}
//#[cfg(any(feature = "v2_22", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_22")))]
//fn js_context(&self) -> /*Ignored*/Option<java_script_core::Context> {
// unsafe { TODO: call ffi:webkit_frame_get_js_context() }
//}
//#[cfg(any(feature = "v2_22", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_22")))]
//fn js_context_for_script_world(&self, world: &impl IsA<ScriptWorld>) -> /*Ignored*/Option<java_script_core::Context> {
// unsafe { TODO: call ffi:webkit_frame_get_js_context_for_script_world() }
//}
//#[cfg(any(feature = "v2_22", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_22")))]
//fn js_value_for_dom_object(&self, dom_object: &impl IsA<DOMObject>) -> /*Ignored*/Option<java_script_core::Value> {
// unsafe { TODO: call ffi:webkit_frame_get_js_value_for_dom_object() }
//}
//#[cfg(any(feature = "v2_22", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_22")))]
//fn js_value_for_dom_object_in_script_world(&self, dom_object: &impl IsA<DOMObject>, world: &impl IsA<ScriptWorld>) -> /*Ignored*/Option<java_script_core::Value> {
// unsafe { TODO: call ffi:webkit_frame_get_js_value_for_dom_object_in_script_world() }
//}
#[cfg(any(feature = "v2_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
fn uri(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::webkit_frame_get_uri(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v2_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_2")))]
fn is_main_frame(&self) -> bool {
unsafe {
from_glib(ffi::webkit_frame_is_main_frame(self.as_ref().to_glib_none().0))
}
}
}
impl fmt::Display for Frame {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Frame")
}
}